Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Renamed dodgy var name to proper name.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dual Tachyon authored and Dual Tachyon committed Oct 27, 2023
1 parent 0e14ef4 commit 6dd7492
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions ui/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
#include "ui/inputbox.h"
#include "ui/main.h"

enum {
LEVEL_MODE_OFF = 0,
LEVEL_MODE_TX,
LEVEL_MODE_RSSI,
};

void UI_DisplayMain(void)
{
char String[16];
Expand Down Expand Up @@ -127,12 +133,12 @@ void UI_DisplayMain(void)
}

// 0x8EE2
uint32_t SomeValue = 0;
uint32_t LevelMode = LEVEL_MODE_OFF;

if (gCurrentFunction == FUNCTION_TRANSMIT) {
#if defined(ENABLE_ALARM)
if (gAlarmState == ALARM_STATE_ALARM) {
SomeValue = 2;
LevelMode = LEVEL_MODE_RSSI;
} else {
#else
if (1) {
Expand All @@ -143,12 +149,12 @@ void UI_DisplayMain(void)
Channel = gEeprom.TX_VFO;
}
if (Channel == i) {
SomeValue = 1;
LevelMode = LEVEL_MODE_TX;
memcpy(pLine0 + 14, BITMAP_TX, sizeof(BITMAP_TX));
}
}
} else {
SomeValue = 2;
LevelMode = LEVEL_MODE_RSSI;
if ((gCurrentFunction == FUNCTION_RECEIVE || gCurrentFunction == FUNCTION_MONITOR) && gEeprom.RX_VFO == i) {
memcpy(pLine0 + 14, BITMAP_RX, sizeof(BITMAP_RX));
}
Expand Down Expand Up @@ -273,15 +279,15 @@ void UI_DisplayMain(void)
// 0x926E
uint8_t Level = 0;

if (SomeValue == 1) {
if (gRxVfo->OUTPUT_POWER == OUTPUT_POWER_LOW) {
Level = 2;
} else if (gRxVfo->OUTPUT_POWER == OUTPUT_POWER_MID) {
Level = 4;
} else {
Level = 6;
}
} else if (SomeValue == 2) {
if (LevelMode == LEVEL_MODE_TX) {
if (gRxVfo->OUTPUT_POWER == OUTPUT_POWER_LOW) {
Level = 2;
} else if (gRxVfo->OUTPUT_POWER == OUTPUT_POWER_MID) {
Level = 4;
} else {
Level = 6;
}
} else if (LevelMode == LEVEL_MODE_RSSI) {
if (gVFO_RSSI_Level[i]) {
Level = gVFO_RSSI_Level[i];
}
Expand Down Expand Up @@ -314,7 +320,7 @@ void UI_DisplayMain(void)
} else {
const FREQ_Config_t *pConfig;

if (SomeValue == 1) {
if (LevelMode == LEVEL_MODE_TX) {
pConfig = gEeprom.VfoInfo[i].pTX;
} else {
pConfig = gEeprom.VfoInfo[i].pRX;
Expand Down

0 comments on commit 6dd7492

Please sign in to comment.