Small bug fixes

tinySA
erikkaashoek 6 years ago
parent 0575aed87b
commit bd50a9d3e5

@ -199,8 +199,8 @@ extern int _height;
#define CELLWIDTH (32) #define CELLWIDTH (32)
#define CELLHEIGHT (32) #define CELLHEIGHT (32)
//#define NGRIDY 10 #define NGRIDY 10
#define NGRIDY 9 //#define NGRIDY 9
#define FREQUENCIES_XPOS1 OFFSETX #define FREQUENCIES_XPOS1 OFFSETX
#define FREQUENCIES_XPOS2 200 #define FREQUENCIES_XPOS2 200

@ -1465,10 +1465,10 @@ draw_all_cells(bool flush_markmap)
if (waterfall) { if (waterfall) {
for (m = 226; m >= HEIGHT+3; m -= 1) { // Scroll down for (m = 226; m >= HEIGHT+3; m -= 1) { // Scroll down
uint16_t *buf = &spi_buffer[0]; uint16_t *buf = &spi_buffer[0];
ili9341_read_memory(5*5, m, area_width, 1, area_width, buf); ili9341_read_memory(5*5, m, 290, 1, 290, buf);
ili9341_bulk(5*5,m+1, area_width,1); ili9341_bulk(5*5,m+1, 290,1);
} }
for (int i=0; i<area_width; i++) { // Add new topline for (int i=0; i<290; i++) { // Add new topline
#if 0 #if 0
int k = (actual_t[i]+120 + 10)* 3 / 2; int k = (actual_t[i]+120 + 10)* 3 / 2;
unsigned int r=0,g=0,b=0; unsigned int r=0,g=0,b=0;
@ -1503,7 +1503,7 @@ draw_all_cells(bool flush_markmap)
#endif #endif
spi_buffer[i] = RGB565(r,g,b); spi_buffer[i] = RGB565(r,g,b);
} }
ili9341_bulk(5*5,HEIGHT+3, area_width,1); ili9341_bulk(5*5,HEIGHT+3, 290,1);
} }
#endif #endif
} }

@ -1091,7 +1091,7 @@ ensure_selection(void)
{ {
const menuitem_t *menu = menu_stack[menu_current_level]; const menuitem_t *menu = menu_stack[menu_current_level];
int i; int i;
for (i = 0; MT_MASK(menu[i].type) != MT_NONE; i++) for (i = 0; MT_MASK(menu[i].type) != MT_NONE && MT_MASK(menu[i].type) != MT_TITLE ; i++)
; ;
if (selection >= i) if (selection >= i)
selection = i-1; selection = i-1;
@ -1767,7 +1767,7 @@ ui_mode_numeric(int _keypad_mode)
static void static void
ui_mode_keypad(int _keypad_mode) ui_mode_keypad(int _keypad_mode)
{ {
if (ui_mode == UI_KEYPAD) if (ui_mode == UI_KEYPAD && keypad_mode == _keypad_mode )
return; return;
// keypads array // keypads array
@ -2337,6 +2337,7 @@ void ui_process_touch(void)
// switch menu mode after release // switch menu mode after release
touch_wait_release(); touch_wait_release();
selection = -1; // hide keyboard mode selection selection = -1; // hide keyboard mode selection
ensure_selection();
ui_mode_menu(); ui_mode_menu();
break; break;
case UI_MENU: case UI_MENU:
@ -2359,6 +2360,7 @@ ui_process(void)
int button_state = READ_PORT() & BUTTON_MASK; int button_state = READ_PORT() & BUTTON_MASK;
if (ui_mode == UI_NORMAL && current_menu_is_form()) { // Force into menu mode if (ui_mode == UI_NORMAL && current_menu_is_form()) { // Force into menu mode
selection = -1; // hide keyboard mode selection selection = -1; // hide keyboard mode selection
ensure_selection();
ui_mode_menu(); ui_mode_menu();
} }
if (operation_requested&OP_LEVER || previous_button_state != button_state) { if (operation_requested&OP_LEVER || previous_button_state != button_state) {

@ -352,6 +352,10 @@ static void menu_measure_cb(int item, uint8_t data)
markers[i].mtype = M_DELTA; markers[i].mtype = M_DELTA;
} }
markers[0].mtype = M_REFERENCE; 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; break;
case 1: case 1:
for (int i = 0; i< MARKERS_MAX; i++) { 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[i].mtype = M_DELTA;
} }
markers[0].mtype = M_REFERENCE; markers[0].mtype = M_REFERENCE;
ui_mode_keypad(KM_CENTER);
ui_process_keypad();
ui_mode_keypad(KM_SPAN);
ui_process_keypad();
break; break;
case 2: case 2:
break; break;

Loading…
Cancel
Save

Powered by TurnKey Linux.