Moved LISTEN to main loop

Removed_REF_marker
erikkaashoek 5 years ago
parent d8e061a751
commit 7f6c9fe609

@ -154,6 +154,13 @@ static THD_FUNCTION(Thread1, arg)
} else if (sweep_mode & SWEEP_REMOTE) { } else if (sweep_mode & SWEEP_REMOTE) {
sweep_remote(); sweep_remote();
#endif #endif
#ifdef __LISTEN__
} else if (sweep_mode & SWEEP_LISTEN) {
if (markers[active_marker].enabled == M_ENABLED) {
perform(false,0,frequencies[markers[active_marker].index], false);
SI4432_Listen(MODE_SELECT(setting.mode));
}
#endif
#ifdef __CALIBRATE__ #ifdef __CALIBRATE__
} else if (sweep_mode & SWEEP_CALIBRATE) { } else if (sweep_mode & SWEEP_CALIBRATE) {
// call from lowest level to save stack space // call from lowest level to save stack space

@ -250,8 +250,10 @@ enum {
#define SWEEP_CALIBRATE 0x04 #define SWEEP_CALIBRATE 0x04
#define SWEEP_SELFTEST 0x08 #define SWEEP_SELFTEST 0x08
#define SWEEP_REMOTE 0x10 #define SWEEP_REMOTE 0x10
#ifdef __LISTEN__
#define SWEEP_LISTEN 0x20
//#define SWEEP_FACTORY 0x20 //#define SWEEP_FACTORY 0x20
#endif
extern uint8_t sweep_mode; extern uint8_t sweep_mode;
extern bool completed; extern bool completed;

@ -741,7 +741,7 @@ void SI4432_Listen(int s)
count++; count++;
v = max - v; v = max - v;
dacPutChannelX(&DACD2, 0, dBm_to_volt[v] << 4); dacPutChannelX(&DACD2, 0, dBm_to_volt[v] << 4);
} while((operation_requested & OP_LEVER) != OP_LEVER); } while(operation_requested == OP_NONE);
count = 0; count = 0;
dacPutChannelX(&DACD2, 0, 0); dacPutChannelX(&DACD2, 0, 0);
} }

@ -687,16 +687,31 @@ static UI_FUNCTION_CALLBACK(menu_dfu_cb)
} }
#ifdef __LISTEN__ #ifdef __LISTEN__
static UI_FUNCTION_CALLBACK(menu_listen_cb) static UI_FUNCTION_ADV_CALLBACK(menu_listen_acb)
{ {
(void)data; (void)data;
(void)item; (void)item;
if (b){
b->icon = (sweep_mode & SWEEP_LISTEN) ? BUTTON_ICON_CHECK : BUTTON_ICON_NOCHECK;
return;
}
if (sweep_mode & SWEEP_LISTEN) {
sweep_mode = SWEEP_ENABLE;
} else {
sweep_mode = SWEEP_LISTEN;
}
ui_mode_normal();
redraw_frame();
request_to_redraw_grid();
#if 0
if (markers[active_marker].enabled == M_ENABLED) { if (markers[active_marker].enabled == M_ENABLED) {
do { do {
perform(false,0,frequencies[markers[active_marker].index], false); perform(false,0,frequencies[markers[active_marker].index], false);
SI4432_Listen(MODE_SELECT(setting.mode)); SI4432_Listen(MODE_SELECT(setting.mode));
} while (ui_process_listen_lever()); } while (ui_process_listen_lever());
} }
#endif
} }
#endif #endif
@ -2174,7 +2189,7 @@ static const menuitem_t menu_level[] = {
#endif #endif
{ MT_SUBMENU, 0, "TRIGGER", menu_trigger}, { MT_SUBMENU, 0, "TRIGGER", menu_trigger},
#ifdef __LISTEN__ #ifdef __LISTEN__
{ MT_CALLBACK, 0, "LISTEN", menu_listen_cb}, { MT_ADV_CALLBACK, 0, "LISTEN", menu_listen_acb},
#endif #endif
{ MT_CANCEL, 0, S_LARROW" BACK",NULL }, { MT_CANCEL, 0, S_LARROW" BACK",NULL },
{ MT_NONE, 0, NULL, NULL } // sentinel { MT_NONE, 0, NULL, NULL } // sentinel

Loading…
Cancel
Save

Powered by TurnKey Linux.