From d7586765d7de713073378e10e0d10c7186f65697 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Sun, 12 Mar 2023 15:13:38 +0100 Subject: [PATCH] tinySA3 touch repaired and HAM_BANDS added --- NANOVNA_STM32_F072/mcuconf.h | 2 +- nanovna.h | 2 +- ui.c | 12 ++++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/NANOVNA_STM32_F072/mcuconf.h b/NANOVNA_STM32_F072/mcuconf.h index 83b96f1..241b42d 100644 --- a/NANOVNA_STM32_F072/mcuconf.h +++ b/NANOVNA_STM32_F072/mcuconf.h @@ -101,7 +101,7 @@ /* * GPT driver system settings. */ -#define STM32_GPT_USE_TIM1 TRUE +#define STM32_GPT_USE_TIM1 FALSE #define STM32_GPT_USE_TIM2 FALSE #define STM32_GPT_USE_TIM3 TRUE #define STM32_GPT_USE_TIM14 TRUE diff --git a/nanovna.h b/nanovna.h index 1e661db..e200aee 100644 --- a/nanovna.h +++ b/nanovna.h @@ -85,7 +85,7 @@ #ifdef TINYSA3 #define __HAS_DFU__ #define __MCU_CLOCK_SHIFT__ -//#define __HAM_BAND__ +#define __HAM_BAND__ #endif #ifdef TINYSA4 #define __BANDS__ diff --git a/ui.c b/ui.c index 13e5570..83fef5a 100644 --- a/ui.c +++ b/ui.c @@ -349,8 +349,13 @@ static void touch_init(void){ // Prepare pin for measure touch event touch_prepare_sense(); // Start touch interrupt, used timer_3 ADC check threshold: - gptStart(&GPTD1, &gpt3cfg); // Init timer 3 - gptStartContinuous(&GPTD1, 10); // Start timer 3 vs timer 10 interval +#ifdef TINYSA4 + gptStart(&GPTD1, &gpt3cfg); // Init timer 1 + gptStartContinuous(&GPTD1, 10); // Start timer 1 vs timer 10 interval +#else + gptStart(&GPTD3, &gpt3cfg); // Init timer 3 + gptStartContinuous(&GPTD3, 10); // Start timer 3 vs timer 10 interval +#endif touch_start_watchdog(); // Start ADC watchdog (measure by timer 3 interval and trigger interrupt if touch pressed) } @@ -4739,6 +4744,9 @@ static const menuitem_t menu_config2[] = #ifdef TINYSA4 { MT_SUBMENU, 0, "EXPERT\nCONFIG", menu_settings}, #else +#ifdef __HAM_BAND__ + { MT_ADV_CALLBACK, 0, "HAM\nBANDS", menu_settings_ham_bands}, +#endif { MT_SUBMENU, 0, "EXPERT\nCONFIG", menu_settings2}, #endif { MT_NONE, 0, NULL, menu_back} // next-> menu_back