Skip to content

Commit

Permalink
lots of renames
Browse files Browse the repository at this point in the history
  • Loading branch information
OneOfEleven committed Oct 8, 2023
1 parent 83c3c8c commit 1ab74dc
Show file tree
Hide file tree
Showing 56 changed files with 1,882 additions and 1,879 deletions.
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ ENABLE_LTO := 1
ENABLE_UART := 1
ENABLE_AIRCOPY := 0
ENABLE_FMRADIO := 1
ENABLE_NOAA := 0
ENABLE_NOAA := 1
ENABLE_VOICE := 1
ENABLE_VOX := 1
ENABLE_ALARM := 0
ENABLE_ALARM := 1
ENABLE_TX1750 := 1
ENABLE_PWRON_PASSWORD := 0
ENABLE_PWRON_PASSWORD := 1
ENABLE_BIG_FREQ := 0
ENABLE_SMALL_BOLD := 1
ENABLE_KEEP_MEM_NAME := 1
Expand All @@ -33,8 +33,8 @@ ENABLE_AM_FIX_SHOW_DATA := 1
ENABLE_SQUELCH_MORE_SENSITIVE := 1
ENABLE_FASTER_CHANNEL_SCAN := 1
ENABLE_RSSI_BAR := 1
ENABLE_AUDIO_BAR := 0
ENABLE_SHOW_TX_TIMEOUT := 1
ENABLE_AUDIO_BAR := 0
ENABLE_COPY_CHAN_TO_VFO := 1
#ENABLE_PANADAPTER := 1
#ENABLE_SINGLE_VFO_CHAN := 1
Expand All @@ -53,6 +53,11 @@ ifeq ($(ENABLE_LTO),1)
ENABLE_OVERLAY := 0
endif

ifeq ($(ENABLE_SHOW_TX_TIMEOUT),1)
# can't have ENABLE_SHOW_TX_TIMEOUT and ENABLE_AUDIO_BAR enabled at same time
ENABLE_AUDIO_BAR := 0
endif

BSP_DEFINITIONS := $(wildcard hardware/*/*.def)
BSP_HEADERS := $(patsubst hardware/%,bsp/%,$(BSP_DEFINITIONS))
BSP_HEADERS := $(patsubst %.def,%.h,$(BSP_HEADERS))
Expand Down Expand Up @@ -108,6 +113,9 @@ OBJS += app/generic.o
OBJS += app/main.o
OBJS += app/menu.o
OBJS += app/scanner.o
ifeq ($(ENABLE_PANADAPTER),1)
OBJS += app/spectrum.o
endif
ifeq ($(ENABLE_UART),1)
OBJS += app/uart.o
endif
Expand Down Expand Up @@ -295,8 +303,8 @@ endif
ifeq ($(ENABLE_FASTER_CHANNEL_SCAN),1)
CFLAGS += -DENABLE_FASTER_CHANNEL_SCAN
endif
ifeq ($(ENABLE_BACKLIGHT_ON_RX),1)
CFLAGS += -DENABLE_BACKLIGHT_ON_RX
ifeq ($(ENABLE_backlight_ON_RX),1)
CFLAGS += -DENABLE_backlight_ON_RX
endif
ifeq ($(ENABLE_RSSI_BAR),1)
CFLAGS += -DENABLE_RSSI_BAR
Expand Down
52 changes: 26 additions & 26 deletions app/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ static void ACTION_FlashLight(void)

void ACTION_Power(void)
{
if (++gTxVfo->OUTPUT_POWER > OUTPUT_POWER_HIGH)
gTxVfo->OUTPUT_POWER = OUTPUT_POWER_LOW;
if (++gTxVfo->output_power > OUTPUT_POWER_HIGH)
gTxVfo->output_power = OUTPUT_POWER_LOW;

gRequestSaveChannel = 1;
//gRequestSaveChannel = 2; // auto save the channel

#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_POWER;
g_another_voice_id = VOICE_ID_POWER;
#endif

gRequestDisplayScreen = gScreenToDisplay;
Expand All @@ -74,8 +74,8 @@ void ACTION_Monitor(void)
{ // enable the monitor
RADIO_SelectVfos();
#ifdef ENABLE_NOAA
if (gRxVfo->CHANNEL_SAVE >= NOAA_CHANNEL_FIRST && gIsNoaaMode)
gNoaaChannel = gRxVfo->CHANNEL_SAVE - NOAA_CHANNEL_FIRST;
if (gRxVfo->channel_save >= NOAA_CHANNEL_FIRST && gIsNoaaMode)
gNoaaChannel = gRxVfo->channel_save - NOAA_CHANNEL_FIRST;
#endif
RADIO_SetupRegisters(true);
APP_StartListening(FUNCTION_MONITOR, false);
Expand All @@ -92,7 +92,7 @@ void ACTION_Monitor(void)
}

#ifdef ENABLE_NOAA
if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gIsNoaaMode)
if (g_eeprom.dual_watch == DUAL_WATCH_OFF && gIsNoaaMode)
{
gNOAA_Countdown_10ms = NOAA_countdown_10ms;
gScheduleNOAA = false;
Expand Down Expand Up @@ -130,7 +130,7 @@ void ACTION_Scan(bool bRestart)
FM_PlayAndUpdate();

#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_SCANNING_STOP;
g_another_voice_id = VOICE_ID_SCANNING_STOP;
#endif
}
else
Expand All @@ -142,20 +142,20 @@ void ACTION_Scan(bool bRestart)
gFM_AutoScan = true;
gFM_ChannelPosition = 0;
FM_EraseChannels();
Frequency = gEeprom.FM_LowerLimit;
Frequency = g_eeprom.fm_lower_limit;
}
else
{
gFM_AutoScan = false;
gFM_ChannelPosition = 0;
Frequency = gEeprom.FM_FrequencyPlaying;
Frequency = g_eeprom.fm_frequency_playing;
}

BK1080_GetFrequencyDeviation(Frequency);
FM_Tune(Frequency, 1, bRestart);

#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_SCANNING_BEGIN;
g_another_voice_id = VOICE_ID_SCANNING_BEGIN;
#endif
}
}
Expand All @@ -177,19 +177,19 @@ void ACTION_Scan(bool bRestart)
RADIO_SelectVfos();

#ifdef ENABLE_NOAA
if (IS_NOT_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE))
if (IS_NOT_NOAA_CHANNEL(gRxVfo->channel_save))
#endif
{
GUI_SelectNextDisplay(DISPLAY_MAIN);

if (gScanStateDir != SCAN_OFF)
{ // already scanning

if (gNextMrChannel <= MR_CHANNEL_LAST)
if (gNextChannel <= USER_CHANNEL_LAST)
{ // channel mode

// keep scanning but toggle between scan lists
gEeprom.SCAN_LIST_DEFAULT = (gEeprom.SCAN_LIST_DEFAULT + 1) % 3;
g_eeprom.scan_list_default = (g_eeprom.scan_list_default + 1) % 3;

// jump to the next channel
CHANNEL_Next(true, gScanStateDir);
Expand All @@ -204,7 +204,7 @@ void ACTION_Scan(bool bRestart)
SCANNER_Stop();

#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_SCANNING_STOP;
g_another_voice_id = VOICE_ID_SCANNING_STOP;
#endif
}
}
Expand All @@ -219,7 +219,7 @@ void ACTION_Scan(bool bRestart)
#endif

// clear the other vfo's rssi level (to hide the antenna symbol)
gVFO_RSSI_bar_level[(gEeprom.RX_VFO + 1) & 1u] = 0;
gVFO_RSSI_bar_level[(g_eeprom.rx_vfo + 1) & 1u] = 0;

// let the user see DW is not active
gDualWatchActive = false;
Expand All @@ -229,9 +229,9 @@ void ACTION_Scan(bool bRestart)
}
else
// if (!bRestart)
if (!bRestart && gNextMrChannel <= MR_CHANNEL_LAST)
if (!bRestart && gNextChannel <= USER_CHANNEL_LAST)
{ // channel mode, keep scanning but toggle between scan lists
gEeprom.SCAN_LIST_DEFAULT = (gEeprom.SCAN_LIST_DEFAULT + 1) % 3;
g_eeprom.scan_list_default = (g_eeprom.scan_list_default + 1) % 3;

// jump to the next channel
CHANNEL_Next(true, gScanStateDir);
Expand All @@ -247,7 +247,7 @@ void ACTION_Scan(bool bRestart)
SCANNER_Stop();

#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_SCANNING_STOP;
g_another_voice_id = VOICE_ID_SCANNING_STOP;
#endif

gRequestDisplayScreen = DISPLAY_MAIN;
Expand All @@ -257,11 +257,11 @@ void ACTION_Scan(bool bRestart)
#ifdef ENABLE_VOX
void ACTION_Vox(void)
{
gEeprom.VOX_SWITCH = !gEeprom.VOX_SWITCH;
g_eeprom.vox_switch = !g_eeprom.vox_switch;
gRequestSaveSettings = true;
gFlagReconfigureVfos = true;
#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_VOX;
g_another_voice_id = VOICE_ID_VOX;
#endif
gUpdateStatus = true;
}
Expand Down Expand Up @@ -323,7 +323,7 @@ void ACTION_Scan(bool bRestart)
}
#endif

void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
void ACTION_Handle(key_code_t Key, bool bKeyPressed, bool bKeyHeld)
{
uint8_t Short = ACTION_OPT_NONE;
uint8_t Long = ACTION_OPT_NONE;
Expand All @@ -346,7 +346,7 @@ void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
}

#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_CANCEL;
g_another_voice_id = VOICE_ID_CANCEL;
#endif

gRequestDisplayScreen = DISPLAY_MAIN;
Expand All @@ -359,14 +359,14 @@ void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)

if (Key == KEY_SIDE1)
{
Short = gEeprom.KEY_1_SHORT_PRESS_ACTION;
Long = gEeprom.KEY_1_LONG_PRESS_ACTION;
Short = g_eeprom.key1_short_press_action;
Long = g_eeprom.key1_long_press_action;
}
else
if (Key == KEY_SIDE2)
{
Short = gEeprom.KEY_2_SHORT_PRESS_ACTION;
Long = gEeprom.KEY_2_LONG_PRESS_ACTION;
Short = g_eeprom.key2_short_press_action;
Long = g_eeprom.key2_long_press_action;
}

if (!bKeyHeld && bKeyPressed)
Expand Down
2 changes: 1 addition & 1 deletion app/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void ACTION_Scan(bool bFlag);
void ACTION_FM(void);
#endif

void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
void ACTION_Handle(key_code_t Key, bool bKeyPressed, bool bKeyHeld);

#endif

16 changes: 8 additions & 8 deletions app/aircopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void AIRCOPY_StorePacket(void)
gErrorsDuringAirCopy++;
}

static void AIRCOPY_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
static void AIRCOPY_Key_DIGITS(key_code_t Key, bool bKeyPressed, bool bKeyHeld)
{
if (!bKeyHeld && bKeyPressed)
{
Expand All @@ -125,7 +125,7 @@ static void AIRCOPY_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
if (gInputBoxIndex < 6)
{
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
g_another_voice_id = (voice_id_t)Key;
#endif
return;
}
Expand All @@ -139,13 +139,13 @@ static void AIRCOPY_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
if (Frequency >= frequencyBandTable[i].lower && Frequency < frequencyBandTable[i].upper)
{
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
g_another_voice_id = (voice_id_t)Key;
#endif
gRxVfo->Band = i;
gRxVfo->band = i;
Frequency += 75;
Frequency = FREQUENCY_FloorToStep(Frequency, gRxVfo->StepFrequency, 0);
gRxVfo->freq_config_RX.Frequency = Frequency;
gRxVfo->freq_config_TX.Frequency = Frequency;
Frequency = FREQUENCY_FloorToStep(Frequency, gRxVfo->step_freq, 0);
gRxVfo->freq_config_rx.frequency = Frequency;
gRxVfo->freq_config_tx.frequency = Frequency;
RADIO_ConfigureSquelchAndOutputPower(gRxVfo);
gCurrentVfo = gRxVfo;
RADIO_SetupRegisters(true);
Expand Down Expand Up @@ -202,7 +202,7 @@ static void AIRCOPY_Key_MENU(bool bKeyPressed, bool bKeyHeld)
}
}

void AIRCOPY_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
void AIRCOPY_ProcessKeys(key_code_t Key, bool bKeyPressed, bool bKeyHeld)
{
switch (Key)
{
Expand Down
17 changes: 8 additions & 9 deletions app/aircopy.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,24 @@

#include "driver/keyboard.h"

enum AIRCOPY_State_t
enum aircopy_state_e
{
AIRCOPY_READY = 0,
AIRCOPY_TRANSFER,
AIRCOPY_COMPLETE
};
typedef enum aircopy_state_e aircopy_state_t;

typedef enum AIRCOPY_State_t AIRCOPY_State_t;
extern aircopy_state_t g_aircopy_state;
extern uint16_t g_air_copy_block_number;
extern uint16_t g_errors_during_air_copyy;
extern uint8_t g_air_copy_is_send_mode;

extern AIRCOPY_State_t gAircopyState;
extern uint16_t gAirCopyBlockNumber;
extern uint16_t gErrorsDuringAirCopy;
extern uint8_t gAirCopyIsSendMode;

extern uint16_t g_FSK_Buffer[36];
extern uint16_t g_fsk_buffer[36];

void AIRCOPY_SendMessage(void);
void AIRCOPY_StorePacket(void);
void AIRCOPY_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld);
void AIRCOPY_ProcessKeys(key_code_t Key, bool bKeyPressed, bool bKeyHeld);

#endif

Expand Down
Loading

0 comments on commit 1ab74dc

Please sign in to comment.