Levelsweep warp error and show UI after cmd mode switch

pull/4/head
erikkaashoek 6 years ago
parent 88a9a0a866
commit 2c3a268c47

@ -740,6 +740,9 @@ int current_menu_is_form(void);
void menu_mode_cb(int, uint8_t); void menu_mode_cb(int, uint8_t);
void ui_mode_normal(void); void ui_mode_normal(void);
void ui_mode_menu(void); void ui_mode_menu(void);
void menu_push_lowoutput(void);
void menu_push_highoutput(void);
void menu_move_top(void);
// Irq operation process set // Irq operation process set
#define OP_NONE 0x00 #define OP_NONE 0x00

@ -1,5 +1,4 @@
/* Copyright (c) 2020, Erik Kaashoek erik@kaashoek.com /* All rights reserved.
* All rights reserved.
* *
* This is free software; you can redistribute it and/or modify * This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -37,19 +36,24 @@ VNA_SHELL_FUNCTION(cmd_mode)
int io = get_str_index(argv[1], cmd_in_out); int io = get_str_index(argv[1], cmd_in_out);
if (lh<0 || io<0) if (lh<0 || io<0)
goto usage; goto usage;
menu_move_top();
switch(lh+io*2) switch(lh+io*2)
{ {
case 0: case 0:
set_mode(M_LOW); set_mode(M_LOW);
ui_mode_normal();
break; break;
case 1: case 1:
set_mode(M_HIGH); set_mode(M_HIGH);
ui_mode_normal();
break; break;
case 2: case 2:
set_mode(M_GENLOW); set_mode(M_GENLOW);
menu_push_lowoutput();
break; break;
case 3: case 3:
set_mode(M_GENHIGH); set_mode(M_GENHIGH);
menu_push_highoutput();
break; break;
} }
} }

@ -1148,12 +1148,15 @@ float perform(bool break_on_operation, int i, uint32_t f, int tracking)
SI4432_Drive(d); SI4432_Drive(d);
if (a > 0) if (a > 0)
a = 0; a = 0;
if( a > - SWITCH_ATTENUATION) { if( a > - SWITCH_ATTENUATION) {
set_switch_transmit(); set_switch_transmit();
} else { } else {
a = a + SWITCH_ATTENUATION; a = a + SWITCH_ATTENUATION;
set_switch_receive(); set_switch_receive();
} }
if (a < -31)
a = -31;
a = -a; a = -a;
PE4302_Write_Byte((int)(a * 2) ); PE4302_Write_Byte((int)(a * 2) );
} }

13
ui.c

@ -129,7 +129,6 @@ static void erase_menu_buttons(void);
static void ui_process_keypad(void); static void ui_process_keypad(void);
static void ui_process_numeric(void); static void ui_process_numeric(void);
static void choose_active_marker(void); static void choose_active_marker(void);
static void menu_move_back(void); static void menu_move_back(void);
static void menu_push_submenu(const menuitem_t *submenu); static void menu_push_submenu(const menuitem_t *submenu);
//static const menuitem_t menu_marker_type[]; //static const menuitem_t menu_marker_type[];
@ -1193,6 +1192,18 @@ menu_push_submenu(const menuitem_t *submenu)
draw_menu(); draw_menu();
} }
void
menu_push_lowoutput(void)
{
menu_push_submenu(menu_lowoutputmode);
}
void
menu_push_highoutput(void)
{
menu_push_submenu(menu_highoutputmode);
}
int current_menu_is_form(void) int current_menu_is_form(void)
{ {
return menu_is_form(menu_stack[menu_current_level]); return menu_is_form(menu_stack[menu_current_level]);

@ -1933,3 +1933,11 @@ set_numeric_value(void)
break; break;
} }
} }
void
menu_move_top(void)
{
while (menu_current_level > 0)
menu_move_back();
}

Loading…
Cancel
Save

Powered by TurnKey Linux.