Add sound alert on startup
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
#include "driver/system.h"
|
#include "driver/system.h"
|
||||||
|
#include "audio.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// this is decremented once every 500ms
|
// this is decremented once every 500ms
|
||||||
@@ -74,6 +75,13 @@ void BACKLIGHT_TurnOn(void)
|
|||||||
BACKLIGHT_SetBrightness(i);
|
BACKLIGHT_SetBrightness(i);
|
||||||
SYSTEM_DelayMs(50);
|
SYSTEM_DelayMs(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_SOUND || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_ALL)
|
||||||
|
{
|
||||||
|
AUDIO_PlayBeep(BEEP_880HZ_60MS_TRIPLE_BEEP);
|
||||||
|
AUDIO_PlayBeep(BEEP_880HZ_60MS_TRIPLE_BEEP);
|
||||||
|
}
|
||||||
|
|
||||||
k5Startup = false;
|
k5Startup = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
4
main.c
4
main.c
@@ -164,7 +164,11 @@ void Main(void)
|
|||||||
|
|
||||||
BACKLIGHT_TurnOn();
|
BACKLIGHT_TurnOn();
|
||||||
|
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE && gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_SOUND)
|
||||||
|
#else
|
||||||
if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE)
|
if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE)
|
||||||
|
#endif
|
||||||
{ // 2.55 second boot-up screen
|
{ // 2.55 second boot-up screen
|
||||||
while (boot_counter_10ms > 0)
|
while (boot_counter_10ms > 0)
|
||||||
{
|
{
|
||||||
|
@@ -121,7 +121,11 @@ void SETTINGS_InitEEPROM(void)
|
|||||||
gEeprom.KEY_2_LONG_PRESS_ACTION = (Data[4] < ACTION_OPT_LEN) ? Data[4] : ACTION_OPT_NONE;
|
gEeprom.KEY_2_LONG_PRESS_ACTION = (Data[4] < ACTION_OPT_LEN) ? Data[4] : ACTION_OPT_NONE;
|
||||||
gEeprom.SCAN_RESUME_MODE = (Data[5] < 3) ? Data[5] : SCAN_RESUME_CO;
|
gEeprom.SCAN_RESUME_MODE = (Data[5] < 3) ? Data[5] : SCAN_RESUME_CO;
|
||||||
gEeprom.AUTO_KEYPAD_LOCK = (Data[6] < 2) ? Data[6] : false;
|
gEeprom.AUTO_KEYPAD_LOCK = (Data[6] < 2) ? Data[6] : false;
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
gEeprom.POWER_ON_DISPLAY_MODE = (Data[7] < 6) ? Data[7] : POWER_ON_DISPLAY_MODE_VOLTAGE;
|
||||||
|
#else
|
||||||
gEeprom.POWER_ON_DISPLAY_MODE = (Data[7] < 4) ? Data[7] : POWER_ON_DISPLAY_MODE_VOLTAGE;
|
gEeprom.POWER_ON_DISPLAY_MODE = (Data[7] < 4) ? Data[7] : POWER_ON_DISPLAY_MODE_VOLTAGE;
|
||||||
|
#endif
|
||||||
|
|
||||||
// 0E98..0E9F
|
// 0E98..0E9F
|
||||||
EEPROM_ReadBuffer(0x0E98, Data, 8);
|
EEPROM_ReadBuffer(0x0E98, Data, 8);
|
||||||
|
@@ -26,7 +26,12 @@
|
|||||||
#include <driver/backlight.h>
|
#include <driver/backlight.h>
|
||||||
|
|
||||||
enum POWER_OnDisplayMode_t {
|
enum POWER_OnDisplayMode_t {
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
POWER_ON_DISPLAY_MODE_ALL,
|
||||||
|
POWER_ON_DISPLAY_MODE_SOUND,
|
||||||
|
#else
|
||||||
POWER_ON_DISPLAY_MODE_FULL_SCREEN = 0,
|
POWER_ON_DISPLAY_MODE_FULL_SCREEN = 0,
|
||||||
|
#endif
|
||||||
POWER_ON_DISPLAY_MODE_MESSAGE,
|
POWER_ON_DISPLAY_MODE_MESSAGE,
|
||||||
POWER_ON_DISPLAY_MODE_VOLTAGE,
|
POWER_ON_DISPLAY_MODE_VOLTAGE,
|
||||||
POWER_ON_DISPLAY_MODE_NONE
|
POWER_ON_DISPLAY_MODE_NONE
|
||||||
|
@@ -269,7 +269,12 @@ const char* const gSubMenu_PTT_ID[] =
|
|||||||
|
|
||||||
const char gSubMenu_PONMSG[][8] =
|
const char gSubMenu_PONMSG[][8] =
|
||||||
{
|
{
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
"ALL",
|
||||||
|
"SOUND",
|
||||||
|
#else
|
||||||
"FULL",
|
"FULL",
|
||||||
|
#endif
|
||||||
"MESSAGE",
|
"MESSAGE",
|
||||||
"VOLTAGE",
|
"VOLTAGE",
|
||||||
"NONE"
|
"NONE"
|
||||||
|
@@ -173,7 +173,11 @@ extern const char gSubMenu_D_RSP[4][11];
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern const char* const gSubMenu_PTT_ID[5];
|
extern const char* const gSubMenu_PTT_ID[5];
|
||||||
extern const char gSubMenu_PONMSG[4][8];
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
extern const char gSubMenu_PONMSG[5][8];
|
||||||
|
#else
|
||||||
|
extern const char gSubMenu_PONMSG[4][8];
|
||||||
|
#endif
|
||||||
extern const char gSubMenu_ROGER[3][6];
|
extern const char gSubMenu_ROGER[3][6];
|
||||||
extern const char gSubMenu_RESET[2][4];
|
extern const char gSubMenu_RESET[2][4];
|
||||||
extern const char* const gSubMenu_F_LOCK[F_LOCK_LEN];
|
extern const char* const gSubMenu_F_LOCK[F_LOCK_LEN];
|
||||||
|
28
ui/welcome.c
28
ui/welcome.c
@@ -54,8 +54,13 @@ void UI_DisplayWelcome(void)
|
|||||||
#endif
|
#endif
|
||||||
UI_DisplayClear();
|
UI_DisplayClear();
|
||||||
|
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_SOUND) {
|
||||||
|
ST7565_FillScreen(0x00);
|
||||||
|
#else
|
||||||
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_FULL_SCREEN) {
|
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_NONE || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_FULL_SCREEN) {
|
||||||
ST7565_FillScreen(0xFF);
|
ST7565_FillScreen(0xFF);
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
memset(WelcomeString0, 0, sizeof(WelcomeString0));
|
memset(WelcomeString0, 0, sizeof(WelcomeString0));
|
||||||
memset(WelcomeString1, 0, sizeof(WelcomeString1));
|
memset(WelcomeString1, 0, sizeof(WelcomeString1));
|
||||||
@@ -68,21 +73,32 @@ void UI_DisplayWelcome(void)
|
|||||||
gBatteryVoltageAverage % 100,
|
gBatteryVoltageAverage % 100,
|
||||||
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||||
}
|
}
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
else if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_MESSAGE || gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_ALL)
|
||||||
|
#else
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
EEPROM_ReadBuffer(0x0EB0, WelcomeString0, 16);
|
EEPROM_ReadBuffer(0x0EB0, WelcomeString0, 16);
|
||||||
EEPROM_ReadBuffer(0x0EC0, WelcomeString1, 16);
|
EEPROM_ReadBuffer(0x0EC0, WelcomeString1, 16);
|
||||||
|
|
||||||
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
|
if(gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_ALL)
|
||||||
|
{
|
||||||
|
sprintf(WelcomeString1, "%u.%02uV %u%%",
|
||||||
|
gBatteryVoltageAverage / 100,
|
||||||
|
gBatteryVoltageAverage % 100,
|
||||||
|
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||||
|
}
|
||||||
|
else if(strlen(WelcomeString1) == 0) {
|
||||||
|
UI_PrintString("BIENVENUE", 0, 127, 2, 10);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
|
||||||
if(strlen(WelcomeString1) == 0) {
|
|
||||||
UI_PrintString("BIENVENUE", 0, 127, 2, 10);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ENABLE_FEAT_F4HWN
|
#ifdef ENABLE_FEAT_F4HWN
|
||||||
UI_PrintStringSmallNormal(Credits, 0, 128, 5);
|
UI_PrintStringSmallNormal(Credits, 0, 128, 5);
|
||||||
UI_PrintStringSmallNormal(Feat, 0, 128, 6);
|
UI_PrintStringSmallNormal(Feat, 0, 128, 6);
|
||||||
|
Reference in New Issue
Block a user