Disable CTCSS tones in M17 mode

Removed CTCSS modulation for M17 mode, removed FM analog specific
settings in macro menu such as tone selection, tone enable and tx
bandwidth.
replace/59dab1a761353a48b49a583e712910e0230e0ac7
Niccolò Izzo 2021-07-04 16:09:31 +02:00
rodzic dc346497d0
commit 65a632054a
4 zmienionych plików z 80 dodań i 45 usunięć

Wyświetl plik

@ -649,12 +649,17 @@ void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx) {
switch(ui_state.input_number)
{
case 1:
if(state.channel.mode == FM)
{
state.channel.fm.txTone++;
state.channel.fm.txTone %= MAX_TONE_INDEX;
state.channel.fm.rxTone = state.channel.fm.txTone;
*sync_rtx = true;
}
break;
case 2:
if(state.channel.mode == FM)
{
tone_flags++;
tone_flags %= 4;
tone_tx_enable = tone_flags >> 1;
@ -662,6 +667,7 @@ void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx) {
state.channel.fm.txToneEn = tone_tx_enable;
state.channel.fm.rxToneEn = tone_rx_enable;
*sync_rtx = true;
}
break;
case 3:
if (state.channel.power == 1.0f)
@ -671,9 +677,12 @@ void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx) {
*sync_rtx = true;
break;
case 4:
if(state.channel.mode == FM)
{
state.channel.bandwidth++;
state.channel.bandwidth %= 3;
*sync_rtx = true;
}
break;
case 5:
// Cycle through radio modes

Wyświetl plik

@ -550,11 +550,21 @@ bool _ui_drawMacroMenu() {
// First row
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_LEFT,
yellow_fab413, "1");
if (last_state.channel.mode == FM)
{
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_LEFT,
color_white, " %6.1f",
ctcss_tone[last_state.channel.fm.txTone]/10.0f);
}
else if (last_state.channel.mode == M17)
{
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_LEFT,
color_white, " ");
}
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_CENTER,
yellow_fab413, "2 ");
if (last_state.channel.mode == FM)
{
char encdec_str[9] = { 0 };
bool tone_tx_enable = last_state.channel.fm.txToneEn;
bool tone_rx_enable = last_state.channel.fm.rxToneEn;
@ -568,6 +578,13 @@ bool _ui_drawMacroMenu() {
snprintf(encdec_str, 9, " ");
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_CENTER,
color_white, encdec_str);
}
else if (last_state.channel.mode == M17)
{
char encdec_str[9] = " ";
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_CENTER,
color_white, encdec_str);
}
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_RIGHT,
yellow_fab413, "3 ");
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_RIGHT,
@ -578,6 +595,8 @@ bool _ui_drawMacroMenu() {
(layout.line3_pos.y - layout.line1_pos.y)/2};
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_LEFT,
yellow_fab413, "4");
if (last_state.channel.mode == FM)
{
char bw_str[8] = { 0 };
switch (last_state.channel.bandwidth)
{
@ -593,6 +612,13 @@ bool _ui_drawMacroMenu() {
}
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_LEFT,
color_white, bw_str);
}
else if (last_state.channel.mode == M17)
{
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_LEFT,
color_white, " ");
}
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_CENTER,
yellow_fab413, "5 ");
char mode_str[9] = "";

Wyświetl plik

@ -300,7 +300,7 @@ void radio_enableTx()
gpio_setPin(TX_STG_EN); // Enable TX PA
if(config->txToneEn == 1)
if(config->opMode == FM && config->txToneEn == 1)
{
toneGen_toneOn(); // Enable CTSS
}

Wyświetl plik

@ -222,7 +222,7 @@ void radio_enableTx()
gpio_setPin(PA_EN_2);
if(config->txToneEn)
if(config.opMode == FM && config->txToneEn)
{
at1846s.enableTxCtcss(config->txTone);
}