From e95e79c8e579e1112d85696ebc041a5c3044e8a8 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Sat, 25 Nov 2023 13:59:40 +0100 Subject: [PATCH] cleanup --- main.c | 6 +++++- ui.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index a305be5..df24beb 100644 --- a/main.c +++ b/main.c @@ -2817,7 +2817,11 @@ void my_microsecond_delay(int t) void my_veryfast_delay(int t) // In 8MHz ticks { - if (t>0) gptPolledDelay(&DELAY_TIMER, t); + while (t >= 0x1000) { // 16 bit timer + gptPolledDelay(&DELAY_TIMER, 0x1000); // t us delay + t -= 0x1000; + } + if (t>1) gptPolledDelay(&DELAY_TIMER, t); // t us delay } /* Main thread stack size defined in makefile USE_PROCESS_STACKSIZE = 0x200 diff --git a/ui.c b/ui.c index 8251e8a..30beeb2 100644 --- a/ui.c +++ b/ui.c @@ -1922,8 +1922,10 @@ static UI_FUNCTION_CALLBACK(menu_output_curve_prepare_cb) { (void)item; (void)data; +#ifdef TINYSA4 if (!output_is_calibrated()) return; +#endif current_curve = data; menu_push_submenu(menu_curve); } @@ -4660,6 +4662,7 @@ static const menuitem_t menu_curve_confirm[] = { { MT_NONE, 0, NULL, NULL } // sentinel }; +#ifdef TINYSA4 #define CORRECTION_LOW_IN 0 #define CORRECTION_LNA 1 @@ -4694,6 +4697,7 @@ static const menuitem_t menu_actual_out_power[] = { MT_NONE, 0, NULL, menu_back} // next-> menu_back }; #endif +#endif static const menuitem_t menu_actual_power[] =