This commit is contained in:
161
ui/welcome.c
161
ui/welcome.c
@@ -28,11 +28,10 @@
|
||||
#include "version.h"
|
||||
#include "bitmaps.h"
|
||||
|
||||
void UI_DisplayReleaseKeys(void)
|
||||
{
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
void UI_DisplayReleaseKeys(void) {
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
#if defined(ENABLE_FEAT_F4HWN_CTR) || defined(ENABLE_FEAT_F4HWN_INV)
|
||||
ST7565_ContrastAndInv();
|
||||
ST7565_ContrastAndInv();
|
||||
#endif
|
||||
UI_DisplayClear();
|
||||
|
||||
@@ -43,160 +42,24 @@ void UI_DisplayReleaseKeys(void)
|
||||
ST7565_BlitFullScreen();
|
||||
}
|
||||
|
||||
void UI_DisplayWelcome(void)
|
||||
{
|
||||
char WelcomeString0[16];
|
||||
char WelcomeString1[16];
|
||||
char WelcomeString2[16];
|
||||
char WelcomeString3[20];
|
||||
void UI_DisplayWelcome(void) {
|
||||
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
|
||||
#if defined(ENABLE_FEAT_F4HWN_CTR) || defined(ENABLE_FEAT_F4HWN_INV)
|
||||
ST7565_ContrastAndInv();
|
||||
ST7565_ContrastAndInv();
|
||||
#endif
|
||||
UI_DisplayClear();
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
ST7565_BlitStatusLine();
|
||||
ST7565_BlitFullScreen();
|
||||
|
||||
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) {
|
||||
ST7565_FillScreen(0xFF);
|
||||
#endif
|
||||
} else {
|
||||
memset(WelcomeString0, 0, sizeof(WelcomeString0));
|
||||
memset(WelcomeString1, 0, sizeof(WelcomeString1));
|
||||
|
||||
EEPROM_ReadBuffer(0x0EB0, WelcomeString0, 16);
|
||||
EEPROM_ReadBuffer(0x0EC0, WelcomeString1, 16);
|
||||
|
||||
sprintf(WelcomeString2, "%u.%02uV %u%%",
|
||||
gBatteryVoltageAverage / 100,
|
||||
gBatteryVoltageAverage % 100,
|
||||
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||
UI_DrawLineBuffer(gFrameBuffer, 0, 31, 127, 31, 1); // Be ware, status zone = 8 lines, the rest = 56 ->total 64
|
||||
|
||||
if (gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_VOLTAGE)
|
||||
{
|
||||
strcpy(WelcomeString0, "VOLTAGE");
|
||||
strcpy(WelcomeString1, WelcomeString2);
|
||||
}
|
||||
else if(gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_ALL)
|
||||
{
|
||||
if(strlen(WelcomeString0) == 0 && strlen(WelcomeString1) == 0)
|
||||
{
|
||||
strcpy(WelcomeString0, "WELCOME");
|
||||
strcpy(WelcomeString1, WelcomeString2);
|
||||
}
|
||||
else if(strlen(WelcomeString0) == 0 || strlen(WelcomeString1) == 0)
|
||||
{
|
||||
if(strlen(WelcomeString0) == 0)
|
||||
{
|
||||
strcpy(WelcomeString0, WelcomeString1);
|
||||
}
|
||||
strcpy(WelcomeString1, WelcomeString2);
|
||||
}
|
||||
}
|
||||
else if(gEeprom.POWER_ON_DISPLAY_MODE == POWER_ON_DISPLAY_MODE_MESSAGE)
|
||||
{
|
||||
if(strlen(WelcomeString0) == 0)
|
||||
{
|
||||
strcpy(WelcomeString0, "WELCOME");
|
||||
}
|
||||
|
||||
if(strlen(WelcomeString1) == 0)
|
||||
{
|
||||
strcpy(WelcomeString1, "BIENVENUE");
|
||||
}
|
||||
}
|
||||
|
||||
UI_PrintString(WelcomeString0, 0, 127, 0, 10);
|
||||
UI_PrintString(WelcomeString1, 0, 127, 2, 10);
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
UI_PrintStringSmallNormal(Version, 0, 128, 4);
|
||||
|
||||
UI_DrawLineBuffer(gFrameBuffer, 0, 31, 127, 31, 1); // Be ware, status zone = 8 lines, the rest = 56 ->total 64
|
||||
|
||||
for (uint8_t i = 18; i < 110; i++)
|
||||
{
|
||||
gFrameBuffer[4][i] ^= 0xFF;
|
||||
}
|
||||
|
||||
sprintf(WelcomeString3, "%s Edition", Edition);
|
||||
UI_PrintStringSmallNormal(WelcomeString3, 0, 127, 6);
|
||||
|
||||
/*
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
#if ENABLE_FEAT_F4HWN_RESCUE_OPS > 1
|
||||
UI_PrintStringSmallNormal(Edition, 18, 0, 6);
|
||||
if(gEeprom.MENU_LOCK == true) {
|
||||
memcpy(gFrameBuffer[6] + 103, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(gFrameBuffer[6] + 103, BITMAP_NotReady, sizeof(BITMAP_NotReady));
|
||||
}
|
||||
#else
|
||||
UI_PrintStringSmallNormal(Edition, 18, 0, 5);
|
||||
memcpy(gFrameBuffer[5] + 103, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
UI_PrintStringSmallNormal("RescueOps", 18, 0, 6);
|
||||
if(gEeprom.MENU_LOCK == true) {
|
||||
memcpy(gFrameBuffer[6] + 103, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(gFrameBuffer[6] + 103, BITMAP_NotReady, sizeof(BITMAP_NotReady));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
UI_PrintStringSmallNormal(Edition, 18, 0, 6);
|
||||
memcpy(gFrameBuffer[6] + 103, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
#endif
|
||||
*/
|
||||
|
||||
/*
|
||||
#ifdef ENABLE_SPECTRUM
|
||||
#ifdef ENABLE_FMRADIO
|
||||
UI_PrintStringSmallNormal(Based, 0, 127, 5);
|
||||
UI_PrintStringSmallNormal(Credits, 0, 127, 6);
|
||||
#else
|
||||
UI_PrintStringSmallNormal("Bandscope ", 0, 127, 5);
|
||||
memcpy(gFrameBuffer[5] + 95, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
UI_PrintStringSmallNormal("RescueOps ", 0, 127, 6);
|
||||
if(gEeprom.MENU_LOCK == true) {
|
||||
memcpy(gFrameBuffer[6] + 95, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
}
|
||||
#else
|
||||
UI_PrintStringSmallNormal("Broadcast ", 0, 127, 6);
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
UI_PrintStringSmallNormal("RescueOps ", 0, 127, 5);
|
||||
if(gEeprom.MENU_LOCK == true) {
|
||||
memcpy(gFrameBuffer[5] + 95, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
}
|
||||
#else
|
||||
UI_PrintStringSmallNormal("Bandscope ", 0, 127, 5);
|
||||
#endif
|
||||
UI_PrintStringSmallNormal("Broadcast ", 0, 127, 6);
|
||||
memcpy(gFrameBuffer[6] + 95, BITMAP_Ready, sizeof(BITMAP_Ready));
|
||||
#endif
|
||||
*/
|
||||
#else
|
||||
UI_PrintStringSmallNormal(Version, 0, 127, 6);
|
||||
#endif
|
||||
|
||||
//ST7565_BlitStatusLine(); // blank status line : I think it's useless
|
||||
ST7565_BlitFullScreen();
|
||||
for (uint8_t i = 18; i < 110; i++) {
|
||||
gFrameBuffer[4][i] ^= 0xFF;
|
||||
}
|
||||
|
||||
//ST7565_BlitStatusLine(); // blank status line : I think it's useless
|
||||
ST7565_BlitFullScreen();
|
||||
}
|
||||
|
Reference in New Issue
Block a user