From 87ec8389cd139775b725440560dbfeebf5a1879e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Izzo?= Date: Fri, 27 Nov 2020 16:30:12 +0100 Subject: [PATCH] Fix frequency representation bug Divide the frequency decimals by ten to ensure the we do not overflow the 5 digits we can fit into the available space on the screen. --- openrtx/src/ui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openrtx/src/ui.c b/openrtx/src/ui.c index 25650782..32a061a6 100644 --- a/openrtx/src/ui.c +++ b/openrtx/src/ui.c @@ -223,14 +223,14 @@ void _ui_drawVFO(state_t* state) char freq_buf[20] = ""; snprintf(freq_buf, sizeof(freq_buf), "Rx: %03ld.%05ld", state->channel.rx_frequency/1000000, - state->channel.rx_frequency%1000000); + state->channel.rx_frequency%1000000/10); gfx_print(layout.line2_pos, freq_buf, layout.line1_font, TEXT_ALIGN_CENTER, color_white); snprintf(freq_buf, sizeof(freq_buf), "Tx: %03ld.%05ld", state->channel.tx_frequency/1000000, - state->channel.tx_frequency%1000000); + state->channel.tx_frequency%1000000/10); gfx_print(layout.line3_pos, freq_buf, layout.line2_font, TEXT_ALIGN_CENTER, color_white);