diff --git a/openrtx/include/datatypes.h b/openrtx/include/datatypes.h index 01a43fc8..a6106cf8 100644 --- a/openrtx/include/datatypes.h +++ b/openrtx/include/datatypes.h @@ -20,6 +20,8 @@ #ifndef DATATYPES_H #define DATATYPES_H +#include + /** * \brief CTCSS and DCS type definition. * @@ -37,6 +39,6 @@ typedef unsigned int tone_t; * * Frequency type unit in Hz, able to hold SHF frequencies. */ -typedef float freq_t; +typedef uint32_t freq_t; #endif /* DATATYPES_H */ diff --git a/openrtx/src/ui.c b/openrtx/src/ui.c index 59c74b16..e17476c6 100644 --- a/openrtx/src/ui.c +++ b/openrtx/src/ui.c @@ -221,10 +221,10 @@ void _ui_drawVFO() { // Print VFO frequencies char freq_buf[20] = ""; - snprintf(freq_buf, sizeof(freq_buf), "Rx: %09.5f", state.rx_freq); + snprintf(freq_buf, sizeof(freq_buf), "Rx: %09.5f", ((float) state.rx_freq)); gfx_print(layout.line2_pos, freq_buf, layout.line1_font, TEXT_ALIGN_CENTER, color_white); - snprintf(freq_buf, sizeof(freq_buf), "Tx: %09.5f", state.tx_freq); + snprintf(freq_buf, sizeof(freq_buf), "Tx: %09.5f", ((float) state.tx_freq)); gfx_print(layout.line3_pos, freq_buf, layout.line2_font, TEXT_ALIGN_CENTER, color_white); }