Comments, refactor
This commit is contained in:
158
app/app.c
158
app/app.c
@@ -62,9 +62,10 @@
|
|||||||
#include "ui/status.h"
|
#include "ui/status.h"
|
||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
|
|
||||||
static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
|
static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
|
||||||
|
static void FlashlightTimeSlice();
|
||||||
|
|
||||||
static void updateRSSI(const int vfo)
|
static void UpdateRSSI(const int vfo)
|
||||||
{
|
{
|
||||||
int16_t rssi = BK4819_GetRSSI();
|
int16_t rssi = BK4819_GetRSSI();
|
||||||
|
|
||||||
@@ -82,7 +83,7 @@ static void updateRSSI(const int vfo)
|
|||||||
UI_UpdateRSSI(rssi, vfo);
|
UI_UpdateRSSI(rssi, vfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void APP_CheckForIncoming(void)
|
static void CheckForIncoming(void)
|
||||||
{
|
{
|
||||||
if (!g_SquelchLost)
|
if (!g_SquelchLost)
|
||||||
return; // squelch is closed
|
return; // squelch is closed
|
||||||
@@ -116,7 +117,7 @@ static void APP_CheckForIncoming(void)
|
|||||||
FUNCTION_Select(FUNCTION_INCOMING);
|
FUNCTION_Select(FUNCTION_INCOMING);
|
||||||
//gUpdateDisplay = true;
|
//gUpdateDisplay = true;
|
||||||
|
|
||||||
updateRSSI(gEeprom.RX_VFO);
|
UpdateRSSI(gEeprom.RX_VFO);
|
||||||
gUpdateRSSI = true;
|
gUpdateRSSI = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +133,7 @@ static void APP_CheckForIncoming(void)
|
|||||||
FUNCTION_Select(FUNCTION_INCOMING);
|
FUNCTION_Select(FUNCTION_INCOMING);
|
||||||
//gUpdateDisplay = true;
|
//gUpdateDisplay = true;
|
||||||
|
|
||||||
updateRSSI(gEeprom.RX_VFO);
|
UpdateRSSI(gEeprom.RX_VFO);
|
||||||
gUpdateRSSI = true;
|
gUpdateRSSI = true;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -154,7 +155,7 @@ static void APP_CheckForIncoming(void)
|
|||||||
FUNCTION_Select(FUNCTION_INCOMING);
|
FUNCTION_Select(FUNCTION_INCOMING);
|
||||||
//gUpdateDisplay = true;
|
//gUpdateDisplay = true;
|
||||||
|
|
||||||
updateRSSI(gEeprom.RX_VFO);
|
UpdateRSSI(gEeprom.RX_VFO);
|
||||||
gUpdateRSSI = true;
|
gUpdateRSSI = true;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -171,12 +172,12 @@ static void APP_CheckForIncoming(void)
|
|||||||
FUNCTION_Select(FUNCTION_INCOMING);
|
FUNCTION_Select(FUNCTION_INCOMING);
|
||||||
//gUpdateDisplay = true;
|
//gUpdateDisplay = true;
|
||||||
|
|
||||||
updateRSSI(gEeprom.RX_VFO);
|
UpdateRSSI(gEeprom.RX_VFO);
|
||||||
gUpdateRSSI = true;
|
gUpdateRSSI = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void APP_HandleIncoming(void)
|
static void HandleIncoming(void)
|
||||||
{
|
{
|
||||||
bool bFlag;
|
bool bFlag;
|
||||||
|
|
||||||
@@ -248,7 +249,7 @@ static void APP_HandleIncoming(void)
|
|||||||
APP_StartListening(gMonitor ? FUNCTION_MONITOR : FUNCTION_RECEIVE, false);
|
APP_StartListening(gMonitor ? FUNCTION_MONITOR : FUNCTION_RECEIVE, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void APP_HandleReceive(void)
|
static void HandleReceive(void)
|
||||||
{
|
{
|
||||||
#define END_OF_RX_MODE_SKIP 0
|
#define END_OF_RX_MODE_SKIP 0
|
||||||
#define END_OF_RX_MODE_END 1
|
#define END_OF_RX_MODE_END 1
|
||||||
@@ -263,7 +264,7 @@ static void APP_HandleReceive(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gScanStateDir != SCAN_OFF && IS_FREQ_CHANNEL(gNextMrChannel))
|
if (gScanStateDir != SCAN_OFF && IS_FREQ_CHANNEL(gNextMrChannel))
|
||||||
{
|
{ // we are scanning in the frequency mode
|
||||||
if (g_SquelchLost)
|
if (g_SquelchLost)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -370,7 +371,7 @@ static void APP_HandleReceive(void)
|
|||||||
if (!gEndOfRxDetectedMaybe &&
|
if (!gEndOfRxDetectedMaybe &&
|
||||||
Mode == END_OF_RX_MODE_SKIP &&
|
Mode == END_OF_RX_MODE_SKIP &&
|
||||||
gNextTimeslice40ms &&
|
gNextTimeslice40ms &&
|
||||||
gEeprom.TAIL_NOTE_ELIMINATION &&
|
gEeprom.TAIL_TONE_ELIMINATION &&
|
||||||
(gCurrentCodeType == CODE_TYPE_DIGITAL || gCurrentCodeType == CODE_TYPE_REVERSE_DIGITAL) &&
|
(gCurrentCodeType == CODE_TYPE_DIGITAL || gCurrentCodeType == CODE_TYPE_REVERSE_DIGITAL) &&
|
||||||
BK4819_GetCTCType() == 1)
|
BK4819_GetCTCType() == 1)
|
||||||
Mode = END_OF_RX_MODE_TTE;
|
Mode = END_OF_RX_MODE_TTE;
|
||||||
@@ -414,7 +415,7 @@ Skip:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case END_OF_RX_MODE_TTE:
|
case END_OF_RX_MODE_TTE:
|
||||||
if (gEeprom.TAIL_NOTE_ELIMINATION)
|
if (gEeprom.TAIL_TONE_ELIMINATION)
|
||||||
{
|
{
|
||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
||||||
|
|
||||||
@@ -427,12 +428,12 @@ Skip:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void APP_HandleFunction(void)
|
static void HandleFunction(void)
|
||||||
{
|
{
|
||||||
switch (gCurrentFunction)
|
switch (gCurrentFunction)
|
||||||
{
|
{
|
||||||
case FUNCTION_FOREGROUND:
|
case FUNCTION_FOREGROUND:
|
||||||
APP_CheckForIncoming();
|
CheckForIncoming();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FUNCTION_TRANSMIT:
|
case FUNCTION_TRANSMIT:
|
||||||
@@ -442,16 +443,16 @@ static void APP_HandleFunction(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case FUNCTION_INCOMING:
|
case FUNCTION_INCOMING:
|
||||||
APP_HandleIncoming();
|
HandleIncoming();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FUNCTION_RECEIVE:
|
case FUNCTION_RECEIVE:
|
||||||
APP_HandleReceive();
|
HandleReceive();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FUNCTION_POWER_SAVE:
|
case FUNCTION_POWER_SAVE:
|
||||||
if (!gRxIdleMode)
|
if (!gRxIdleMode)
|
||||||
APP_CheckForIncoming();
|
CheckForIncoming();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FUNCTION_BAND_SCOPE:
|
case FUNCTION_BAND_SCOPE:
|
||||||
@@ -592,7 +593,7 @@ uint32_t APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t direction)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void DUALWATCH_Alternate(void)
|
static void DualwatchAlternate(void)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
if (gIsNoaaMode)
|
if (gIsNoaaMode)
|
||||||
@@ -610,7 +611,7 @@ static void DUALWATCH_Alternate(void)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{ // toggle between VFO's
|
{ // toggle between VFO's
|
||||||
gEeprom.RX_VFO = (gEeprom.RX_VFO + 1) & 1;
|
gEeprom.RX_VFO = !gEeprom.RX_VFO;
|
||||||
gRxVfo = &gEeprom.VfoInfo[gEeprom.RX_VFO];
|
gRxVfo = &gEeprom.VfoInfo[gEeprom.RX_VFO];
|
||||||
|
|
||||||
if (!gDualWatchActive)
|
if (!gDualWatchActive)
|
||||||
@@ -629,7 +630,7 @@ static void DUALWATCH_Alternate(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void APP_CheckRadioInterrupts(void)
|
static void CheckRadioInterrupts(void)
|
||||||
{
|
{
|
||||||
if (gScreenToDisplay == DISPLAY_SCANNER)
|
if (gScreenToDisplay == DISPLAY_SCANNER)
|
||||||
return;
|
return;
|
||||||
@@ -779,7 +780,7 @@ void APP_EndTransmission(void)
|
|||||||
{ // CTCSS/DCS is enabled
|
{ // CTCSS/DCS is enabled
|
||||||
|
|
||||||
//if (gEeprom.TAIL_NOTE_ELIMINATION && gEeprom.REPEATER_TAIL_TONE_ELIMINATION > 0)
|
//if (gEeprom.TAIL_NOTE_ELIMINATION && gEeprom.REPEATER_TAIL_TONE_ELIMINATION > 0)
|
||||||
if (gEeprom.TAIL_NOTE_ELIMINATION)
|
if (gEeprom.TAIL_TONE_ELIMINATION)
|
||||||
{ // send the CTCSS/DCS tail tone - allows the receivers to mute the usual FM squelch tail/crash
|
{ // send the CTCSS/DCS tail tone - allows the receivers to mute the usual FM squelch tail/crash
|
||||||
RADIO_EnableCxCSS();
|
RADIO_EnableCxCSS();
|
||||||
}
|
}
|
||||||
@@ -797,7 +798,7 @@ void APP_EndTransmission(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_VOX
|
#ifdef ENABLE_VOX
|
||||||
static void APP_HandleVox(void)
|
static void HandleVox(void)
|
||||||
{
|
{
|
||||||
if (gSetting_KILLED)
|
if (gSetting_KILLED)
|
||||||
return;
|
return;
|
||||||
@@ -879,8 +880,7 @@ void APP_EndTransmission(void)
|
|||||||
void APP_Update(void)
|
void APP_Update(void)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
if (gFlagPlayQueuedVoice)
|
if (gFlagPlayQueuedVoice) {
|
||||||
{
|
|
||||||
AUDIO_PlayQueuedVoice();
|
AUDIO_PlayQueuedVoice();
|
||||||
gFlagPlayQueuedVoice = false;
|
gFlagPlayQueuedVoice = false;
|
||||||
}
|
}
|
||||||
@@ -904,7 +904,7 @@ void APP_Update(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (gCurrentFunction != FUNCTION_TRANSMIT)
|
if (gCurrentFunction != FUNCTION_TRANSMIT)
|
||||||
APP_HandleFunction();
|
HandleFunction();
|
||||||
|
|
||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
// if (gFmRadioCountdown_500ms > 0)
|
// if (gFmRadioCountdown_500ms > 0)
|
||||||
@@ -965,7 +965,7 @@ void APP_Update(void)
|
|||||||
gDTMF_CallState == DTMF_CALL_STATE_NONE &&
|
gDTMF_CallState == DTMF_CALL_STATE_NONE &&
|
||||||
gCurrentFunction != FUNCTION_POWER_SAVE)
|
gCurrentFunction != FUNCTION_POWER_SAVE)
|
||||||
{
|
{
|
||||||
DUALWATCH_Alternate(); // toggle between the two VFO's
|
DualwatchAlternate(); // toggle between the two VFO's
|
||||||
|
|
||||||
if (gRxVfoIsActive && gScreenToDisplay == DISPLAY_MAIN)
|
if (gRxVfoIsActive && gScreenToDisplay == DISPLAY_MAIN)
|
||||||
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||||
@@ -993,7 +993,7 @@ void APP_Update(void)
|
|||||||
|
|
||||||
#ifdef ENABLE_VOX
|
#ifdef ENABLE_VOX
|
||||||
if (gEeprom.VOX_SWITCH)
|
if (gEeprom.VOX_SWITCH)
|
||||||
APP_HandleVox();
|
HandleVox();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (gSchedulePowerSave)
|
if (gSchedulePowerSave)
|
||||||
@@ -1067,7 +1067,7 @@ void APP_Update(void)
|
|||||||
gScanStateDir == SCAN_OFF &&
|
gScanStateDir == SCAN_OFF &&
|
||||||
gCssScanMode == CSS_SCAN_MODE_OFF)
|
gCssScanMode == CSS_SCAN_MODE_OFF)
|
||||||
{ // dual watch mode, toggle between the two VFO's
|
{ // dual watch mode, toggle between the two VFO's
|
||||||
DUALWATCH_Alternate();
|
DualwatchAlternate();
|
||||||
|
|
||||||
gUpdateRSSI = false;
|
gUpdateRSSI = false;
|
||||||
}
|
}
|
||||||
@@ -1079,9 +1079,9 @@ void APP_Update(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF || gScanStateDir != SCAN_OFF || gCssScanMode != CSS_SCAN_MODE_OFF || gUpdateRSSI)
|
if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF || gScanStateDir != SCAN_OFF || gCssScanMode != CSS_SCAN_MODE_OFF || gUpdateRSSI)
|
||||||
{ // dual watch mode, go back to sleep
|
{ // dual watch mode off or scanning or rssi update request
|
||||||
|
|
||||||
updateRSSI(gEeprom.RX_VFO);
|
UpdateRSSI(gEeprom.RX_VFO);
|
||||||
|
|
||||||
// go back to sleep
|
// go back to sleep
|
||||||
|
|
||||||
@@ -1098,7 +1098,7 @@ void APP_Update(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// toggle between the two VFO's
|
// toggle between the two VFO's
|
||||||
DUALWATCH_Alternate();
|
DualwatchAlternate();
|
||||||
|
|
||||||
gUpdateRSSI = true;
|
gUpdateRSSI = true;
|
||||||
gPowerSave_10ms = power_save1_10ms;
|
gPowerSave_10ms = power_save1_10ms;
|
||||||
@@ -1109,7 +1109,7 @@ void APP_Update(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// called every 10ms
|
// called every 10ms
|
||||||
void APP_CheckKeys(void)
|
static void CheckKeys(void)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_AIRCOPY
|
#ifdef ENABLE_AIRCOPY
|
||||||
if (gSetting_KILLED || (gScreenToDisplay == DISPLAY_AIRCOPY && gAircopyState != AIRCOPY_READY))
|
if (gSetting_KILLED || (gScreenToDisplay == DISPLAY_AIRCOPY && gAircopyState != AIRCOPY_READY))
|
||||||
@@ -1126,7 +1126,7 @@ void APP_CheckKeys(void)
|
|||||||
{ // PTT released or serial comms config in progress
|
{ // PTT released or serial comms config in progress
|
||||||
if (++gPttDebounceCounter >= 3 || gSerialConfigCountDown_500ms > 0) // 30ms
|
if (++gPttDebounceCounter >= 3 || gSerialConfigCountDown_500ms > 0) // 30ms
|
||||||
{ // stop transmitting
|
{ // stop transmitting
|
||||||
APP_ProcessKey(KEY_PTT, false, false);
|
ProcessKey(KEY_PTT, false, false);
|
||||||
gPttIsPressed = false;
|
gPttIsPressed = false;
|
||||||
if (gKeyReading1 != KEY_INVALID)
|
if (gKeyReading1 != KEY_INVALID)
|
||||||
gPttWasReleased = true;
|
gPttWasReleased = true;
|
||||||
@@ -1142,7 +1142,7 @@ void APP_CheckKeys(void)
|
|||||||
boot_counter_10ms = 0;
|
boot_counter_10ms = 0;
|
||||||
gPttDebounceCounter = 0;
|
gPttDebounceCounter = 0;
|
||||||
gPttIsPressed = true;
|
gPttIsPressed = true;
|
||||||
APP_ProcessKey(KEY_PTT, true, false);
|
ProcessKey(KEY_PTT, true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1160,7 +1160,7 @@ void APP_CheckKeys(void)
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (gKeyReading0 != KEY_INVALID && Key != KEY_INVALID)
|
if (gKeyReading0 != KEY_INVALID && Key != KEY_INVALID)
|
||||||
APP_ProcessKey(gKeyReading1, false, gKeyBeingHeld); // key pressed without releasing previous key
|
ProcessKey(gKeyReading1, false, gKeyBeingHeld); // key pressed without releasing previous key
|
||||||
|
|
||||||
gKeyReading0 = Key;
|
gKeyReading0 = Key;
|
||||||
gDebounceCounter = 0;
|
gDebounceCounter = 0;
|
||||||
@@ -1175,14 +1175,14 @@ void APP_CheckKeys(void)
|
|||||||
{
|
{
|
||||||
if (gKeyReading1 != KEY_INVALID) // some button was pressed before
|
if (gKeyReading1 != KEY_INVALID) // some button was pressed before
|
||||||
{
|
{
|
||||||
APP_ProcessKey(gKeyReading1, false, gKeyBeingHeld); // process last button released event
|
ProcessKey(gKeyReading1, false, gKeyBeingHeld); // process last button released event
|
||||||
gKeyReading1 = KEY_INVALID;
|
gKeyReading1 = KEY_INVALID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // process new key pressed
|
else // process new key pressed
|
||||||
{
|
{
|
||||||
gKeyReading1 = Key;
|
gKeyReading1 = Key;
|
||||||
APP_ProcessKey(Key, true, false);
|
ProcessKey(Key, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
gKeyBeingHeld = false;
|
gKeyBeingHeld = false;
|
||||||
@@ -1197,7 +1197,7 @@ void APP_CheckKeys(void)
|
|||||||
if (Key != KEY_PTT)
|
if (Key != KEY_PTT)
|
||||||
{
|
{
|
||||||
gKeyBeingHeld = true;
|
gKeyBeingHeld = true;
|
||||||
APP_ProcessKey(Key, true, true); // key held event
|
ProcessKey(Key, true, true); // key held event
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else //subsequent fast key repeats
|
else //subsequent fast key repeats
|
||||||
@@ -1206,7 +1206,7 @@ void APP_CheckKeys(void)
|
|||||||
{
|
{
|
||||||
gKeyBeingHeld = true;
|
gKeyBeingHeld = true;
|
||||||
if ((gDebounceCounter % key_repeat_10ms) == 0)
|
if ((gDebounceCounter % key_repeat_10ms) == 0)
|
||||||
APP_ProcessKey(Key, true, true); // key held event
|
ProcessKey(Key, true, true); // key held event
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gDebounceCounter < 0xFFFF)
|
if (gDebounceCounter < 0xFFFF)
|
||||||
@@ -1243,7 +1243,7 @@ void APP_TimeSlice10ms(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (gCurrentFunction != FUNCTION_POWER_SAVE || !gRxIdleMode)
|
if (gCurrentFunction != FUNCTION_POWER_SAVE || !gRxIdleMode)
|
||||||
APP_CheckRadioInterrupts();
|
CheckRadioInterrupts();
|
||||||
|
|
||||||
if (gCurrentFunction == FUNCTION_TRANSMIT)
|
if (gCurrentFunction == FUNCTION_TRANSMIT)
|
||||||
{ // transmitting
|
{ // transmitting
|
||||||
@@ -1260,7 +1260,7 @@ void APP_TimeSlice10ms(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gUpdateStatus)
|
if (gUpdateStatus)
|
||||||
UI_DisplayStatus(false);
|
UI_DisplayStatus();
|
||||||
|
|
||||||
// Skipping authentic device checks
|
// Skipping authentic device checks
|
||||||
|
|
||||||
@@ -1269,37 +1269,7 @@ void APP_TimeSlice10ms(void)
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (gFlashLightState == FLASHLIGHT_BLINK && (gFlashLightBlinkCounter & 15u) == 0)
|
FlashlightTimeSlice();
|
||||||
GPIO_FlipBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
|
||||||
else if(gFlashLightState == FLASHLIGHT_SOS) {
|
|
||||||
const uint16_t u = 15;
|
|
||||||
static uint8_t c;
|
|
||||||
static uint16_t next;
|
|
||||||
|
|
||||||
if(gFlashLightBlinkCounter - next > 7*u) {
|
|
||||||
c = 0;
|
|
||||||
next = gFlashLightBlinkCounter+1;
|
|
||||||
}
|
|
||||||
else if(gFlashLightBlinkCounter == next) {
|
|
||||||
if(c==0) {
|
|
||||||
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
GPIO_FlipBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
|
||||||
|
|
||||||
if(c == 18) {
|
|
||||||
next += 7*u;
|
|
||||||
c = 0;
|
|
||||||
}
|
|
||||||
else if(c==7 || c==9 || c==11)
|
|
||||||
next += 3*u;
|
|
||||||
else
|
|
||||||
next += u;
|
|
||||||
|
|
||||||
c++;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef ENABLE_VOX
|
#ifdef ENABLE_VOX
|
||||||
if (gVoxResumeCountdown > 0)
|
if (gVoxResumeCountdown > 0)
|
||||||
@@ -1399,14 +1369,14 @@ void APP_TimeSlice10ms(void)
|
|||||||
{
|
{
|
||||||
if (--gScanDelay_10ms > 0)
|
if (--gScanDelay_10ms > 0)
|
||||||
{
|
{
|
||||||
APP_CheckKeys();
|
CheckKeys();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gScannerEditState != 0)
|
if (gScannerEditState != 0)
|
||||||
{
|
{
|
||||||
APP_CheckKeys();
|
CheckKeys();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1525,7 +1495,7 @@ void APP_TimeSlice10ms(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
APP_CheckKeys();
|
CheckKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cancelUserInputModes(void)
|
void cancelUserInputModes(void)
|
||||||
@@ -1750,7 +1720,7 @@ void APP_TimeSlice500ms(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gCurrentFunction != FUNCTION_POWER_SAVE && gCurrentFunction != FUNCTION_TRANSMIT)
|
if (gCurrentFunction != FUNCTION_POWER_SAVE && gCurrentFunction != FUNCTION_TRANSMIT)
|
||||||
updateRSSI(gEeprom.RX_VFO);
|
UpdateRSSI(gEeprom.RX_VFO);
|
||||||
|
|
||||||
if (!gPttIsPressed && gVFOStateResumeCountdown_500ms > 0)
|
if (!gPttIsPressed && gVFOStateResumeCountdown_500ms > 0)
|
||||||
{
|
{
|
||||||
@@ -1909,7 +1879,7 @@ void APP_TimeSlice500ms(void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||||
{
|
{
|
||||||
if (Key == KEY_EXIT && !BACKLIGHT_IsOn() && gEeprom.BACKLIGHT_TIME > 0)
|
if (Key == KEY_EXIT && !BACKLIGHT_IsOn() && gEeprom.BACKLIGHT_TIME > 0)
|
||||||
{ // just turn the light on for now so the user can see what's what
|
{ // just turn the light on for now so the user can see what's what
|
||||||
@@ -2369,3 +2339,37 @@ Skip:
|
|||||||
|
|
||||||
gUpdateDisplay = true;
|
gUpdateDisplay = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void FlashlightTimeSlice()
|
||||||
|
{
|
||||||
|
if (gFlashLightState == FLASHLIGHT_BLINK && (gFlashLightBlinkCounter & 15u) == 0)
|
||||||
|
GPIO_FlipBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||||
|
else if(gFlashLightState == FLASHLIGHT_SOS) {
|
||||||
|
const uint16_t u = 15;
|
||||||
|
static uint8_t c;
|
||||||
|
static uint16_t next;
|
||||||
|
|
||||||
|
if(gFlashLightBlinkCounter - next > 7*u) {
|
||||||
|
c = 0;
|
||||||
|
next = gFlashLightBlinkCounter + 1;
|
||||||
|
}
|
||||||
|
else if(gFlashLightBlinkCounter == next) {
|
||||||
|
if(c==0) {
|
||||||
|
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
GPIO_FlipBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT);
|
||||||
|
|
||||||
|
if(c >= 18) {
|
||||||
|
next = gFlashLightBlinkCounter + 7*u;
|
||||||
|
c = 0;
|
||||||
|
}
|
||||||
|
else if(c==7 || c==9 || c==11)
|
||||||
|
next = gFlashLightBlinkCounter + 3*u;
|
||||||
|
else
|
||||||
|
next = gFlashLightBlinkCounter + u;
|
||||||
|
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -594,7 +594,7 @@ void MENU_AcceptSetting(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case MENU_STE:
|
case MENU_STE:
|
||||||
gEeprom.TAIL_NOTE_ELIMINATION = gSubMenuSelection;
|
gEeprom.TAIL_TONE_ELIMINATION = gSubMenuSelection;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_RP_STE:
|
case MENU_RP_STE:
|
||||||
@@ -1015,7 +1015,7 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_STE:
|
case MENU_STE:
|
||||||
gSubMenuSelection = gEeprom.TAIL_NOTE_ELIMINATION;
|
gSubMenuSelection = gEeprom.TAIL_TONE_ELIMINATION;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_RP_STE:
|
case MENU_RP_STE:
|
||||||
|
@@ -52,6 +52,9 @@ extern volatile uint16_t gScanPauseDelayIn_10ms;
|
|||||||
extern uint8_t gScanProgressIndicator;
|
extern uint8_t gScanProgressIndicator;
|
||||||
extern uint8_t gScanHitCount;
|
extern uint8_t gScanHitCount;
|
||||||
extern bool gScanUseCssResult;
|
extern bool gScanUseCssResult;
|
||||||
|
|
||||||
|
// scan direction, if not equal SCAN_OFF indicates
|
||||||
|
// that we are in a process of scanning channels/frequencies
|
||||||
extern int8_t gScanStateDir;
|
extern int8_t gScanStateDir;
|
||||||
extern bool gScanKeepResult;
|
extern bool gScanKeepResult;
|
||||||
|
|
||||||
|
2
board.c
2
board.c
@@ -564,7 +564,7 @@ void BOARD_EEPROM_Init(void)
|
|||||||
gEeprom.BATTERY_SAVE = (Data[3] < 5) ? Data[3] : 4;
|
gEeprom.BATTERY_SAVE = (Data[3] < 5) ? Data[3] : 4;
|
||||||
gEeprom.DUAL_WATCH = (Data[4] < 3) ? Data[4] : DUAL_WATCH_CHAN_A;
|
gEeprom.DUAL_WATCH = (Data[4] < 3) ? Data[4] : DUAL_WATCH_CHAN_A;
|
||||||
gEeprom.BACKLIGHT_TIME = (Data[5] < ARRAY_SIZE(gSubMenu_BACKLIGHT)) ? Data[5] : 3;
|
gEeprom.BACKLIGHT_TIME = (Data[5] < ARRAY_SIZE(gSubMenu_BACKLIGHT)) ? Data[5] : 3;
|
||||||
gEeprom.TAIL_NOTE_ELIMINATION = (Data[6] < 2) ? Data[6] : false;
|
gEeprom.TAIL_TONE_ELIMINATION = (Data[6] < 2) ? Data[6] : false;
|
||||||
gEeprom.VFO_OPEN = (Data[7] < 2) ? Data[7] : true;
|
gEeprom.VFO_OPEN = (Data[7] < 2) ? Data[7] : true;
|
||||||
|
|
||||||
// 0E80..0E87
|
// 0E80..0E87
|
||||||
|
@@ -62,6 +62,7 @@ enum BK4819_CssScanResult_t
|
|||||||
|
|
||||||
typedef enum BK4819_CssScanResult_t BK4819_CssScanResult_t;
|
typedef enum BK4819_CssScanResult_t BK4819_CssScanResult_t;
|
||||||
|
|
||||||
|
// radio is asleep, not listening
|
||||||
extern bool gRxIdleMode;
|
extern bool gRxIdleMode;
|
||||||
|
|
||||||
void BK4819_Init(void);
|
void BK4819_Init(void);
|
||||||
|
@@ -93,7 +93,7 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
|
|||||||
{
|
{
|
||||||
BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable();
|
BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable();
|
||||||
gRxIdleMode = false;
|
gRxIdleMode = false;
|
||||||
UI_DisplayStatus(false);
|
UI_DisplayStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (Function)
|
switch (Function)
|
||||||
|
6
misc.h
6
misc.h
@@ -225,8 +225,12 @@ extern bool gEndOfRxDetectedMaybe;
|
|||||||
extern int16_t gVFO_RSSI[2];
|
extern int16_t gVFO_RSSI[2];
|
||||||
extern uint8_t gVFO_RSSI_bar_level[2];
|
extern uint8_t gVFO_RSSI_bar_level[2];
|
||||||
|
|
||||||
|
// battery critical, limit functionality to minimum
|
||||||
extern uint8_t gReducedService;
|
extern uint8_t gReducedService;
|
||||||
extern uint8_t gBatteryVoltageIndex;
|
extern uint8_t gBatteryVoltageIndex;
|
||||||
|
|
||||||
|
// if not equal CSS_SCAN_MODE_OFF we are scanning CTCSS/DCS
|
||||||
|
// this is a scanning inside RX ctcss/dcs menu
|
||||||
extern CssScanMode_t gCssScanMode;
|
extern CssScanMode_t gCssScanMode;
|
||||||
extern bool gUpdateRSSI;
|
extern bool gUpdateRSSI;
|
||||||
extern AlarmState_t gAlarmState;
|
extern AlarmState_t gAlarmState;
|
||||||
@@ -264,6 +268,8 @@ extern bool g_CxCSS_TAIL_Found;
|
|||||||
extern uint16_t gVoxResumeCountdown;
|
extern uint16_t gVoxResumeCountdown;
|
||||||
extern uint16_t gVoxPauseCountdown;
|
extern uint16_t gVoxPauseCountdown;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// true means we are receiving signal
|
||||||
extern bool g_SquelchLost;
|
extern bool g_SquelchLost;
|
||||||
extern uint8_t gFlashLightState;
|
extern uint8_t gFlashLightState;
|
||||||
extern volatile uint16_t gFlashLightBlinkCounter;
|
extern volatile uint16_t gFlashLightBlinkCounter;
|
||||||
|
4
radio.c
4
radio.c
@@ -570,7 +570,7 @@ void RADIO_SelectVfos(void)
|
|||||||
RADIO_SelectCurrentVfo();
|
RADIO_SelectCurrentVfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RADIO_SetupRegisters(bool bSwitchToFunction0)
|
void RADIO_SetupRegisters(bool switchToForeground)
|
||||||
{
|
{
|
||||||
BK4819_FilterBandwidth_t Bandwidth = gRxVfo->CHANNEL_BANDWIDTH;
|
BK4819_FilterBandwidth_t Bandwidth = gRxVfo->CHANNEL_BANDWIDTH;
|
||||||
uint16_t InterruptMask;
|
uint16_t InterruptMask;
|
||||||
@@ -773,7 +773,7 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
|
|||||||
|
|
||||||
FUNCTION_Init();
|
FUNCTION_Init();
|
||||||
|
|
||||||
if (bSwitchToFunction0)
|
if (switchToForeground)
|
||||||
FUNCTION_Select(FUNCTION_FOREGROUND);
|
FUNCTION_Select(FUNCTION_FOREGROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -102,7 +102,7 @@ void SETTINGS_SaveSettings(void)
|
|||||||
State[3] = gEeprom.BATTERY_SAVE;
|
State[3] = gEeprom.BATTERY_SAVE;
|
||||||
State[4] = gEeprom.DUAL_WATCH;
|
State[4] = gEeprom.DUAL_WATCH;
|
||||||
State[5] = gEeprom.BACKLIGHT_TIME;
|
State[5] = gEeprom.BACKLIGHT_TIME;
|
||||||
State[6] = gEeprom.TAIL_NOTE_ELIMINATION;
|
State[6] = gEeprom.TAIL_TONE_ELIMINATION;
|
||||||
State[7] = gEeprom.VFO_OPEN;
|
State[7] = gEeprom.VFO_OPEN;
|
||||||
EEPROM_WriteBuffer(0x0E78, State);
|
EEPROM_WriteBuffer(0x0E78, State);
|
||||||
|
|
||||||
|
@@ -155,7 +155,7 @@ typedef struct {
|
|||||||
#endif
|
#endif
|
||||||
bool BEEP_CONTROL;
|
bool BEEP_CONTROL;
|
||||||
uint8_t CHANNEL_DISPLAY_MODE;
|
uint8_t CHANNEL_DISPLAY_MODE;
|
||||||
bool TAIL_NOTE_ELIMINATION;
|
bool TAIL_TONE_ELIMINATION;
|
||||||
bool VFO_OPEN;
|
bool VFO_OPEN;
|
||||||
uint8_t DUAL_WATCH;
|
uint8_t DUAL_WATCH;
|
||||||
uint8_t CROSS_BAND_RX_TX;
|
uint8_t CROSS_BAND_RX_TX;
|
||||||
|
37
ui/status.c
37
ui/status.c
@@ -33,7 +33,7 @@
|
|||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
#include "ui/status.h"
|
#include "ui/status.h"
|
||||||
|
|
||||||
void UI_DisplayStatus(const bool test_display)
|
void UI_DisplayStatus()
|
||||||
{
|
{
|
||||||
uint8_t *line = gStatusLine;
|
uint8_t *line = gStatusLine;
|
||||||
unsigned int x = 0;
|
unsigned int x = 0;
|
||||||
@@ -60,7 +60,7 @@ void UI_DisplayStatus(const bool test_display)
|
|||||||
x1 = x + sizeof(BITMAP_RX);
|
x1 = x + sizeof(BITMAP_RX);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (gCurrentFunction == FUNCTION_POWER_SAVE || test_display)
|
if (gCurrentFunction == FUNCTION_POWER_SAVE)
|
||||||
{
|
{
|
||||||
memmove(line + x, BITMAP_POWERSAVE, sizeof(BITMAP_POWERSAVE));
|
memmove(line + x, BITMAP_POWERSAVE, sizeof(BITMAP_POWERSAVE));
|
||||||
x1 = x + sizeof(BITMAP_POWERSAVE);
|
x1 = x + sizeof(BITMAP_POWERSAVE);
|
||||||
@@ -69,7 +69,7 @@ void UI_DisplayStatus(const bool test_display)
|
|||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
// NOASS SCAN indicator
|
// NOASS SCAN indicator
|
||||||
if (gIsNoaaMode || test_display)
|
if (gIsNoaaMode)
|
||||||
{
|
{
|
||||||
memmove(line + x, BITMAP_NOAA, sizeof(BITMAP_NOAA));
|
memmove(line + x, BITMAP_NOAA, sizeof(BITMAP_NOAA));
|
||||||
x1 = x + sizeof(BITMAP_NOAA);
|
x1 = x + sizeof(BITMAP_NOAA);
|
||||||
@@ -86,30 +86,29 @@ void UI_DisplayStatus(const bool test_display)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
// SCAN indicator
|
// SCAN indicator
|
||||||
if (gScanStateDir != SCAN_OFF || gScreenToDisplay == DISPLAY_SCANNER || test_display)
|
if (gScanStateDir != SCAN_OFF || gScreenToDisplay == DISPLAY_SCANNER)
|
||||||
{
|
{
|
||||||
|
char * s = "";
|
||||||
if (IS_MR_CHANNEL(gNextMrChannel) && gScreenToDisplay != DISPLAY_SCANNER)
|
if (IS_MR_CHANNEL(gNextMrChannel) && gScreenToDisplay != DISPLAY_SCANNER)
|
||||||
{ // channel mode
|
{ // channel mode
|
||||||
if (gEeprom.SCAN_LIST_DEFAULT == 0)
|
switch(gEeprom.SCAN_LIST_DEFAULT) {
|
||||||
UI_PrintStringSmallBuffer("1", line + x);
|
case 0: s = "1"; break;
|
||||||
else
|
case 1: s = "2"; break;
|
||||||
if (gEeprom.SCAN_LIST_DEFAULT == 1)
|
case 2: s = "*"; break;
|
||||||
UI_PrintStringSmallBuffer("2", line + x);
|
}
|
||||||
else
|
|
||||||
if (gEeprom.SCAN_LIST_DEFAULT == 2)
|
|
||||||
UI_PrintStringSmallBuffer("*", line + x);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // frequency mode
|
{ // frequency mode
|
||||||
UI_PrintStringSmallBuffer("S", line + x);
|
s = "S";
|
||||||
}
|
}
|
||||||
|
UI_PrintStringSmallBuffer(s, line + x);
|
||||||
x1 = x + 7;
|
x1 = x + 7;
|
||||||
}
|
}
|
||||||
x += 7; // font character width
|
x += 7; // font character width
|
||||||
|
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
// VOICE indicator
|
// VOICE indicator
|
||||||
if (gEeprom.VOICE_PROMPT != VOICE_PROMPT_OFF || test_display)
|
if (gEeprom.VOICE_PROMPT != VOICE_PROMPT_OFF)
|
||||||
{
|
{
|
||||||
memmove(line + x, BITMAP_VoicePrompt, sizeof(BITMAP_VoicePrompt));
|
memmove(line + x, BITMAP_VoicePrompt, sizeof(BITMAP_VoicePrompt));
|
||||||
x1 = x + sizeof(BITMAP_VoicePrompt);
|
x1 = x + sizeof(BITMAP_VoicePrompt);
|
||||||
@@ -122,8 +121,8 @@ void UI_DisplayStatus(const bool test_display)
|
|||||||
x++;
|
x++;
|
||||||
if(gScreenToDisplay != DISPLAY_SCANNER) {
|
if(gScreenToDisplay != DISPLAY_SCANNER) {
|
||||||
uint8_t dw = (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2;
|
uint8_t dw = (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) + (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF) * 2;
|
||||||
if(dw == 1 || dw == 3 || test_display) { // DWR - dual watch + respond
|
if(dw == 1 || dw == 3) { // DWR - dual watch + respond
|
||||||
if(gDualWatchActive || test_display)
|
if(gDualWatchActive)
|
||||||
memmove(line + x, BITMAP_TDR1, sizeof(BITMAP_TDR1) - (dw==1?0:5));
|
memmove(line + x, BITMAP_TDR1, sizeof(BITMAP_TDR1) - (dw==1?0:5));
|
||||||
else
|
else
|
||||||
memmove(line + x + 3, BITMAP_TDR2, sizeof(BITMAP_TDR2));
|
memmove(line + x + 3, BITMAP_TDR2, sizeof(BITMAP_TDR2));
|
||||||
@@ -136,7 +135,7 @@ void UI_DisplayStatus(const bool test_display)
|
|||||||
|
|
||||||
#ifdef ENABLE_VOX
|
#ifdef ENABLE_VOX
|
||||||
// VOX indicator
|
// VOX indicator
|
||||||
if (gEeprom.VOX_SWITCH || test_display)
|
if (gEeprom.VOX_SWITCH)
|
||||||
{
|
{
|
||||||
memmove(line + x, BITMAP_VOX, sizeof(BITMAP_VOX));
|
memmove(line + x, BITMAP_VOX, sizeof(BITMAP_VOX));
|
||||||
x1 = x + sizeof(BITMAP_VOX);
|
x1 = x + sizeof(BITMAP_VOX);
|
||||||
@@ -148,7 +147,7 @@ void UI_DisplayStatus(const bool test_display)
|
|||||||
x1 = x;
|
x1 = x;
|
||||||
|
|
||||||
// KEY-LOCK indicator
|
// KEY-LOCK indicator
|
||||||
if (gEeprom.KEY_LOCK || test_display)
|
if (gEeprom.KEY_LOCK)
|
||||||
{
|
{
|
||||||
memmove(line + x, BITMAP_KeyLock, sizeof(BITMAP_KeyLock));
|
memmove(line + x, BITMAP_KeyLock, sizeof(BITMAP_KeyLock));
|
||||||
x += sizeof(BITMAP_KeyLock);
|
x += sizeof(BITMAP_KeyLock);
|
||||||
@@ -204,7 +203,7 @@ void UI_DisplayStatus(const bool test_display)
|
|||||||
x = LCD_WIDTH - sizeof(BITMAP_BatteryLevel1) - sizeof(BITMAP_USB_C);
|
x = LCD_WIDTH - sizeof(BITMAP_BatteryLevel1) - sizeof(BITMAP_USB_C);
|
||||||
|
|
||||||
// USB-C charge indicator
|
// USB-C charge indicator
|
||||||
if (gChargingWithTypeC || test_display)
|
if (gChargingWithTypeC)
|
||||||
memmove(line + x, BITMAP_USB_C, sizeof(BITMAP_USB_C));
|
memmove(line + x, BITMAP_USB_C, sizeof(BITMAP_USB_C));
|
||||||
x += sizeof(BITMAP_USB_C);
|
x += sizeof(BITMAP_USB_C);
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
#ifndef UI_STATUS_H
|
#ifndef UI_STATUS_H
|
||||||
#define UI_STATUS_H
|
#define UI_STATUS_H
|
||||||
|
|
||||||
void UI_DisplayStatus(const bool test_display);
|
void UI_DisplayStatus();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
14
ui/welcome.c
14
ui/welcome.c
@@ -43,7 +43,6 @@ void UI_DisplayWelcome(void)
|
|||||||
{
|
{
|
||||||
char WelcomeString0[16];
|
char WelcomeString0[16];
|
||||||
char WelcomeString1[16];
|
char WelcomeString1[16];
|
||||||
char WelcomeString2[16];
|
|
||||||
|
|
||||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||||
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
|
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
|
||||||
@@ -61,7 +60,6 @@ void UI_DisplayWelcome(void)
|
|||||||
{
|
{
|
||||||
memset(WelcomeString0, 0, sizeof(WelcomeString0));
|
memset(WelcomeString0, 0, sizeof(WelcomeString0));
|
||||||
memset(WelcomeString1, 0, sizeof(WelcomeString1));
|
memset(WelcomeString1, 0, sizeof(WelcomeString1));
|
||||||
memset(WelcomeString2, 0, sizeof(WelcomeString2));
|
|
||||||
|
|
||||||
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_VOLTAGE)
|
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_VOLTAGE)
|
||||||
{
|
{
|
||||||
@@ -70,10 +68,6 @@ void UI_DisplayWelcome(void)
|
|||||||
gBatteryVoltageAverage / 100,
|
gBatteryVoltageAverage / 100,
|
||||||
gBatteryVoltageAverage % 100,
|
gBatteryVoltageAverage % 100,
|
||||||
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||||
|
|
||||||
#if 0
|
|
||||||
sprintf(WelcomeString2, "Current %u", gBatteryCurrent); // needs scaling into mA
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -83,17 +77,9 @@ void UI_DisplayWelcome(void)
|
|||||||
|
|
||||||
UI_PrintString(WelcomeString0, 0, 127, 0, 10);
|
UI_PrintString(WelcomeString0, 0, 127, 0, 10);
|
||||||
UI_PrintString(WelcomeString1, 0, 127, 2, 10);
|
UI_PrintString(WelcomeString1, 0, 127, 2, 10);
|
||||||
#if 0
|
|
||||||
UI_PrintStringSmall(WelcomeString2, 0, 127, 4);
|
|
||||||
#endif
|
|
||||||
UI_PrintStringSmall(Version, 0, 0, 6);
|
UI_PrintStringSmall(Version, 0, 0, 6);
|
||||||
|
|
||||||
#if 1
|
|
||||||
ST7565_BlitStatusLine(); // blank status line
|
ST7565_BlitStatusLine(); // blank status line
|
||||||
#else
|
|
||||||
UI_DisplayStatus(true); // show all status line symbols (test)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ST7565_BlitFullScreen();
|
ST7565_BlitFullScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user