diff --git a/openrtx/include/core/utils.h b/openrtx/include/core/utils.h index a407c2de..98f975c3 100644 --- a/openrtx/include/core/utils.h +++ b/openrtx/include/core/utils.h @@ -22,6 +22,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/openrtx/src/core/utils.c b/openrtx/src/core/utils.c index 647fa004..a7974170 100644 --- a/openrtx/src/core/utils.c +++ b/openrtx/src/core/utils.c @@ -18,6 +18,7 @@ ***************************************************************************/ #include +#include #include uint8_t interpCalParameter(const freq_t freq, const freq_t *calPoints, diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index d65a4157..e2b349f9 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -380,7 +380,9 @@ void vp_announceCTCSS(const bool rxToneEnabled, const uint8_t rxTone, if (flags & vpqIncludeDescriptions) vp_queuePrompt(PROMPT_TONE); - snprintf(buffer, 16, "%3.1f", ctcss_tone[rxTone] / 10.0f); + uint16_t tone = ctcss_tone[rxTone]; + snprintf(buffer, sizeof(buffer), "%d.%d", (tone / 10), (tone % 10)); + vp_queueString(buffer, vpAnnounceCommonSymbols); vp_queuePrompt(PROMPT_HERTZ); playIfNeeded(flags); @@ -396,7 +398,10 @@ void vp_announceCTCSS(const bool rxToneEnabled, const uint8_t rxTone, vp_queuePrompt(PROMPT_RECEIVE); vp_queuePrompt(PROMPT_TONE); } - snprintf(buffer, 16, "%3.1f", ctcss_tone[rxTone] / 10.0f); + + uint16_t tone = ctcss_tone[rxTone]; + snprintf(buffer, sizeof(buffer), "%d.%d", (tone / 10), (tone % 10)); + vp_queueString(buffer, vpAnnounceCommonSymbols); vp_queuePrompt(PROMPT_HERTZ); } @@ -408,7 +413,9 @@ void vp_announceCTCSS(const bool rxToneEnabled, const uint8_t rxTone, vp_queuePrompt(PROMPT_TONE); } - snprintf(buffer, 16, "%3.1f", ctcss_tone[txTone] / 10.0f); + uint16_t tone = ctcss_tone[txTone]; + snprintf(buffer, sizeof(buffer), "%d.%d", (tone / 10), (tone % 10)); + vp_queueString(buffer, vpAnnounceCommonSymbols); vp_queuePrompt(PROMPT_HERTZ); } diff --git a/openrtx/src/ui/default/ui_main.c b/openrtx/src/ui/default/ui_main.c index 5f231992..fdaf4cf4 100644 --- a/openrtx/src/ui/default/ui_main.c +++ b/openrtx/src/ui/default/ui_main.c @@ -25,6 +25,7 @@ #include #include #include +#include void _ui_drawMainBackground() { @@ -102,12 +103,17 @@ void _ui_drawModeInfo(ui_state_t* ui_state) // Print Bandwidth, Tone and encdec info if (tone_tx_enable || tone_rx_enable) - gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER, - color_white, "%s %4.1f %s", bw_str, - ctcss_tone[last_state.channel.fm.txTone]/10.0f, encdec_str); + { + uint16_t tone = ctcss_tone[last_state.channel.fm.txTone]; + gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER, + color_white, "%s %d.%d %s", bw_str, (tone / 10), + (tone % 10), encdec_str); + } else - gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER, - color_white, "%s", bw_str ); + { + gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER, + color_white, "%s", bw_str ); + } break; case OPMODE_DMR: diff --git a/openrtx/src/ui/default/ui_menu.c b/openrtx/src/ui/default/ui_menu.c index 12c2ee16..b4e2870d 100644 --- a/openrtx/src/ui/default/ui_menu.c +++ b/openrtx/src/ui/default/ui_menu.c @@ -1034,9 +1034,10 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state) yellow_fab413, "1"); gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_LEFT, color_white, " T-"); + + uint16_t tone = ctcss_tone[last_state.channel.fm.txTone]; gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_LEFT, - color_white, " %7.1f", - ctcss_tone[last_state.channel.fm.txTone]/10.0f); + color_white, " %d.%d", (tone / 10), (tone % 10)); #if defined(CONFIG_UI_NO_KEYBOARD) if (ui_state->macro_menu_selected == 1) #endif // CONFIG_UI_NO_KEYBOARD