Variable rename

This commit is contained in:
OneOfEleven 2023-09-15 12:31:30 +01:00
parent cc36482580
commit dfd7a1f2b4
16 changed files with 181 additions and 166 deletions

View File

@ -44,8 +44,8 @@
VOICE_ID_CTCSS,
VOICE_ID_DCS,
VOICE_ID_CTCSS,
VOICE_ID_FREQUENCY_DIRECTION,
VOICE_ID_OFFSET_FREQUENCY,
VOICE_ID_TX_OFFSET_FREQUENCY_DIRECTION,
VOICE_ID_TX_OFFSET_FREQUENCY,
VOICE_ID_CHANNEL_BANDWIDTH,
VOICE_ID_SCRAMBLER_ON,
VOICE_ID_BUSY_LOCKOUT,
@ -367,13 +367,13 @@ void MENU_AcceptSetting(void)
return;
case MENU_SFT_D:
gTxVfo->FREQUENCY_DEVIATION_SETTING = gSubMenuSelection;
gRequestSaveChannel = 1;
gTxVfo->TX_OFFSET_FREQUENCY_DIRECTION = gSubMenuSelection;
gRequestSaveChannel = 1;
return;
case MENU_OFFSET:
gTxVfo->FREQUENCY_OF_DEVIATION = gSubMenuSelection;
gRequestSaveChannel = 1;
gTxVfo->TX_OFFSET_FREQUENCY = gSubMenuSelection;
gRequestSaveChannel = 1;
return;
case MENU_W_N:
@ -738,11 +738,11 @@ void MENU_ShowCurrentSetting(void)
break;
case MENU_SFT_D:
gSubMenuSelection = gTxVfo->FREQUENCY_DEVIATION_SETTING;
gSubMenuSelection = gTxVfo->TX_OFFSET_FREQUENCY_DIRECTION;
break;
case MENU_OFFSET:
gSubMenuSelection = gTxVfo->FREQUENCY_OF_DEVIATION;
gSubMenuSelection = gTxVfo->TX_OFFSET_FREQUENCY;
break;
case MENU_W_N:

View File

@ -368,16 +368,16 @@ static void CMD_052F(const uint8_t *pBuffer)
{
const CMD_052F_t *pCmd = (const CMD_052F_t *)pBuffer;
gEeprom.DUAL_WATCH = DUAL_WATCH_OFF;
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
gEeprom.RX_CHANNEL = 0;
gEeprom.DTMF_SIDE_TONE = false;
gEeprom.VfoInfo[0].FrequencyReverse = false;
gEeprom.VfoInfo[0].pRX = &gEeprom.VfoInfo[0].ConfigRX;
gEeprom.VfoInfo[0].pTX = &gEeprom.VfoInfo[0].ConfigTX;
gEeprom.VfoInfo[0].FREQUENCY_DEVIATION_SETTING = FREQUENCY_DEVIATION_OFF;
gEeprom.VfoInfo[0].DTMF_PTT_ID_TX_MODE = PTT_ID_OFF;
gEeprom.VfoInfo[0].DTMF_DECODING_ENABLE = false;
gEeprom.DUAL_WATCH = DUAL_WATCH_OFF;
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
gEeprom.RX_CHANNEL = 0;
gEeprom.DTMF_SIDE_TONE = false;
gEeprom.VfoInfo[0].FrequencyReverse = false;
gEeprom.VfoInfo[0].pRX = &gEeprom.VfoInfo[0].ConfigRX;
gEeprom.VfoInfo[0].pTX = &gEeprom.VfoInfo[0].ConfigTX;
gEeprom.VfoInfo[0].TX_OFFSET_FREQUENCY_DIRECTION = TX_OFFSET_FREQUENCY_DIRECTION_OFF;
gEeprom.VfoInfo[0].DTMF_PTT_ID_TX_MODE = PTT_ID_OFF;
gEeprom.VfoInfo[0].DTMF_DECODING_ENABLE = false;
#ifdef ENABLE_NOAA
gIsNoaaMode = false;

158
audio.h
View File

@ -40,90 +40,90 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep);
enum
{
VOICE_ID_CHI_BASE = 0x10U,
VOICE_ID_ENG_BASE = 0x60U,
VOICE_ID_CHI_BASE = 0x10U,
VOICE_ID_ENG_BASE = 0x60U,
};
enum VOICE_ID_t
{
VOICE_ID_0 = 0x00U,
VOICE_ID_1 = 0x01U,
VOICE_ID_2 = 0x02U,
VOICE_ID_3 = 0x03U,
VOICE_ID_4 = 0x04U,
VOICE_ID_5 = 0x05U,
VOICE_ID_6 = 0x06U,
VOICE_ID_7 = 0x07U,
VOICE_ID_8 = 0x08U,
VOICE_ID_9 = 0x09U,
VOICE_ID_10 = 0x0AU,
VOICE_ID_100 = 0x0BU,
VOICE_ID_WELCOME = 0x0CU,
VOICE_ID_LOCK = 0x0DU,
VOICE_ID_UNLOCK = 0x0EU,
VOICE_ID_SCANNING_BEGIN = 0x0FU,
VOICE_ID_SCANNING_STOP = 0x10U,
VOICE_ID_SCRAMBLER_ON = 0x11U,
VOICE_ID_SCRAMBLER_OFF = 0x12U,
VOICE_ID_FUNCTION = 0x13U,
VOICE_ID_CTCSS = 0x14U,
VOICE_ID_DCS = 0x15U,
VOICE_ID_POWER = 0x16U,
VOICE_ID_SAVE_MODE = 0x17U,
VOICE_ID_MEMORY_CHANNEL = 0x18U,
VOICE_ID_DELETE_CHANNEL = 0x19U,
VOICE_ID_FREQUENCY_STEP = 0x1AU,
VOICE_ID_SQUELCH = 0x1BU,
VOICE_ID_TRANSMIT_OVER_TIME = 0x1CU,
VOICE_ID_BACKLIGHT_SELECTION = 0x1DU,
VOICE_ID_VOX = 0x1EU,
VOICE_ID_FREQUENCY_DIRECTION = 0x1FU,
VOICE_ID_OFFSET_FREQUENCY = 0x20U,
VOICE_ID_TRANSMITING_MEMORY = 0x21U,
VOICE_ID_RECEIVING_MEMORY = 0x22U,
VOICE_ID_EMERGENCY_CALL = 0x23U,
VOICE_ID_LOW_VOLTAGE = 0x24U,
VOICE_ID_CHANNEL_MODE = 0x25U,
VOICE_ID_FREQUENCY_MODE = 0x26U,
VOICE_ID_VOICE_PROMPT = 0x27U,
VOICE_ID_BAND_SELECTION = 0x28U,
VOICE_ID_DUAL_STANDBY = 0x29U,
VOICE_ID_CHANNEL_BANDWIDTH = 0x2AU,
VOICE_ID_OPTIONAL_SIGNAL = 0x2BU,
VOICE_ID_MUTE_MODE = 0x2CU,
VOICE_ID_BUSY_LOCKOUT = 0x2DU,
VOICE_ID_BEEP_PROMPT = 0x2EU,
VOICE_ID_ANI_CODE = 0x2FU,
VOICE_ID_INITIALISATION = 0x30U,
VOICE_ID_CONFIRM = 0x31U,
VOICE_ID_CANCEL = 0x32U,
VOICE_ID_ON = 0x33U,
VOICE_ID_OFF = 0x34U,
VOICE_ID_2_TONE = 0x35U,
VOICE_ID_5_TONE = 0x36U,
VOICE_ID_DIGITAL_SIGNAL = 0x37U,
VOICE_ID_REPEATER = 0x38U,
VOICE_ID_MENU = 0x39U,
VOICE_ID_11 = 0x3AU,
VOICE_ID_12 = 0x3BU,
VOICE_ID_13 = 0x3CU,
VOICE_ID_14 = 0x3DU,
VOICE_ID_15 = 0x3EU,
VOICE_ID_16 = 0x3FU,
VOICE_ID_17 = 0x40U,
VOICE_ID_18 = 0x41U,
VOICE_ID_19 = 0x42U,
VOICE_ID_20 = 0x43U,
VOICE_ID_30 = 0x44U,
VOICE_ID_40 = 0x45U,
VOICE_ID_50 = 0x46U,
VOICE_ID_60 = 0x47U,
VOICE_ID_70 = 0x48U,
VOICE_ID_80 = 0x49U,
VOICE_ID_90 = 0x4AU,
VOICE_ID_END = 0x4BU,
VOICE_ID_0 = 0x00U,
VOICE_ID_1 = 0x01U,
VOICE_ID_2 = 0x02U,
VOICE_ID_3 = 0x03U,
VOICE_ID_4 = 0x04U,
VOICE_ID_5 = 0x05U,
VOICE_ID_6 = 0x06U,
VOICE_ID_7 = 0x07U,
VOICE_ID_8 = 0x08U,
VOICE_ID_9 = 0x09U,
VOICE_ID_10 = 0x0AU,
VOICE_ID_100 = 0x0BU,
VOICE_ID_WELCOME = 0x0CU,
VOICE_ID_LOCK = 0x0DU,
VOICE_ID_UNLOCK = 0x0EU,
VOICE_ID_SCANNING_BEGIN = 0x0FU,
VOICE_ID_SCANNING_STOP = 0x10U,
VOICE_ID_SCRAMBLER_ON = 0x11U,
VOICE_ID_SCRAMBLER_OFF = 0x12U,
VOICE_ID_FUNCTION = 0x13U,
VOICE_ID_CTCSS = 0x14U,
VOICE_ID_DCS = 0x15U,
VOICE_ID_POWER = 0x16U,
VOICE_ID_SAVE_MODE = 0x17U,
VOICE_ID_MEMORY_CHANNEL = 0x18U,
VOICE_ID_DELETE_CHANNEL = 0x19U,
VOICE_ID_FREQUENCY_STEP = 0x1AU,
VOICE_ID_SQUELCH = 0x1BU,
VOICE_ID_TRANSMIT_OVER_TIME = 0x1CU,
VOICE_ID_BACKLIGHT_SELECTION = 0x1DU,
VOICE_ID_VOX = 0x1EU,
VOICE_ID_TX_OFFSET_FREQUENCY_DIRECTION = 0x1FU,
VOICE_ID_TX_OFFSET_FREQUENCY = 0x20U,
VOICE_ID_TRANSMITING_MEMORY = 0x21U,
VOICE_ID_RECEIVING_MEMORY = 0x22U,
VOICE_ID_EMERGENCY_CALL = 0x23U,
VOICE_ID_LOW_VOLTAGE = 0x24U,
VOICE_ID_CHANNEL_MODE = 0x25U,
VOICE_ID_FREQUENCY_MODE = 0x26U,
VOICE_ID_VOICE_PROMPT = 0x27U,
VOICE_ID_BAND_SELECTION = 0x28U,
VOICE_ID_DUAL_STANDBY = 0x29U,
VOICE_ID_CHANNEL_BANDWIDTH = 0x2AU,
VOICE_ID_OPTIONAL_SIGNAL = 0x2BU,
VOICE_ID_MUTE_MODE = 0x2CU,
VOICE_ID_BUSY_LOCKOUT = 0x2DU,
VOICE_ID_BEEP_PROMPT = 0x2EU,
VOICE_ID_ANI_CODE = 0x2FU,
VOICE_ID_INITIALISATION = 0x30U,
VOICE_ID_CONFIRM = 0x31U,
VOICE_ID_CANCEL = 0x32U,
VOICE_ID_ON = 0x33U,
VOICE_ID_OFF = 0x34U,
VOICE_ID_2_TONE = 0x35U,
VOICE_ID_5_TONE = 0x36U,
VOICE_ID_DIGITAL_SIGNAL = 0x37U,
VOICE_ID_REPEATER = 0x38U,
VOICE_ID_MENU = 0x39U,
VOICE_ID_11 = 0x3AU,
VOICE_ID_12 = 0x3BU,
VOICE_ID_13 = 0x3CU,
VOICE_ID_14 = 0x3DU,
VOICE_ID_15 = 0x3EU,
VOICE_ID_16 = 0x3FU,
VOICE_ID_17 = 0x40U,
VOICE_ID_18 = 0x41U,
VOICE_ID_19 = 0x42U,
VOICE_ID_20 = 0x43U,
VOICE_ID_30 = 0x44U,
VOICE_ID_40 = 0x45U,
VOICE_ID_50 = 0x46U,
VOICE_ID_60 = 0x47U,
VOICE_ID_70 = 0x48U,
VOICE_ID_80 = 0x49U,
VOICE_ID_90 = 0x4AU,
VOICE_ID_END = 0x4BU,
VOICE_ID_INVALID = 0xFFU,
VOICE_ID_INVALID = 0xFFU,
};
typedef enum VOICE_ID_t VOICE_ID_t;

62
board.c
View File

@ -43,15 +43,27 @@
#include "settings.h"
#include "sram-overlay.h"
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#endif
static const uint32_t gDefaultFrequencyTable[] =
{
14502500,
14552500,
43477500,
43502500,
43697500
14500000, //
14550000, //
43300000, //
43320000, //
43350000 //
};
// BAND1_50MHz
// BAND2_108MHz
// BAND3_136MHz
// BAND4_174MHz
// BAND5_350MHz
// BAND6_400MHz
// BAND7_470MHz
void BOARD_FLASH_Init(void)
{
FLASH_Init(FLASH_READ_MODE_1_CYCLE);
@ -330,16 +342,16 @@ void BOARD_EEPROM_Init(void)
// 0E70..0E77
EEPROM_ReadBuffer(0x0E70, Data, 8);
gEeprom.CHAN_1_CALL = IS_MR_CHANNEL(Data[0]) ? Data[0] : MR_CHANNEL_FIRST;
gEeprom.SQUELCH_LEVEL = (Data[1] < 10) ? Data[1] : 1;
gEeprom.TX_TIMEOUT_TIMER = (Data[2] < 11) ? Data[2] : 1;
gEeprom.CHAN_1_CALL = IS_MR_CHANNEL(Data[0]) ? Data[0] : MR_CHANNEL_FIRST;
gEeprom.SQUELCH_LEVEL = (Data[1] < 10) ? Data[1] : 1;
gEeprom.TX_TIMEOUT_TIMER = (Data[2] < 11) ? Data[2] : 1;
#ifdef ENABLE_NOAA
gEeprom.NOAA_AUTO_SCAN = (Data[3] < 2) ? Data[3] : false;
#endif
gEeprom.KEY_LOCK = (Data[4] < 2) ? Data[4] : false;
gEeprom.VOX_SWITCH = (Data[5] < 2) ? Data[5] : false;
gEeprom.VOX_LEVEL = (Data[6] < 10) ? Data[6] : 1;
gEeprom.MIC_SENSITIVITY = (Data[7] < 5) ? Data[7] : 4;
gEeprom.KEY_LOCK = (Data[4] < 2) ? Data[4] : false;
gEeprom.VOX_SWITCH = (Data[5] < 2) ? Data[5] : false;
gEeprom.VOX_LEVEL = (Data[6] < 10) ? Data[6] : 1;
gEeprom.MIC_SENSITIVITY = (Data[7] < 5) ? Data[7] : 4;
// 0E78..0E7F
EEPROM_ReadBuffer(0x0E78, Data, 8);
@ -348,12 +360,12 @@ void BOARD_EEPROM_Init(void)
#else
gEeprom.CHANNEL_DISPLAY_MODE = (Data[1] < 4) ? Data[1] : MDF_FREQUENCY;
#endif
gEeprom.CROSS_BAND_RX_TX = (Data[2] < 3) ? Data[2] : CROSS_BAND_OFF;
gEeprom.BATTERY_SAVE = (Data[3] < 5) ? Data[3] : 4;
gEeprom.DUAL_WATCH = (Data[4] < 3) ? Data[4] : DUAL_WATCH_CHAN_A;
gEeprom.BACKLIGHT = (Data[5] < 6) ? Data[5] : 4;
gEeprom.TAIL_NOTE_ELIMINATION = (Data[6] < 2) ? Data[6] : false;
gEeprom.VFO_OPEN = (Data[7] < 2) ? Data[7] : true;
gEeprom.CROSS_BAND_RX_TX = (Data[2] < 3) ? Data[2] : CROSS_BAND_OFF;
gEeprom.BATTERY_SAVE = (Data[3] < 5) ? Data[3] : 4;
gEeprom.DUAL_WATCH = (Data[4] < 3) ? Data[4] : DUAL_WATCH_CHAN_A;
gEeprom.BACKLIGHT = (Data[5] < 6) ? Data[5] : 4;
gEeprom.TAIL_NOTE_ELIMINATION = (Data[6] < 2) ? Data[6] : false;
gEeprom.VFO_OPEN = (Data[7] < 2) ? Data[7] : true;
// 0E80..0E87
EEPROM_ReadBuffer(0x0E80, Data, 8);
@ -515,7 +527,7 @@ void BOARD_EEPROM_Init(void)
// 0F30..0F3F
EEPROM_ReadBuffer(0x0F30, gCustomAesKey, sizeof(gCustomAesKey));
bHasCustomAesKey = false;
for (i = 0; i < 4; i++)
for (i = 0; i < ARRAY_SIZE(gCustomAesKey); i++)
{
if (gCustomAesKey[i] != 0xFFFFFFFFu)
{
@ -579,10 +591,11 @@ void BOARD_EEPROM_LoadMoreSettings(void)
void BOARD_FactoryReset(bool bIsAll)
{
uint8_t Template[8];
uint16_t i;
uint8_t Template[8];
memset(Template, 0xFF, sizeof(Template));
for (i = 0x0C80; i < 0x1E00; i += 8)
{
if (
@ -599,15 +612,18 @@ void BOARD_FactoryReset(bool bIsAll)
!(i >= 0x0E40 && i < 0x0E70) && // FM Channels
!(i >= 0x0E88 && i < 0x0E90) // FM settings
))
) {
)
{
EEPROM_WriteBuffer(i, Template);
}
}
if (bIsAll)
{
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_FIRST + 5, 5, 43300000);
for (i = 0; i < 5; i++)
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_FIRST + BAND6_400MHz, BAND6_400MHz, 43350000);
// set the first few memory channels
for (i = 0; i < ARRAY_SIZE(gDefaultFrequencyTable); i++)
{
const uint32_t Frequency = gDefaultFrequencyTable[i];
gRxVfo->ConfigRX.Frequency = Frequency;

BIN
firmware

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -32,7 +32,7 @@ enum FREQUENCY_Band_t
BAND4_174MHz,
BAND5_350MHz,
BAND6_400MHz,
BAND7_470MHz,
BAND7_470MHz
};
typedef enum FREQUENCY_Band_t FREQUENCY_Band_t;

10
misc.h
View File

@ -29,11 +29,11 @@
enum {
MR_CHANNEL_FIRST = 0,
MR_CHANNEL_LAST = 199U,
FREQ_CHANNEL_FIRST = 200U,
FREQ_CHANNEL_LAST = 206U,
NOAA_CHANNEL_FIRST = 207U,
NOAA_CHANNEL_LAST = 216U
MR_CHANNEL_LAST = 199u,
FREQ_CHANNEL_FIRST = 200u,
FREQ_CHANNEL_LAST = 206u,
NOAA_CHANNEL_FIRST = 207u,
NOAA_CHANNEL_LAST = 216u
};
enum {

43
radio.c
View File

@ -128,7 +128,7 @@ void RADIO_InitInfo(VFO_Info_t *pInfo, uint8_t ChannelSave, uint8_t Band, uint32
pInfo->ConfigTX.Frequency = Frequency;
pInfo->pRX = &pInfo->ConfigRX;
pInfo->pTX = &pInfo->ConfigTX;
pInfo->FREQUENCY_OF_DEVIATION = 1000000;
pInfo->TX_OFFSET_FREQUENCY = 1000000;
#ifdef ENABLE_COMPANDER
pInfo->Compander = false;
#endif
@ -155,10 +155,10 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
if (!gSetting_350EN)
{
if (gEeprom.FreqChannel[VFO] == 204)
gEeprom.FreqChannel[VFO] = 205;
gEeprom.FreqChannel[VFO]++;
if (gEeprom.ScreenChannel[VFO] == 204)
gEeprom.ScreenChannel[VFO] = 205;
gEeprom.ScreenChannel[VFO]++;
}
Channel = gEeprom.ScreenChannel[VFO];
@ -250,8 +250,8 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
Tmp = Data[3] & 0x0F;
if (Tmp > 2)
Tmp = 0;
gEeprom.VfoInfo[VFO].FREQUENCY_DEVIATION_SETTING = Tmp;
gEeprom.VfoInfo[VFO].AM_CHANNEL_MODE = !!(Data[3] & 0x10);
gEeprom.VfoInfo[VFO].TX_OFFSET_FREQUENCY_DIRECTION = Tmp;
gEeprom.VfoInfo[VFO].AM_CHANNEL_MODE = !!(Data[3] & 0x10);
Tmp = Data[6];
if (Tmp > STEP_8_33kHz)
@ -321,10 +321,10 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
else
{
const uint8_t d4 = Data[4];
gEeprom.VfoInfo[VFO].FrequencyReverse = !!(d4 & 0x01);
gEeprom.VfoInfo[VFO].CHANNEL_BANDWIDTH = !!(d4 & 0x02);
gEeprom.VfoInfo[VFO].OUTPUT_POWER = (d4 >> 2) & 0x03;
gEeprom.VfoInfo[VFO].BUSY_CHANNEL_LOCK = !!(d4 & 0x10);
gEeprom.VfoInfo[VFO].FrequencyReverse = !!((d4 >> 0) & 1u);
gEeprom.VfoInfo[VFO].CHANNEL_BANDWIDTH = !!((d4 >> 1) & 1u);
gEeprom.VfoInfo[VFO].OUTPUT_POWER = ((d4 >> 2) & 3u);
gEeprom.VfoInfo[VFO].BUSY_CHANNEL_LOCK = !!((d4 >> 4) & 1u);
}
if (Data[5] == 0xFF)
@ -334,8 +334,8 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
}
else
{
gEeprom.VfoInfo[VFO].DTMF_DECODING_ENABLE = !!(Data[5] & 0x01);
gEeprom.VfoInfo[VFO].DTMF_PTT_ID_TX_MODE = (Data[5] >> 1) & 0x03;
gEeprom.VfoInfo[VFO].DTMF_DECODING_ENABLE = !!((Data[5] >> 0) & 1u);
gEeprom.VfoInfo[VFO].DTMF_PTT_ID_TX_MODE = ((Data[5] >> 1) & 3u);
}
struct
@ -348,7 +348,7 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
pRadio->ConfigRX.Frequency = Info.Frequency;
if (Info.Offset >= 100000000)
Info.Offset = 1000000;
gEeprom.VfoInfo[VFO].FREQUENCY_OF_DEVIATION = Info.Offset;
gEeprom.VfoInfo[VFO].TX_OFFSET_FREQUENCY = Info.Offset;
}
Frequency = pRadio->ConfigRX.Frequency;
@ -365,10 +365,10 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
pRadio->ConfigRX.Frequency = Frequency;
if (Frequency >= 10800000 && Frequency < 13600000)
gEeprom.VfoInfo[VFO].FREQUENCY_DEVIATION_SETTING = FREQUENCY_DEVIATION_OFF;
gEeprom.VfoInfo[VFO].TX_OFFSET_FREQUENCY_DIRECTION = TX_OFFSET_FREQUENCY_DIRECTION_OFF;
else
if (!IS_MR_CHANNEL(Channel))
gEeprom.VfoInfo[VFO].FREQUENCY_OF_DEVIATION = FREQUENCY_FloorToStep(gEeprom.VfoInfo[VFO].FREQUENCY_OF_DEVIATION, gEeprom.VfoInfo[VFO].StepFrequency, 0);
gEeprom.VfoInfo[VFO].TX_OFFSET_FREQUENCY = FREQUENCY_FloorToStep(gEeprom.VfoInfo[VFO].TX_OFFSET_FREQUENCY, gEeprom.VfoInfo[VFO].StepFrequency, 0);
RADIO_ApplyOffset(pRadio);
@ -397,8 +397,7 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
pConfig->Frequency = 43300000;
}
// if (gEeprom.VfoInfo[VFO].Band == BAND2_108MHz && gEeprom.VfoInfo[VFO].AM_CHANNEL_MODE)
if (gEeprom.VfoInfo[VFO].AM_CHANNEL_MODE) // allow AM on any frequency
if (gEeprom.VfoInfo[VFO].AM_CHANNEL_MODE)
{
gEeprom.VfoInfo[VFO].IsAM = true;
gEeprom.VfoInfo[VFO].SCRAMBLING_TYPE = 0;
@ -466,15 +465,15 @@ void RADIO_ApplyOffset(VFO_Info_t *pInfo)
{
uint32_t Frequency = pInfo->ConfigRX.Frequency;
switch (pInfo->FREQUENCY_DEVIATION_SETTING)
switch (pInfo->TX_OFFSET_FREQUENCY_DIRECTION)
{
case FREQUENCY_DEVIATION_OFF:
case TX_OFFSET_FREQUENCY_DIRECTION_OFF:
break;
case FREQUENCY_DEVIATION_ADD:
Frequency += pInfo->FREQUENCY_OF_DEVIATION;
case TX_OFFSET_FREQUENCY_DIRECTION_ADD:
Frequency += pInfo->TX_OFFSET_FREQUENCY;
break;
case FREQUENCY_DEVIATION_SUB:
Frequency -= pInfo->FREQUENCY_OF_DEVIATION;
case TX_OFFSET_FREQUENCY_DIRECTION_SUB:
Frequency -= pInfo->TX_OFFSET_FREQUENCY;
break;
}

18
radio.h
View File

@ -23,14 +23,14 @@
#include "dcs.h"
enum {
MR_CH_SCANLIST1 = (1U << 7),
MR_CH_SCANLIST2 = (1U << 6),
MR_CH_BAND_MASK = 0x0FU,
MR_CH_SCANLIST1 = (1u << 7),
MR_CH_SCANLIST2 = (1u << 6),
MR_CH_BAND_MASK = 0x0Fu
};
enum {
RADIO_CHANNEL_UP = 0x01U,
RADIO_CHANNEL_DOWN = 0xFFU,
RADIO_CHANNEL_UP = 0x01u,
RADIO_CHANNEL_DOWN = 0xFFu,
};
enum {
@ -56,7 +56,7 @@ typedef enum PTT_ID_t PTT_ID_t;
STEP_10_0kHz,
STEP_12_5kHz,
STEP_25_0kHz,
STEP_8_33kHz,
STEP_8_33kHz
};
#else
enum STEP_Setting_t
@ -67,7 +67,7 @@ typedef enum PTT_ID_t PTT_ID_t;
STEP_10_0kHz,
STEP_12_5kHz,
STEP_25_0kHz,
STEP_8_33kHz,
STEP_8_33kHz
};
#endif
@ -100,10 +100,10 @@ typedef struct VFO_Info_t
FREQ_Config_t ConfigTX;
FREQ_Config_t *pRX;
FREQ_Config_t *pTX;
uint32_t FREQUENCY_OF_DEVIATION;
uint32_t TX_OFFSET_FREQUENCY;
uint16_t StepFrequency;
uint8_t CHANNEL_SAVE;
uint8_t FREQUENCY_DEVIATION_SETTING;
uint8_t TX_OFFSET_FREQUENCY_DIRECTION;
uint8_t SquelchOpenRSSIThresh;
uint8_t SquelchOpenNoiseThresh;
uint8_t SquelchCloseGlitchThresh;

View File

@ -196,13 +196,13 @@ void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO,
uint8_t State8[8];
State32[0] = pVFO->ConfigRX.Frequency;
State32[1] = pVFO->FREQUENCY_OF_DEVIATION;
State32[1] = pVFO->TX_OFFSET_FREQUENCY;
EEPROM_WriteBuffer(OffsetVFO + 0, State32);
State8[0] = pVFO->ConfigRX.Code;
State8[1] = pVFO->ConfigTX.Code;
State8[2] = (pVFO->ConfigTX.CodeType << 4) | pVFO->ConfigRX.CodeType;
State8[3] = (pVFO->AM_CHANNEL_MODE << 4) | pVFO->FREQUENCY_DEVIATION_SETTING;
State8[3] = (pVFO->AM_CHANNEL_MODE << 4) | pVFO->TX_OFFSET_FREQUENCY_DIRECTION;
State8[4] = 0
| (pVFO->BUSY_CHANNEL_LOCK << 4)
| (pVFO->OUTPUT_POWER << 2)

View File

@ -59,9 +59,9 @@ enum {
};
enum {
FREQUENCY_DEVIATION_OFF = 0,
FREQUENCY_DEVIATION_ADD,
FREQUENCY_DEVIATION_SUB
TX_OFFSET_FREQUENCY_DIRECTION_OFF = 0,
TX_OFFSET_FREQUENCY_DIRECTION_ADD,
TX_OFFSET_FREQUENCY_DIRECTION_SUB
};
enum {

View File

@ -445,9 +445,9 @@ void UI_DisplayMain(void)
if (gEeprom.VfoInfo[vfo_num].ConfigRX.Frequency != gEeprom.VfoInfo[vfo_num].ConfigTX.Frequency)
{ // show the TX offset symbol
if (gEeprom.VfoInfo[vfo_num].FREQUENCY_DEVIATION_SETTING == FREQUENCY_DEVIATION_ADD)
if (gEeprom.VfoInfo[vfo_num].TX_OFFSET_FREQUENCY_DIRECTION == TX_OFFSET_FREQUENCY_DIRECTION_ADD)
memcpy(pLine1 + display_width + 54, BITMAP_Add, sizeof(BITMAP_Add));
if (gEeprom.VfoInfo[vfo_num].FREQUENCY_DEVIATION_SETTING == FREQUENCY_DEVIATION_SUB)
if (gEeprom.VfoInfo[vfo_num].TX_OFFSET_FREQUENCY_DIRECTION == TX_OFFSET_FREQUENCY_DIRECTION_SUB)
memcpy(pLine1 + display_width + 54, BITMAP_Sub, sizeof(BITMAP_Sub));
}

View File

@ -2,7 +2,7 @@
#ifdef GIT_HASH
#define VER GIT_HASH
#else
#define VER "230914"
#define VER "230915"
#endif
const char Version[] = "OEFW-"VER;

View File

@ -13,7 +13,7 @@ del /S /Q *.o >nul 2>nul
del /S /Q *.d >nul 2>nul
::python -m pip install --upgrade pip crcmod
fw-pack.py firmware.bin 230914 firmware.packed.bin
fw-pack.py firmware.bin 230915 firmware.packed.bin
::arm-none-eabi-size firmware