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.
This commit is contained in:
Niccolò Izzo 2020-11-27 16:30:12 +01:00
parent 8b877ed6d0
commit 87ec8389cd
1 changed files with 2 additions and 2 deletions

View File

@ -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);