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

@@ -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);