Added M17 destination to settings

# callsign in backed-up settings
This commit is contained in:
Morgan Diepart 2023-10-21 21:09:29 -07:00 committed by Silvano Seva
parent 44bfdec947
commit 1124c76b73
6 changed files with 11 additions and 10 deletions

View File

@ -60,6 +60,7 @@ typedef struct
vpPhoneticSpell : 1, // Phonetic spell enabled
_reserved : 4;
bool m17_can_rx; // Check M17 CAN on RX
char m17_dest[10]; // M17 destination
}
__attribute__((packed)) settings_t;
@ -82,7 +83,8 @@ static const settings_t default_settings =
0, // Voice prompts off
0, // Phonetic spell off
0, // not used
false // Check M17 CAN on RX
false, // Check M17 CAN on RX
"" // Empty M17 destination
};
#endif /* SETTINGS_H */

View File

@ -59,7 +59,6 @@ typedef struct
bool gpsDetected;
bool backup_eflash;
bool restore_eflash;
char m17_dest[10];
bool txDisable;
uint8_t step_index;
}

View File

@ -107,7 +107,7 @@ void *ui_threadFunc(void *arg)
rtx_cfg.can = state.settings.m17_can;
rtx_cfg.canRxEn = state.settings.m17_can_rx;
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);

View File

@ -532,9 +532,9 @@ void vp_announceM17Info(const channel_t* channel, bool isEditing,
{
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))
{

View File

@ -1429,7 +1429,7 @@ void ui_updateFSM(bool *sync_rtx)
{
_ui_textInputConfirm(ui_state.new_callsign);
// 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;
*sync_rtx = true;
vp_announceM17Info(NULL, ui_state.edit_mode,
@ -1438,7 +1438,7 @@ void ui_updateFSM(bool *sync_rtx)
else if(msg.keys & KEY_HASH)
{
// Save selected dst ID and disable input mode
strncpy(state.m17_dest, "", 1);
strncpy(state.settings.m17_dest, "", 1);
ui_state.edit_mode = false;
*sync_rtx = true;
vp_announceM17Info(NULL, ui_state.edit_mode,
@ -1614,14 +1614,14 @@ void ui_updateFSM(bool *sync_rtx)
{
_ui_textInputConfirm(ui_state.new_callsign);
// 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;
*sync_rtx = true;
}
else if(msg.keys & KEY_HASH)
{
// Save selected dst ID and disable input mode
strncpy(state.m17_dest, "", 1);
strncpy(state.settings.m17_dest, "", 1);
ui_state.edit_mode = false;
*sync_rtx = true;
}

View File

@ -817,7 +817,7 @@ void ui_updateFSM(bool *sync_rtx)
{
_ui_textInputConfirm(ui_state.new_callsign);
// 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;
ui_state.edit_mode = false;
}