Renamed dodgy var name to proper name.

This commit is contained in:
Dual Tachyon 2023-10-28 00:09:22 +01:00
parent 0e14ef4e26
commit 6dd7492782

View File

@ -27,6 +27,12 @@
#include "ui/inputbox.h" #include "ui/inputbox.h"
#include "ui/main.h" #include "ui/main.h"
enum {
LEVEL_MODE_OFF = 0,
LEVEL_MODE_TX,
LEVEL_MODE_RSSI,
};
void UI_DisplayMain(void) void UI_DisplayMain(void)
{ {
char String[16]; char String[16];
@ -127,12 +133,12 @@ void UI_DisplayMain(void)
} }
// 0x8EE2 // 0x8EE2
uint32_t SomeValue = 0; uint32_t LevelMode = LEVEL_MODE_OFF;
if (gCurrentFunction == FUNCTION_TRANSMIT) { if (gCurrentFunction == FUNCTION_TRANSMIT) {
#if defined(ENABLE_ALARM) #if defined(ENABLE_ALARM)
if (gAlarmState == ALARM_STATE_ALARM) { if (gAlarmState == ALARM_STATE_ALARM) {
SomeValue = 2; LevelMode = LEVEL_MODE_RSSI;
} else { } else {
#else #else
if (1) { if (1) {
@ -143,12 +149,12 @@ void UI_DisplayMain(void)
Channel = gEeprom.TX_VFO; Channel = gEeprom.TX_VFO;
} }
if (Channel == i) { if (Channel == i) {
SomeValue = 1; LevelMode = LEVEL_MODE_TX;
memcpy(pLine0 + 14, BITMAP_TX, sizeof(BITMAP_TX)); memcpy(pLine0 + 14, BITMAP_TX, sizeof(BITMAP_TX));
} }
} }
} else { } else {
SomeValue = 2; LevelMode = LEVEL_MODE_RSSI;
if ((gCurrentFunction == FUNCTION_RECEIVE || gCurrentFunction == FUNCTION_MONITOR) && gEeprom.RX_VFO == i) { if ((gCurrentFunction == FUNCTION_RECEIVE || gCurrentFunction == FUNCTION_MONITOR) && gEeprom.RX_VFO == i) {
memcpy(pLine0 + 14, BITMAP_RX, sizeof(BITMAP_RX)); memcpy(pLine0 + 14, BITMAP_RX, sizeof(BITMAP_RX));
} }
@ -273,15 +279,15 @@ void UI_DisplayMain(void)
// 0x926E // 0x926E
uint8_t Level = 0; uint8_t Level = 0;
if (SomeValue == 1) { if (LevelMode == LEVEL_MODE_TX) {
if (gRxVfo->OUTPUT_POWER == OUTPUT_POWER_LOW) { if (gRxVfo->OUTPUT_POWER == OUTPUT_POWER_LOW) {
Level = 2; Level = 2;
} else if (gRxVfo->OUTPUT_POWER == OUTPUT_POWER_MID) { } else if (gRxVfo->OUTPUT_POWER == OUTPUT_POWER_MID) {
Level = 4; Level = 4;
} else { } else {
Level = 6; Level = 6;
} }
} else if (SomeValue == 2) { } else if (LevelMode == LEVEL_MODE_RSSI) {
if (gVFO_RSSI_Level[i]) { if (gVFO_RSSI_Level[i]) {
Level = gVFO_RSSI_Level[i]; Level = gVFO_RSSI_Level[i];
} }
@ -314,7 +320,7 @@ void UI_DisplayMain(void)
} else { } else {
const FREQ_Config_t *pConfig; const FREQ_Config_t *pConfig;
if (SomeValue == 1) { if (LevelMode == LEVEL_MODE_TX) {
pConfig = gEeprom.VfoInfo[i].pTX; pConfig = gEeprom.VfoInfo[i].pTX;
} else { } else {
pConfig = gEeprom.VfoInfo[i].pRX; pConfig = gEeprom.VfoInfo[i].pRX;