Debug code for ADC readings
@@ -147,6 +147,17 @@ void blit_enable_amp() {
HAL_GPIO_WritePin(AMP_SHUTDOWN_GPIO_Port, AMP_SHUTDOWN_Pin, GPIO_PIN_SET);
}
+void hook_render(uint32_t time) {
+ ::render(time);
+
+ blit::fb.pen(rgba(255, 255, 255));
+ for(auto i = 0; i < ADC_BUFFER_SIZE; i++) {
+ int x = i / 8;
+ int y = i % 8;
+ blit::fb.text(std::to_string(adc1data[i]), &minimal_font[0][0], point(x * 30, y * 10));
+ }
+}
+
void blit_init() {
// enable cycle counting
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
@@ -176,7 +187,7 @@ void blit_init() {
display::set_screen_mode(blit::lores);
blit::update = ::update;
- blit::render = ::render;
+ blit::render = hook_render;
blit::init = ::init;
blit::open_file = ::open_file;
blit::read_file = ::read_file;
@@ -374,8 +385,6 @@ void blit_menu() {
}
}
-
-
void blit_update_vibration() {
__HAL_TIM_SetCompare(&htim4, TIM_CHANNEL_1, vibration * 2000.0f);
}
