Jog button hang and negative frequencies

pull/65/head
erikkaashoek 3 years ago
parent 6df64d7d38
commit aed244c78f

@ -208,6 +208,7 @@ extern const char * const trc_channel_name[];
#ifdef TINYSA3 #ifdef TINYSA3
typedef uint32_t freq_t; typedef uint32_t freq_t;
#define HALF_FREQ 0x8000000UL
typedef int32_t long_t; typedef int32_t long_t;
extern bool has_esd; extern bool has_esd;
#define CORRECTION_POINTS 10 // Frequency dependent level correction table entries #define CORRECTION_POINTS 10 // Frequency dependent level correction table entries
@ -220,6 +221,7 @@ typedef uint32_t freq_t;
#endif #endif
#ifdef TINYSA4 #ifdef TINYSA4
typedef uint64_t freq_t; typedef uint64_t freq_t;
#define HALF_FREQ 0x800000000000000ULL
typedef int64_t long_t; typedef int64_t long_t;
#define CORRECTION_POINTS 20 // Frequency dependent level correction table entries #define CORRECTION_POINTS 20 // Frequency dependent level correction table entries
#define CORRECTION_LOW_IN 0 #define CORRECTION_LOW_IN 0

@ -1602,11 +1602,17 @@ static void trace_print_value_string( // Only used at one place
step = step*10; step = step*10;
} }
} }
int negative = (freq > HALF_FREQ);
if (negative)
freq = - freq;
#ifdef TINYSA4 #ifdef TINYSA4
if (freq >= 1000000000) if (freq >= 1000000000)
digits += 3; digits += 3;
#endif #endif
plot_printf(ptr2, sizeof(buf2) - 9, "%9.*QHz", digits, freq); if (negative)
plot_printf(ptr2, sizeof(buf2) - 9, "-%9.*QHz", digits, freq);
else
plot_printf(ptr2, sizeof(buf2) - 9, "%9.*QHz", digits, freq);
} }
#ifdef __LEVEL_METER__ #ifdef __LEVEL_METER__
#ifdef TINYSA4 #ifdef TINYSA4

@ -7057,11 +7057,14 @@ ui_process_menu_lever(void)
const menuitem_t *menu = menu_stack[menu_current_level]; const menuitem_t *menu = menu_stack[menu_current_level];
int status = btn_check(); int status = btn_check();
if (status == 0) return; if (status == 0) return;
if (selection >=0 && status & EVT_BUTTON_SINGLE_CLICK) { uint16_t count = current_menu_get_count();
menu_invoke(selection); if (status & EVT_BUTTON_SINGLE_CLICK) {
if ((uint16_t)selection >= count)
ui_mode_normal();
else
menu_invoke(selection);
return; return;
} }
uint16_t count = current_menu_get_count();
do { do {
uint32_t mask = 1<<selection; uint32_t mask = 1<<selection;
if (status & EVT_UP ) selection++; if (status & EVT_UP ) selection++;

Loading…
Cancel
Save

Powered by TurnKey Linux.