Merge branch 'master' into tinySA-V4-SI4463

Removed_REF_marker
erikkaashoek 5 years ago
commit faff36713b

@ -343,6 +343,8 @@ extern uint16_t graph_bottom;
#define GRIDY (CHART_BOTTOM / NGRIDY)
#endif
#define BATTERY_START (LCD_HEIGHT-40)
#define WIDTH (LCD_WIDTH - 1 - OFFSETX)
#define HEIGHT (GRIDY*NGRIDY)

@ -2291,14 +2291,14 @@ draw_frequencies(void)
#endif
ili9341_set_foreground(LCD_FG_COLOR);
ili9341_set_background(LCD_BG_COLOR);
ili9341_fill(0, FREQUENCIES_YPOS, LCD_WIDTH, FONT_GET_HEIGHT);
ili9341_fill(FREQUENCIES_XPOS1, FREQUENCIES_YPOS, LCD_WIDTH- FREQUENCIES_XPOS1, FONT_GET_HEIGHT);
if (uistat.lever_mode == LM_CENTER)
buf1[0] = S_SARROW[0];
if (uistat.lever_mode == LM_SPAN)
buf2[0] = S_SARROW[0];
// int p2 = FREQUENCIES_XPOS2;
// if (FREQ_IS_CW()) {
int p2 = LCD_WIDTH - FONT_MAX_WIDTH*strlen(buf2);
int p2 = LCD_WIDTH - FONT_WIDTH*strlen(buf2);
// }
ili9341_drawstring(buf2, p2, FREQUENCIES_YPOS);
ili9341_drawstring(buf1, FREQUENCIES_XPOS1, FREQUENCIES_YPOS);
@ -2367,9 +2367,9 @@ static void draw_battery_status(void)
string_buf[x++] = 0b10000001;
string_buf[x++] = 0b11111111;
// Draw battery
blit8BitWidthBitmap(7, LCD_HEIGHT-50, 8, x, string_buf);
blit8BitWidthBitmap(7, BATTERY_START, 8, x, string_buf);
plot_printf((char*)string_buf, sizeof string_buf, "%.2fv", vbat/1000.0);
ili9341_drawstring((char*)string_buf, 1, LCD_HEIGHT-50+x+3);
ili9341_drawstring((char*)string_buf, 1, BATTERY_START+x+3);
}
void

@ -2357,15 +2357,22 @@ int invoke_quick_menu(int y)
}
#define YSTEP 8
int double_space = false;
enum { ITEM_NO_SPACE = 0, ITEM_NORMAL_SPACE= 1, ITEM_DOUBLE_SPACE = 2 };
int item_space = ITEM_NORMAL_SPACE;
int add_quick_menu(char *buf, int x, int y, menuitem_t *menu)
{
ili9341_drawstring(buf, x, y);
if (double_space)
y += YSTEP + YSTEP;
else
y += YSTEP + YSTEP/2 ;
y += YSTEP;
switch (item_space) {
case ITEM_NORMAL_SPACE:
y += YSTEP/2 ;
break;
case ITEM_DOUBLE_SPACE:
y += YSTEP;
break;
}
if (max_quick_menu<MAX_QUICK_MENU-1) {
quick_menu_y[max_quick_menu] = y;
quick_menu[max_quick_menu++] = menu;
@ -2390,7 +2397,7 @@ redraw_cal_status:
x = 0;
y = OFFSETY;
ili9341_set_background(LCD_BG_COLOR);
ili9341_fill(0, 0, OFFSETX, CHART_BOTTOM);
ili9341_fill(0, 0, OFFSETX, LCD_HEIGHT);
max_quick_menu = 0;
if (MODE_OUTPUT(setting.mode)) { // No cal status during output
return;
@ -2666,19 +2673,20 @@ redraw_cal_status:
strncpy(buf,&VERSION[8], BLEN-1);
ili9341_drawstring(buf, x, y);
if (y*4 > LCD_HEIGHT*3 && double_space) {
double_space = false;
if (y >= BATTERY_START && item_space > ITEM_NO_SPACE) {
item_space--; // Reduce item spacing
goto redraw_cal_status;
}
if (y*3 < LCD_HEIGHT*2 && !double_space) {
double_space = true;
if ((y + (max_quick_menu+1) * YSTEP/2) < BATTERY_START && item_space < ITEM_DOUBLE_SPACE) {
item_space++; // Increase item spacing
goto redraw_cal_status;
}
// ili9341_set_background(LCD_BG_COLOR);
if (!get_waterfall()) { // Do not draw bottom level if in waterfall mode
// Bottom level
y = area_height - 8 + OFFSETY;
y = area_height + OFFSETY;
if (rounding)
plot_printf(buf, BLEN, "%4d", (int)(yMax - setting.scale * NGRIDY));
else

Loading…
Cancel
Save

Powered by TurnKey Linux.