-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENABLE_VOLTAGE_PERCENTAGE_WELCOME_MESSAGE
- Loading branch information
Showing
4 changed files
with
152 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#include "app/chFrScanner.h" | ||
#include "audio.h" | ||
#include "functions.h" | ||
#include "misc.h" | ||
#include "settings.h" | ||
#include "ui/ui.h" | ||
|
||
void COMMON_KeypadLockToggle() | ||
{ | ||
|
||
if (gScreenToDisplay != DISPLAY_MENU && | ||
gCurrentFunction != FUNCTION_TRANSMIT) | ||
{ // toggle the keyboad lock | ||
|
||
#ifdef ENABLE_VOICE | ||
gAnotherVoiceID = gEeprom.KEY_LOCK ? VOICE_ID_UNLOCK : VOICE_ID_LOCK; | ||
#endif | ||
|
||
gEeprom.KEY_LOCK = !gEeprom.KEY_LOCK; | ||
|
||
gRequestSaveSettings = true; | ||
} | ||
} | ||
|
||
void COMMON_SwitchVFOs() | ||
{ | ||
#ifdef ENABLE_SCAN_RANGES | ||
gScanRangeStart = 0; | ||
#endif | ||
gEeprom.TX_CHANNEL ^= 1; | ||
|
||
if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) | ||
gEeprom.CROSS_BAND_RX_TX = gEeprom.TX_CHANNEL + 1; | ||
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) | ||
gEeprom.DUAL_WATCH = gEeprom.TX_CHANNEL + 1; | ||
|
||
gRequestSaveSettings = 1; | ||
gFlagReconfigureVfos = true; | ||
gScheduleDualWatch = true; | ||
|
||
gRequestDisplayScreen = DISPLAY_MAIN; | ||
} | ||
|
||
void COMMON_SwitchToVFOMode() | ||
{ | ||
gEeprom.ScreenChannel[gEeprom.TX_CHANNEL] = gEeprom.FreqChannel[gEeprom.TX_CHANNEL]; | ||
#ifdef ENABLE_VOICE | ||
gAnotherVoiceID = VOICE_ID_FREQUENCY_MODE; | ||
#endif | ||
gRequestSaveVFO = true; | ||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD; | ||
return; | ||
} | ||
void COMMON_SwitchToChannelMode() | ||
{ | ||
uint8_t Channel = RADIO_FindNextChannel(gEeprom.MrChannel[gEeprom.TX_CHANNEL], 1, false, 0); | ||
if (Channel != 0xFF) | ||
{ // swap to channel mode | ||
gEeprom.ScreenChannel[gEeprom.TX_CHANNEL] = Channel; | ||
#ifdef ENABLE_VOICE | ||
AUDIO_SetVoiceID(0, VOICE_ID_CHANNEL_MODE); | ||
AUDIO_SetDigitVoice(1, Channel + 1); | ||
gAnotherVoiceID = (VOICE_ID_t)0xFE; | ||
#endif | ||
gRequestSaveVFO = true; | ||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD; | ||
return; | ||
} | ||
} | ||
|
||
void COMMON_SwitchVFOMode() | ||
{ | ||
#ifdef ENABLE_NOAA | ||
if (gEeprom.VFO_OPEN && !IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE)) | ||
#else | ||
if (gEeprom.VFO_OPEN) | ||
#endif | ||
{ | ||
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) | ||
{ // swap to frequency mode | ||
COMMON_SwitchToVFOMode(); | ||
} | ||
else | ||
{ | ||
//swap to channel mode | ||
COMMON_SwitchToChannelMode(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
#ifndef APP_COMMON_H | ||
#define APP_COMMON_H | ||
|
||
#include "functions.h" | ||
#include "settings.h" | ||
#include "ui/ui.h" | ||
|
||
void COMMON_KeypadLockToggle(); | ||
void COMMON_SwitchVFOs(); | ||
void COMMON_SwitchVFOMode(); | ||
void COMMON_SwitchToVFOMode(); | ||
void COMMON_SwitchToChannelMode(); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters