Added M17 destination to settings
# callsign in backed-up settings
This commit is contained in:
parent
44bfdec947
commit
1124c76b73
|
|
@ -60,6 +60,7 @@ typedef struct
|
||||||
vpPhoneticSpell : 1, // Phonetic spell enabled
|
vpPhoneticSpell : 1, // Phonetic spell enabled
|
||||||
_reserved : 4;
|
_reserved : 4;
|
||||||
bool m17_can_rx; // Check M17 CAN on RX
|
bool m17_can_rx; // Check M17 CAN on RX
|
||||||
|
char m17_dest[10]; // M17 destination
|
||||||
}
|
}
|
||||||
__attribute__((packed)) settings_t;
|
__attribute__((packed)) settings_t;
|
||||||
|
|
||||||
|
|
@ -82,7 +83,8 @@ static const settings_t default_settings =
|
||||||
0, // Voice prompts off
|
0, // Voice prompts off
|
||||||
0, // Phonetic spell off
|
0, // Phonetic spell off
|
||||||
0, // not used
|
0, // not used
|
||||||
false // Check M17 CAN on RX
|
false, // Check M17 CAN on RX
|
||||||
|
"" // Empty M17 destination
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SETTINGS_H */
|
#endif /* SETTINGS_H */
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@ typedef struct
|
||||||
bool gpsDetected;
|
bool gpsDetected;
|
||||||
bool backup_eflash;
|
bool backup_eflash;
|
||||||
bool restore_eflash;
|
bool restore_eflash;
|
||||||
char m17_dest[10];
|
|
||||||
bool txDisable;
|
bool txDisable;
|
||||||
uint8_t step_index;
|
uint8_t step_index;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ void *ui_threadFunc(void *arg)
|
||||||
rtx_cfg.can = state.settings.m17_can;
|
rtx_cfg.can = state.settings.m17_can;
|
||||||
rtx_cfg.canRxEn = state.settings.m17_can_rx;
|
rtx_cfg.canRxEn = state.settings.m17_can_rx;
|
||||||
strncpy(rtx_cfg.source_address, state.settings.callsign, 10);
|
strncpy(rtx_cfg.source_address, state.settings.callsign, 10);
|
||||||
strncpy(rtx_cfg.destination_address, state.m17_dest, 10);
|
strncpy(rtx_cfg.destination_address, state.settings.m17_dest, 10);
|
||||||
|
|
||||||
pthread_mutex_unlock(&rtx_mutex);
|
pthread_mutex_unlock(&rtx_mutex);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -532,9 +532,9 @@ void vp_announceM17Info(const channel_t* channel, bool isEditing,
|
||||||
{
|
{
|
||||||
vp_queuePrompt(PROMPT_EDIT);
|
vp_queuePrompt(PROMPT_EDIT);
|
||||||
}
|
}
|
||||||
else if (state.m17_dest[0] != '\0')
|
else if (state.settings.m17_dest[0] != '\0')
|
||||||
{
|
{
|
||||||
vp_queueString(state.m17_dest, vpAnnounceCommonSymbols);
|
vp_queueString(state.settings.m17_dest, vpAnnounceCommonSymbols);
|
||||||
}
|
}
|
||||||
else if ((channel != NULL) && (channel->m17.contact_index != 0))
|
else if ((channel != NULL) && (channel->m17.contact_index != 0))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1429,7 +1429,7 @@ void ui_updateFSM(bool *sync_rtx)
|
||||||
{
|
{
|
||||||
_ui_textInputConfirm(ui_state.new_callsign);
|
_ui_textInputConfirm(ui_state.new_callsign);
|
||||||
// Save selected dst ID and disable input mode
|
// Save selected dst ID and disable input mode
|
||||||
strncpy(state.m17_dest, ui_state.new_callsign, 10);
|
strncpy(state.settings.m17_dest, ui_state.new_callsign, 10);
|
||||||
ui_state.edit_mode = false;
|
ui_state.edit_mode = false;
|
||||||
*sync_rtx = true;
|
*sync_rtx = true;
|
||||||
vp_announceM17Info(NULL, ui_state.edit_mode,
|
vp_announceM17Info(NULL, ui_state.edit_mode,
|
||||||
|
|
@ -1438,7 +1438,7 @@ void ui_updateFSM(bool *sync_rtx)
|
||||||
else if(msg.keys & KEY_HASH)
|
else if(msg.keys & KEY_HASH)
|
||||||
{
|
{
|
||||||
// Save selected dst ID and disable input mode
|
// Save selected dst ID and disable input mode
|
||||||
strncpy(state.m17_dest, "", 1);
|
strncpy(state.settings.m17_dest, "", 1);
|
||||||
ui_state.edit_mode = false;
|
ui_state.edit_mode = false;
|
||||||
*sync_rtx = true;
|
*sync_rtx = true;
|
||||||
vp_announceM17Info(NULL, ui_state.edit_mode,
|
vp_announceM17Info(NULL, ui_state.edit_mode,
|
||||||
|
|
@ -1614,14 +1614,14 @@ void ui_updateFSM(bool *sync_rtx)
|
||||||
{
|
{
|
||||||
_ui_textInputConfirm(ui_state.new_callsign);
|
_ui_textInputConfirm(ui_state.new_callsign);
|
||||||
// Save selected dst ID and disable input mode
|
// Save selected dst ID and disable input mode
|
||||||
strncpy(state.m17_dest, ui_state.new_callsign, 10);
|
strncpy(state.settings.m17_dest, ui_state.new_callsign, 10);
|
||||||
ui_state.edit_mode = false;
|
ui_state.edit_mode = false;
|
||||||
*sync_rtx = true;
|
*sync_rtx = true;
|
||||||
}
|
}
|
||||||
else if(msg.keys & KEY_HASH)
|
else if(msg.keys & KEY_HASH)
|
||||||
{
|
{
|
||||||
// Save selected dst ID and disable input mode
|
// Save selected dst ID and disable input mode
|
||||||
strncpy(state.m17_dest, "", 1);
|
strncpy(state.settings.m17_dest, "", 1);
|
||||||
ui_state.edit_mode = false;
|
ui_state.edit_mode = false;
|
||||||
*sync_rtx = true;
|
*sync_rtx = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -817,7 +817,7 @@ void ui_updateFSM(bool *sync_rtx)
|
||||||
{
|
{
|
||||||
_ui_textInputConfirm(ui_state.new_callsign);
|
_ui_textInputConfirm(ui_state.new_callsign);
|
||||||
// Save selected callsign and disable input mode
|
// Save selected callsign and disable input mode
|
||||||
strncpy(state.m17_dest, ui_state.new_callsign, 10);
|
strncpy(state.settings.m17_dest, ui_state.new_callsign, 10);
|
||||||
*sync_rtx = true;
|
*sync_rtx = true;
|
||||||
ui_state.edit_mode = false;
|
ui_state.edit_mode = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue