Moved M17 CAN to settings

pull/139/head
Silvano Seva 2023-05-28 09:57:22 +02:00
rodzic feaab4a965
commit 423183700c
5 zmienionych plików z 10 dodań i 11 usunięć

Wyświetl plik

@ -53,13 +53,12 @@ typedef struct
uint8_t voxLevel; // Vox level
int8_t utc_timezone; // Timezone, in units of half hours
bool gps_enabled; // GPS active
char callsign[10]; // Plaintext callsign, for future use
char callsign[10]; // Plaintext callsign
uint8_t display_timer : 4, // Standby timer
_ununsed : 4;
m17_can : 4; // M17 CAN
uint8_t vpLevel : 3, // Voice prompt level
vpPhoneticSpell : 1, // Phonetic spell enabled
_reserved : 4;
}
__attribute__((packed)) settings_t;
@ -78,7 +77,7 @@ static const settings_t default_settings =
false, // GPS enabled
"", // Empty callsign
TIMER_30S, // 30 seconds
0, // not used
0, // M17 CAN
0, // Voice prompts off
0, // Phonetic spell off
0 // not used

Wyświetl plik

@ -98,7 +98,7 @@ void *ui_threadFunc(void *arg)
rtx_cfg.txTone = ctcss_tone[state.channel.fm.txTone];
// Copy new M17 CAN, source and destination addresses
rtx_cfg.can = state.m17_data.can;
rtx_cfg.can = state.settings.m17_can;
strncpy(rtx_cfg.source_address, state.settings.callsign, 10);
strncpy(rtx_cfg.destination_address, state.m17_data.dst_addr, 10);

Wyświetl plik

@ -588,11 +588,11 @@ bool _ui_exitStandby(long long now)
void _ui_changeCAN(int variation)
{
// M17 CAN ranges from 0 to 15
int8_t can = state.m17_data.can + variation;
int8_t can = state.settings.m17_can + variation;
if(can > 15) can = 0;
if(can < 0) can = 15;
state.m17_data.can = can;
state.settings.m17_can = can;
}
void _ui_changeTxWiper(int variation)

Wyświetl plik

@ -110,7 +110,7 @@ void _ui_drawModeInfo(ui_state_t* ui_state)
"--" : cfg.destination_address;
// Print CAN
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_RIGHT,
color_white, "CAN %02d", state.m17_data.can);
color_white, "CAN %02d", state.settings.m17_can);
gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER,
color_white, "LAST");
// Print M17 Destination ID on line 2

Wyświetl plik

@ -191,17 +191,17 @@ int _ui_getM17EntryName(char *buf, uint8_t max_len, uint8_t index)
int _ui_getM17ValueName(char *buf, uint8_t max_len, uint8_t index)
{
if(index >= m17_num) return -1;
uint16_t value = 0;
switch(index)
{
case M_CALLSIGN:
snprintf(buf, max_len, "%s", last_state.settings.callsign);
return 0;
case M_CAN:
value = last_state.m17_data.can;
snprintf(buf, max_len, "%d", last_state.settings.m17_can);
break;
}
snprintf(buf, max_len, "%d", value);
return 0;
}