kopia lustrzana https://github.com/OpenRTX/OpenRTX
Removed use of floating points when printing/announcing CTCSS tone frequency
rodzic
5b3929ef44
commit
cb7b605251
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include <datatypes.h>
|
#include <datatypes.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <utils.h>
|
#include <utils.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
uint8_t interpCalParameter(const freq_t freq, const freq_t *calPoints,
|
uint8_t interpCalParameter(const freq_t freq, const freq_t *calPoints,
|
||||||
|
|
|
@ -380,7 +380,9 @@ void vp_announceCTCSS(const bool rxToneEnabled, const uint8_t rxTone,
|
||||||
if (flags & vpqIncludeDescriptions)
|
if (flags & vpqIncludeDescriptions)
|
||||||
vp_queuePrompt(PROMPT_TONE);
|
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_queueString(buffer, vpAnnounceCommonSymbols);
|
||||||
vp_queuePrompt(PROMPT_HERTZ);
|
vp_queuePrompt(PROMPT_HERTZ);
|
||||||
playIfNeeded(flags);
|
playIfNeeded(flags);
|
||||||
|
@ -396,7 +398,10 @@ void vp_announceCTCSS(const bool rxToneEnabled, const uint8_t rxTone,
|
||||||
vp_queuePrompt(PROMPT_RECEIVE);
|
vp_queuePrompt(PROMPT_RECEIVE);
|
||||||
vp_queuePrompt(PROMPT_TONE);
|
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_queueString(buffer, vpAnnounceCommonSymbols);
|
||||||
vp_queuePrompt(PROMPT_HERTZ);
|
vp_queuePrompt(PROMPT_HERTZ);
|
||||||
}
|
}
|
||||||
|
@ -408,7 +413,9 @@ void vp_announceCTCSS(const bool rxToneEnabled, const uint8_t rxTone,
|
||||||
vp_queuePrompt(PROMPT_TONE);
|
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_queueString(buffer, vpAnnounceCommonSymbols);
|
||||||
vp_queuePrompt(PROMPT_HERTZ);
|
vp_queuePrompt(PROMPT_HERTZ);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <ui/ui_default.h>
|
#include <ui/ui_default.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ui/ui_strings.h>
|
#include <ui/ui_strings.h>
|
||||||
|
#include <utils.h>
|
||||||
|
|
||||||
void _ui_drawMainBackground()
|
void _ui_drawMainBackground()
|
||||||
{
|
{
|
||||||
|
@ -102,12 +103,17 @@ void _ui_drawModeInfo(ui_state_t* ui_state)
|
||||||
|
|
||||||
// Print Bandwidth, Tone and encdec info
|
// Print Bandwidth, Tone and encdec info
|
||||||
if (tone_tx_enable || tone_rx_enable)
|
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,
|
uint16_t tone = ctcss_tone[last_state.channel.fm.txTone];
|
||||||
ctcss_tone[last_state.channel.fm.txTone]/10.0f, encdec_str);
|
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
|
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;
|
break;
|
||||||
|
|
||||||
case OPMODE_DMR:
|
case OPMODE_DMR:
|
||||||
|
|
|
@ -1034,9 +1034,10 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
|
||||||
yellow_fab413, "1");
|
yellow_fab413, "1");
|
||||||
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_LEFT,
|
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_LEFT,
|
||||||
color_white, " T-");
|
color_white, " T-");
|
||||||
|
|
||||||
|
uint16_t tone = ctcss_tone[last_state.channel.fm.txTone];
|
||||||
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_LEFT,
|
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_LEFT,
|
||||||
color_white, " %7.1f",
|
color_white, " %d.%d", (tone / 10), (tone % 10));
|
||||||
ctcss_tone[last_state.channel.fm.txTone]/10.0f);
|
|
||||||
#if defined(CONFIG_UI_NO_KEYBOARD)
|
#if defined(CONFIG_UI_NO_KEYBOARD)
|
||||||
if (ui_state->macro_menu_selected == 1)
|
if (ui_state->macro_menu_selected == 1)
|
||||||
#endif // CONFIG_UI_NO_KEYBOARD
|
#endif // CONFIG_UI_NO_KEYBOARD
|
||||||
|
|
Ładowanie…
Reference in New Issue