diff --git a/ili9341.c b/ili9341.c index 7b8b736..b5b6833 100644 --- a/ili9341.c +++ b/ili9341.c @@ -336,41 +336,6 @@ ili9341_read_memory_continue(int len, uint16_t* out) -void -ili9341_drawchar_5x7(uint8_t ch, int x, int y, uint16_t fg, uint16_t bg) -{ - uint16_t *buf = spi_buffer; - uint8_t bits; - int c, r; - - ch = x5x7_map_char_table(ch); - - for(c = 0; c < 7; c++) - { - bits = x5x7_bits[(ch * 7) + c]; - for (r = 0; r < 5; r++) - { - *buf++ = (0x80 & bits) ? fg : bg; - bits <<= 1; - } - } - ili9341_bulk(x, y, 5, 7); -} - - - -void -ili9341_drawstring_5x7(const char *str, int x, int y, uint16_t fg, uint16_t bg) -{ - while (*str) { - ili9341_drawchar_5x7(*str, x, y, fg, bg); - x += 5; - str++; - } -} - - - void ili9341_drawchar_size(uint8_t ch, int x, int y, uint16_t fg, uint16_t bg, uint8_t size) { diff --git a/nanovna.h b/nanovna.h index 3390070..beef50d 100644 --- a/nanovna.h +++ b/nanovna.h @@ -287,8 +287,6 @@ void ili9341_init(void); void ili9341_test(int mode); void ili9341_bulk(int x, int y, int w, int h); void ili9341_fill(int x, int y, int w, int h, int color); -void ili9341_drawchar_5x7(uint8_t ch, int x, int y, uint16_t fg, uint16_t bg); -void ili9341_drawstring_5x7(const char *str, int x, int y, uint16_t fg, uint16_t bg); void ili9341_drawchar_size(uint8_t ch, int x, int y, uint16_t fg, uint16_t bg, uint8_t size); void ili9341_drawstring_size(const char *str, int x, int y, uint16_t fg, uint16_t bg, uint8_t size); unsigned char ili9341_drawchar_8x8(uint8_t ch, int x, int y, uint16_t fg, uint16_t bg); diff --git a/plot.c b/plot.c index 4db0643..46a5d73 100644 --- a/plot.c +++ b/plot.c @@ -700,7 +700,7 @@ trace_get_info(int t, char *buf, uint16_t len) break; default: n = chsnprintf(buf, len, "%s ", type); - string_value_with_prefix(buf+n, len-n, get_trace_scale(t), '/'); + n += string_value_with_prefix(buf+n, len-n, get_trace_scale(t), '/'); break; } @@ -1516,7 +1516,7 @@ cell_draw_marker_info(int m, int n, int w, int h) int t; uint16_t slen, strwidthpx = 0; - if (n != 0) + if (n > 1) return; if (active_marker < 0) @@ -1542,8 +1542,8 @@ cell_draw_marker_info(int m, int n, int w, int h) slen = trace_get_info(t, buf, sizeof buf); trace_get_value_string(t, buf+slen, (sizeof(buf))-slen, measured[trace[t].channel][idx], frequencies[idx]); - cell_drawstring_8x8_var(w, h, buf, xpos, ypos, config.trace_color[t], FALSE); + j++; } @@ -1576,10 +1576,13 @@ cell_draw_marker_info(int m, int n, int w, int h) xpos -= m * CELLWIDTH - CELLOFFSETX; ypos += 8; - chsnprintf(buf, sizeof buf, "\001%d:", previous_marker+1); + chsnprintf(buf, sizeof buf, "%s%d:", S_DIAMOND, previous_marker+1); strwidthpx = cell_drawstring_8x8(w, h, buf, xpos, ypos, 0xffff, FALSE); xpos += strwidthpx + 4; + + + frequency_string(buf, sizeof buf, frequencies[idx] - frequencies[idx0]); cell_drawstring_8x8_var(w, h, buf, xpos, ypos, 0xffff, FALSE); } @@ -1603,7 +1606,7 @@ frequency_string(char *buf, size_t len, int32_t freq) (int)(freq / 1000), (int)(freq % 1000)); } else { - chsnprintf(buf, len, "%d.%03d %03d MHz", + chsnprintf(buf, len, "%d.%03d%03d MHz", (int)(freq / 1000000), (int)((freq / 1000) % 1000), (int)(freq % 1000)); diff --git a/ui.c b/ui.c index bbc0d22..6c3fa4c 100644 --- a/ui.c +++ b/ui.c @@ -1262,7 +1262,7 @@ void draw_numeric_area_frame(void) { ili9341_fill(0, 208, 320, 32, 0xffff); - ili9341_drawstring_5x7(keypad_mode_label[keypad_mode], 10, 220, 0x0000, 0xffff); + ili9341_drawstring_8x8_var(keypad_mode_label[keypad_mode], 10, 220, 0x0000, 0xffff); ili9341_drawfont(KP_KEYPAD, &NF20x24, 300, 216, 0x0000, 0xffff); }