diff --git a/nanovna.h b/nanovna.h index a299dd5..82d5efa 100644 --- a/nanovna.h +++ b/nanovna.h @@ -199,8 +199,8 @@ extern int _height; #define CELLWIDTH (32) #define CELLHEIGHT (32) -//#define NGRIDY 10 -#define NGRIDY 9 +#define NGRIDY 10 +//#define NGRIDY 9 #define FREQUENCIES_XPOS1 OFFSETX #define FREQUENCIES_XPOS2 200 diff --git a/plot.c b/plot.c index 56748a3..a6e4bad 100644 --- a/plot.c +++ b/plot.c @@ -1465,10 +1465,10 @@ draw_all_cells(bool flush_markmap) if (waterfall) { for (m = 226; m >= HEIGHT+3; m -= 1) { // Scroll down uint16_t *buf = &spi_buffer[0]; - ili9341_read_memory(5*5, m, area_width, 1, area_width, buf); - ili9341_bulk(5*5,m+1, area_width,1); + ili9341_read_memory(5*5, m, 290, 1, 290, buf); + ili9341_bulk(5*5,m+1, 290,1); } - for (int i=0; i= i) selection = i-1; @@ -1767,7 +1767,7 @@ ui_mode_numeric(int _keypad_mode) static void ui_mode_keypad(int _keypad_mode) { - if (ui_mode == UI_KEYPAD) + if (ui_mode == UI_KEYPAD && keypad_mode == _keypad_mode ) return; // keypads array @@ -2337,6 +2337,7 @@ void ui_process_touch(void) // switch menu mode after release touch_wait_release(); selection = -1; // hide keyboard mode selection + ensure_selection(); ui_mode_menu(); break; case UI_MENU: @@ -2359,6 +2360,7 @@ ui_process(void) int button_state = READ_PORT() & BUTTON_MASK; if (ui_mode == UI_NORMAL && current_menu_is_form()) { // Force into menu mode selection = -1; // hide keyboard mode selection + ensure_selection(); ui_mode_menu(); } if (operation_requested&OP_LEVER || previous_button_state != button_state) { diff --git a/ui_sa.c b/ui_sa.c index 7f0a67e..58875ca 100644 --- a/ui_sa.c +++ b/ui_sa.c @@ -352,6 +352,10 @@ static void menu_measure_cb(int item, uint8_t data) markers[i].mtype = M_DELTA; } markers[0].mtype = M_REFERENCE; + ui_mode_keypad(KM_CENTER); + ui_process_keypad(); + set_sweep_frequency(ST_START, 0); + set_sweep_frequency(ST_STOP, uistat.value*5); break; case 1: for (int i = 0; i< MARKERS_MAX; i++) { @@ -359,6 +363,10 @@ static void menu_measure_cb(int item, uint8_t data) markers[i].mtype = M_DELTA; } markers[0].mtype = M_REFERENCE; + ui_mode_keypad(KM_CENTER); + ui_process_keypad(); + ui_mode_keypad(KM_SPAN); + ui_process_keypad(); break; case 2: break;