Add RESET_CHANNEL option

This commit is contained in:
Armel FAUVEAU
2024-10-28 05:39:43 +01:00
parent 08aa97aafa
commit 5400728a5f
3 changed files with 18 additions and 9 deletions

View File

@@ -47,6 +47,7 @@ ENABLE_FEAT_F4HWN_RX_TX_TIMER ?= 1
ENABLE_FEAT_F4HWN_CHARGING_C ?= 1
ENABLE_FEAT_F4HWN_SLEEP ?= 1
ENABLE_FEAT_F4HWN_RESTORE_SCAN ?= 1
ENABLE_FEAT_F4HWN_RESET_CHANNEL ?= 0
ENABLE_FEAT_F4HWN_PMR ?= 0
ENABLE_FEAT_F4HWN_GMRS_FRS_MURS ?= 0
ENABLE_FEAT_F4HWN_CA ?= 1
@@ -426,6 +427,9 @@ endif
ifeq ($(ENABLE_FEAT_F4HWN_RESTORE_SCAN),1)
CFLAGS += -DENABLE_FEAT_F4HWN_RESTORE_SCAN
endif
ifeq ($(ENABLE_FEAT_F4HWN_RESET_CHANNEL),1)
CFLAGS += -DENABLE_FEAT_F4HWN_RESET_CHANNEL
endif
ifeq ($(ENABLE_FEAT_F4HWN_PMR),1)
CFLAGS += -DENABLE_FEAT_F4HWN_PMR
endif

View File

@@ -24,6 +24,7 @@ ENABLE_VOX=0 \
ENABLE_AIRCOPY=0 \
ENABLE_AUDIO_BAR=0 \
ENABLE_FEAT_F4HWN_SPECTRUM=0 \
ENABLE_FEAT_F4HWN_SLEEP=1 \
ENABLE_NOAA=0 \
ENABLE_FEAT_F4HWN_RESTORE_SCAN=0 \
TARGET=f4hwn.voxless \

View File

@@ -27,6 +27,7 @@
#include "settings.h"
#include "ui/menu.h"
#ifdef ENABLE_FEAT_F4HWN_RESET_CHANNEL
static const uint32_t gDefaultFrequencyTable[] =
{
14500000, //
@@ -35,6 +36,7 @@ static const uint32_t gDefaultFrequencyTable[] =
43320000, //
43350000 //
};
#endif
EEPROM_Config_t gEeprom = { 0 };
@@ -499,15 +501,17 @@ void SETTINGS_FactoryReset(bool bIsAll)
{
RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_FIRST + BAND6_400MHz, 43350000);
// set the first few memory channels
for (i = 0; i < ARRAY_SIZE(gDefaultFrequencyTable); i++)
{
const uint32_t Frequency = gDefaultFrequencyTable[i];
gRxVfo->freq_config_RX.Frequency = Frequency;
gRxVfo->freq_config_TX.Frequency = Frequency;
gRxVfo->Band = FREQUENCY_GetBand(Frequency);
SETTINGS_SaveChannel(MR_CHANNEL_FIRST + i, 0, gRxVfo, 2);
}
#ifdef ENABLE_FEAT_F4HWN_RESET_CHANNEL
// set the first few memory channels
for (i = 0; i < ARRAY_SIZE(gDefaultFrequencyTable); i++)
{
const uint32_t Frequency = gDefaultFrequencyTable[i];
gRxVfo->freq_config_RX.Frequency = Frequency;
gRxVfo->freq_config_TX.Frequency = Frequency;
gRxVfo->Band = FREQUENCY_GetBand(Frequency);
SETTINGS_SaveChannel(MR_CHANNEL_FIRST + i, 0, gRxVfo, 2);
}
#endif
#ifdef ENABLE_FEAT_F4HWN
EEPROM_WriteBuffer(0x1FF0, Template);