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
typedef uint32_t freq_t;
#define HALF_FREQ 0x8000000UL
typedef int32_t long_t;
extern bool has_esd;
#define CORRECTION_POINTS 10 // Frequency dependent level correction table entries
@ -220,6 +221,7 @@ typedef uint32_t freq_t;
#endif
#ifdef TINYSA4
typedef uint64_t freq_t;
#define HALF_FREQ 0x800000000000000ULL
typedef int64_t long_t;
#define CORRECTION_POINTS 20 // Frequency dependent level correction table entries
#define CORRECTION_LOW_IN 0

@ -1602,11 +1602,17 @@ static void trace_print_value_string( // Only used at one place
step = step*10;
}
}
int negative = (freq > HALF_FREQ);
if (negative)
freq = - freq;
#ifdef TINYSA4
if (freq >= 1000000000)
digits += 3;
#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 TINYSA4

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

Loading…
Cancel
Save

Powered by TurnKey Linux.