0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-20 15:08:37 +03:00

Tidy ups and makefile update

This commit is contained in:
OneOfEleven
2023-09-14 09:56:30 +01:00
parent fe212140dd
commit 54711a5971
53 changed files with 1092 additions and 687 deletions

View File

@ -16,7 +16,9 @@
#include <string.h>
#include "app/fm.h"
#ifdef ENABLE_FMRADIO
#include "app/fm.h"
#endif
#include "bitmaps.h"
#include "driver/keyboard.h"
#include "driver/st7565.h"
@ -26,65 +28,63 @@
#include "settings.h"
#include "ui/status.h"
void UI_DisplayStatus(void)
void UI_DisplayStatus(const bool test_display)
{
memset(gStatusLine, 0, sizeof(gStatusLine));
if (gCurrentFunction == FUNCTION_POWER_SAVE)
if (gCurrentFunction == FUNCTION_POWER_SAVE || test_display)
memcpy(gStatusLine, BITMAP_PowerSave, sizeof(BITMAP_PowerSave));
if (gBatteryDisplayLevel < 2)
{
if (gLowBatteryBlink == 1)
memcpy(gStatusLine + 110, BITMAP_BatteryLevel1, sizeof(BITMAP_BatteryLevel1));
}
else
{
if (gBatteryDisplayLevel == 2)
memcpy(gStatusLine + 110, BITMAP_BatteryLevel2, sizeof(BITMAP_BatteryLevel2));
#ifdef ENABLE_NOAA
if (gIsNoaaMode || test_display)
memcpy(gStatusLine + 7, BITMAP_NOAA, sizeof(BITMAP_NOAA));
#endif
if (gSetting_KILLED || test_display)
memset(gStatusLine + 21, 0xFF, 10);
#ifdef ENABLE_FMRADIO
else
if (gBatteryDisplayLevel == 3)
memcpy(gStatusLine + 110, BITMAP_BatteryLevel3, sizeof(BITMAP_BatteryLevel3));
else
if (gBatteryDisplayLevel == 4)
memcpy(gStatusLine + 110, BITMAP_BatteryLevel4, sizeof(BITMAP_BatteryLevel4));
else
memcpy(gStatusLine + 110, BITMAP_BatteryLevel5, sizeof(BITMAP_BatteryLevel5));
}
if (gFmRadioMode || test_display)
memcpy(gStatusLine + 21, BITMAP_FM, sizeof(BITMAP_FM));
#endif
if (gChargingWithTypeC)
memcpy(gStatusLine + 100, BITMAP_USB_C, sizeof(BITMAP_USB_C));
#ifdef ENABLE_VOICE
if (gEeprom.VOICE_PROMPT != VOICE_PROMPT_OFF || test_display)
memcpy(gStatusLine + 34, BITMAP_VoicePrompt, sizeof(BITMAP_VoicePrompt));
#endif
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF || test_display)
memcpy(gStatusLine + 45, BITMAP_TDR, sizeof(BITMAP_TDR));
if (gEeprom.KEY_LOCK)
if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF || test_display)
memcpy(gStatusLine + 58, BITMAP_XB, sizeof(BITMAP_XB));
if (gEeprom.VOX_SWITCH || test_display)
memcpy(gStatusLine + 71, BITMAP_VOX, sizeof(BITMAP_VOX));
if (gEeprom.KEY_LOCK || test_display)
memcpy(gStatusLine + 90, BITMAP_KeyLock, sizeof(BITMAP_KeyLock));
else
if (gWasFKeyPressed)
memcpy(gStatusLine + 90, BITMAP_F_Key, sizeof(BITMAP_F_Key));
if (gEeprom.VOX_SWITCH)
memcpy(gStatusLine + 71, BITMAP_VOX, sizeof(BITMAP_VOX));
if (gChargingWithTypeC || test_display)
memcpy(gStatusLine + 100, BITMAP_USB_C, sizeof(BITMAP_USB_C));
if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF)
memcpy(gStatusLine + 58, BITMAP_XB, sizeof(BITMAP_XB));
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF)
memcpy(gStatusLine + 45, BITMAP_TDR, sizeof(BITMAP_TDR));
#ifndef DISABLE_VOICE
if (gEeprom.VOICE_PROMPT != VOICE_PROMPT_OFF)
memcpy(gStatusLine + 34, BITMAP_VoicePrompt, sizeof(BITMAP_VoicePrompt));
#endif
if (gSetting_KILLED)
memset(gStatusLine + 21, 0xFF, 10);
if (gBatteryDisplayLevel >= 5 || test_display)
memcpy(gStatusLine + 110, BITMAP_BatteryLevel5, sizeof(BITMAP_BatteryLevel5));
else
if (gFmRadioMode)
memcpy(gStatusLine + 21, BITMAP_FM, sizeof(BITMAP_FM));
if (gBatteryDisplayLevel >= 4)
memcpy(gStatusLine + 110, BITMAP_BatteryLevel4, sizeof(BITMAP_BatteryLevel4));
else
if (gBatteryDisplayLevel >= 3)
memcpy(gStatusLine + 110, BITMAP_BatteryLevel3, sizeof(BITMAP_BatteryLevel3));
else
if (gBatteryDisplayLevel >= 2)
memcpy(gStatusLine + 110, BITMAP_BatteryLevel2, sizeof(BITMAP_BatteryLevel2));
else
if (gLowBatteryBlink == 1)
memcpy(gStatusLine + 110, BITMAP_BatteryLevel1, sizeof(BITMAP_BatteryLevel1));
#ifndef DISABLE_NOAA
if (gIsNoaaMode)
memcpy(gStatusLine + 7, BITMAP_NOAA, sizeof(BITMAP_NOAA));
#endif
ST7565_BlitStatusLine();
}