mirror of
https://github.com/armel/uv-k1-k5v3-firmware-custom.git
synced 2026-10-02 03:15:37 +00:00
Optimize RAM usage by making lookup tables const
This commit is contained in:
1 parent
c9da65117f
commit
12dfa8a87f
7 files changed
+7
-7
No files matched your search
+1
-1
@@ -61,7 +61,7 @@ inline static void ACTION_1750() { ACTION_AlarmOr1750(true); };
|
||||
|
||||
inline static void ACTION_ScanRestart() { ACTION_Scan(true); };
|
||||
|
||||
void (*action_opt_table[])(void) = {
|
||||
void (*const action_opt_table[])(void) = {
|
||||
[ACTION_OPT_NONE] = &FUNCTION_NOP,
|
||||
[ACTION_OPT_POWER] = &ACTION_Power,
|
||||
[ACTION_OPT_MONITOR] = &ACTION_Monitor,
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ static KEY_Code_t gScreenSaverWakeKey = KEY_INVALID;
|
||||
static void ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
|
||||
|
||||
|
||||
void (*ProcessKeysFunctions[])(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) = {
|
||||
void (*const ProcessKeysFunctions[])(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) = {
|
||||
[DISPLAY_MAIN] = &MAIN_ProcessKeys,
|
||||
[DISPLAY_MENU] = &MENU_ProcessKeys,
|
||||
[DISPLAY_SCANNER] = &SCANNER_ProcessKeys,
|
||||
|
||||
+2
-2
@@ -73,7 +73,7 @@ static uint16_t blacklistFreqs[15];
|
||||
static uint8_t blacklistFreqsIdx;
|
||||
#endif
|
||||
|
||||
const char *bwOptions[] = {"25", "12.5", "6.25"};
|
||||
const char *const bwOptions[] = {"25", "12.5", "6.25"};
|
||||
const uint8_t modulationTypeTuneSteps[] = {100, 50, 10};
|
||||
const uint8_t modTypeReg47Values[] = {1, 7, 5};
|
||||
|
||||
@@ -176,7 +176,7 @@ char freqInputString[11];
|
||||
uint8_t menuState = 0;
|
||||
uint16_t listenT = 0;
|
||||
|
||||
RegisterSpec registerSpecs[] = {
|
||||
const RegisterSpec registerSpecs[] = {
|
||||
{},
|
||||
{"LNAs", BK4819_REG_13, 8, 0b11, 1},
|
||||
{"LNA", BK4819_REG_13, 5, 0b111, 1},
|
||||
|
||||
+1
-1
@@ -260,7 +260,7 @@ void ST7565_FillScreen(uint8_t value)
|
||||
// D=0, display OFF
|
||||
#define ST7565_CMD_DISPLAY_ON_OFF 0xAE
|
||||
|
||||
uint8_t cmds[] = {
|
||||
const uint8_t cmds[] = {
|
||||
ST7565_CMD_BIAS_SELECT | 0, // Select bias setting: 1/9
|
||||
ST7565_CMD_COM_DIRECTION | (0 << 3), // Set output direction of COM: normal
|
||||
ST7565_CMD_SEG_DIRECTION | 1, // Set scan direction of SEG: reverse
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ static void UI_MAIN_DrawBeamLine(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *VfoStateStr[] = {
|
||||
const char *const VfoStateStr[] = {
|
||||
[VFO_STATE_NORMAL]="",
|
||||
[VFO_STATE_BUSY]="BUSY",
|
||||
[VFO_STATE_BAT_LOW]="BAT LOW",
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ bool gAskToSave;
|
||||
bool gAskToDelete;
|
||||
|
||||
|
||||
void (*UI_DisplayFunctions[])(void) = {
|
||||
void (*const UI_DisplayFunctions[])(void) = {
|
||||
[DISPLAY_MAIN] = &UI_DisplayMain,
|
||||
[DISPLAY_MENU] = &UI_DisplayMenu,
|
||||
[DISPLAY_SCANNER] = &UI_DisplayScanner,
|
||||
|
||||
Reference in new issue
Block a user