mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-29 23:01:26 +03:00
fix up/dn frequency tx offset bug
This commit is contained in:
parent
ab0c37290f
commit
2a7dbc1e73
16
app/fm.c
16
app/fm.c
@ -80,12 +80,12 @@ int FM_ConfigureChannelState(void)
|
|||||||
{
|
{
|
||||||
g_eeprom.fm_frequency_playing = g_eeprom.fm_selected_frequency;
|
g_eeprom.fm_frequency_playing = g_eeprom.fm_selected_frequency;
|
||||||
|
|
||||||
if (g_eeprom.fm_is_channel_mode)
|
if (g_eeprom.fm_channel_mode)
|
||||||
{
|
{
|
||||||
const uint8_t Channel = FM_FindNextChannel(g_eeprom.fm_selected_channel, FM_CHANNEL_UP);
|
const uint8_t Channel = FM_FindNextChannel(g_eeprom.fm_selected_channel, FM_CHANNEL_UP);
|
||||||
if (Channel == 0xFF)
|
if (Channel == 0xFF)
|
||||||
{
|
{
|
||||||
g_eeprom.fm_is_channel_mode = false;
|
g_eeprom.fm_channel_mode = false;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ void FM_PlayAndUpdate(void)
|
|||||||
|
|
||||||
if (g_fm_auto_scan)
|
if (g_fm_auto_scan)
|
||||||
{
|
{
|
||||||
g_eeprom.fm_is_channel_mode = true;
|
g_eeprom.fm_channel_mode = true;
|
||||||
g_eeprom.fm_selected_channel = 0;
|
g_eeprom.fm_selected_channel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ static void FM_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
|
|||||||
if (g_fm_scan_state != FM_SCAN_OFF)
|
if (g_fm_scan_state != FM_SCAN_OFF)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
State = g_eeprom.fm_is_channel_mode ? STATE_USER_MODE : STATE_FREQ_MODE;
|
State = g_eeprom.fm_channel_mode ? STATE_USER_MODE : STATE_FREQ_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
INPUTBOX_append(Key);
|
INPUTBOX_append(Key);
|
||||||
@ -368,7 +368,7 @@ static void FM_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_3:
|
case KEY_3:
|
||||||
g_eeprom.fm_is_channel_mode = !g_eeprom.fm_is_channel_mode;
|
g_eeprom.fm_channel_mode = !g_eeprom.fm_channel_mode;
|
||||||
|
|
||||||
if (!FM_ConfigureChannelState())
|
if (!FM_ConfigureChannelState())
|
||||||
{
|
{
|
||||||
@ -478,7 +478,7 @@ static void FM_Key_MENU(bool key_pressed, bool key_held)
|
|||||||
if (g_fm_scan_state == FM_SCAN_OFF)
|
if (g_fm_scan_state == FM_SCAN_OFF)
|
||||||
{ // not scanning
|
{ // not scanning
|
||||||
|
|
||||||
if (!g_eeprom.fm_is_channel_mode)
|
if (!g_eeprom.fm_channel_mode)
|
||||||
{ // frequency mode
|
{ // frequency mode
|
||||||
|
|
||||||
if (g_ask_to_save)
|
if (g_ask_to_save)
|
||||||
@ -578,7 +578,7 @@ static void FM_Key_UP_DOWN(bool key_pressed, bool key_held, int8_t Step)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_eeprom.fm_is_channel_mode)
|
if (g_eeprom.fm_channel_mode)
|
||||||
{ // we're in channel mode
|
{ // we're in channel mode
|
||||||
const uint8_t Channel = FM_FindNextChannel(g_eeprom.fm_selected_channel + Step, Step);
|
const uint8_t Channel = FM_FindNextChannel(g_eeprom.fm_selected_channel + Step, Step);
|
||||||
if (Channel == 0xFF || g_eeprom.fm_selected_channel == Channel)
|
if (Channel == 0xFF || g_eeprom.fm_selected_channel == Channel)
|
||||||
@ -659,7 +659,7 @@ void FM_Play(void)
|
|||||||
g_fm_play_count_down_10ms = 0;
|
g_fm_play_count_down_10ms = 0;
|
||||||
g_fm_found_frequency = true;
|
g_fm_found_frequency = true;
|
||||||
|
|
||||||
if (!g_eeprom.fm_is_channel_mode)
|
if (!g_eeprom.fm_channel_mode)
|
||||||
g_eeprom.fm_selected_frequency = g_eeprom.fm_frequency_playing;
|
g_eeprom.fm_selected_frequency = g_eeprom.fm_frequency_playing;
|
||||||
|
|
||||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
|
||||||
|
13
app/main.c
13
app/main.c
@ -843,9 +843,20 @@ void MAIN_Key_UP_DOWN(bool key_pressed, bool key_held, scan_state_dir_t Directio
|
|||||||
// find the first channel that contains this frequency
|
// find the first channel that contains this frequency
|
||||||
g_tx_vfo->freq_in_channel = BOARD_find_channel(g_tx_vfo->freq_config_rx.frequency);
|
g_tx_vfo->freq_in_channel = BOARD_find_channel(g_tx_vfo->freq_config_rx.frequency);
|
||||||
|
|
||||||
// only update eeprom when the key is released - saves a LOT of wear and tear on the little eeprom
|
|
||||||
SETTINGS_save_channel(g_tx_vfo->channel_save, g_eeprom.tx_vfo, g_tx_vfo, 1);
|
SETTINGS_save_channel(g_tx_vfo->channel_save, g_eeprom.tx_vfo, g_tx_vfo, 1);
|
||||||
|
|
||||||
|
RADIO_ApplyOffset(g_tx_vfo);
|
||||||
|
if (!g_tx_vfo->frequency_reverse)
|
||||||
|
{
|
||||||
|
g_tx_vfo->p_rx = &g_tx_vfo->freq_config_rx;
|
||||||
|
g_tx_vfo->p_tx = &g_tx_vfo->freq_config_tx;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_tx_vfo->p_rx = &g_tx_vfo->freq_config_tx;
|
||||||
|
g_tx_vfo->p_tx = &g_tx_vfo->freq_config_rx;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
|
||||||
// UART_printf("save chan\r\n");
|
// UART_printf("save chan\r\n");
|
||||||
#endif
|
#endif
|
||||||
|
@ -560,7 +560,7 @@ void MENU_AcceptSetting(void)
|
|||||||
g_eeprom.vox_switch = g_sub_menu_selection != 0;
|
g_eeprom.vox_switch = g_sub_menu_selection != 0;
|
||||||
if (g_eeprom.vox_switch)
|
if (g_eeprom.vox_switch)
|
||||||
g_eeprom.vox_level = g_sub_menu_selection - 1;
|
g_eeprom.vox_level = g_sub_menu_selection - 1;
|
||||||
BOARD_EEPROM_LoadCalibration();
|
BOARD_eeprom_loadCalibration();
|
||||||
g_flag_reconfigure_vfos = true;
|
g_flag_reconfigure_vfos = true;
|
||||||
g_update_status = true;
|
g_update_status = true;
|
||||||
break;
|
break;
|
||||||
@ -658,7 +658,7 @@ void MENU_AcceptSetting(void)
|
|||||||
|
|
||||||
case MENU_MIC_GAIN:
|
case MENU_MIC_GAIN:
|
||||||
g_eeprom.mic_sensitivity = g_sub_menu_selection;
|
g_eeprom.mic_sensitivity = g_sub_menu_selection;
|
||||||
BOARD_EEPROM_LoadCalibration();
|
BOARD_eeprom_loadCalibration();
|
||||||
g_flag_reconfigure_vfos = true;
|
g_flag_reconfigure_vfos = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1898,7 +1898,7 @@ static void MENU_Key_UP_DOWN(bool key_pressed, bool key_held, int8_t Direction)
|
|||||||
{
|
{
|
||||||
case MENU_OFFSET:
|
case MENU_OFFSET:
|
||||||
{
|
{
|
||||||
const int32_t max_freq = 100000000;
|
const int32_t max_freq = MAX_TX_OFFSET;
|
||||||
const int32_t step_size = g_tx_vfo->step_freq;
|
const int32_t step_size = g_tx_vfo->step_freq;
|
||||||
int32_t offset = (int32_t)g_sub_menu_selection + (Direction * step_size);
|
int32_t offset = (int32_t)g_sub_menu_selection + (Direction * step_size);
|
||||||
|
|
||||||
|
@ -371,7 +371,7 @@ static void cmd_051D(const uint8_t *pBuffer)
|
|||||||
|
|
||||||
#ifdef INCLUDE_AES
|
#ifdef INCLUDE_AES
|
||||||
if (reload_eeprom)
|
if (reload_eeprom)
|
||||||
BOARD_EEPROM_load();
|
BOARD_eeprom_load();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
27
board.c
27
board.c
@ -517,12 +517,12 @@ void BOARD_Init(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void BOARD_EEPROM_load(void)
|
void BOARD_eeprom_load(void)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
uint8_t Data[16];
|
uint8_t Data[16];
|
||||||
|
|
||||||
memset(Data, 0, sizeof(Data));
|
// memset(Data, 0, sizeof(Data));
|
||||||
|
|
||||||
// 0E70..0E77
|
// 0E70..0E77
|
||||||
EEPROM_ReadBuffer(0x0E70, Data, 8);
|
EEPROM_ReadBuffer(0x0E70, Data, 8);
|
||||||
@ -571,20 +571,15 @@ void BOARD_EEPROM_load(void)
|
|||||||
{ // 0E88..0E8F
|
{ // 0E88..0E8F
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
uint16_t SelectedFrequency;
|
uint16_t freq;
|
||||||
uint8_t SelectedChannel;
|
uint8_t chan;
|
||||||
uint8_t IsMrMode;
|
uint8_t chan_mode;
|
||||||
uint8_t Padding[8];
|
} __attribute__((packed)) fm;
|
||||||
} __attribute__((packed)) FM;
|
|
||||||
|
|
||||||
EEPROM_ReadBuffer(0x0E88, &FM, 8);
|
EEPROM_ReadBuffer(0x0E88, &fm, sizeof(fm));
|
||||||
if (FM.SelectedFrequency < FM_RADIO_BAND.lower || FM.SelectedFrequency > FM_RADIO_BAND.upper)
|
g_eeprom.fm_selected_frequency = (fm.freq >= FM_RADIO_BAND.lower && fm.freq < FM_RADIO_BAND.upper) ? fm.freq : FM_RADIO_BAND.lower;
|
||||||
g_eeprom.fm_selected_frequency = 960;
|
g_eeprom.fm_selected_channel = fm.chan;
|
||||||
else
|
g_eeprom.fm_channel_mode = fm.chan_mode ? true : false;
|
||||||
g_eeprom.fm_selected_frequency = FM.SelectedFrequency;
|
|
||||||
|
|
||||||
g_eeprom.fm_selected_channel = FM.SelectedChannel;
|
|
||||||
g_eeprom.fm_is_channel_mode = (FM.IsMrMode < 2) ? FM.IsMrMode : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 0E40..0E67
|
// 0E40..0E67
|
||||||
@ -794,7 +789,7 @@ void BOARD_EEPROM_load(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void BOARD_EEPROM_LoadCalibration(void)
|
void BOARD_eeprom_loadCalibration(void)
|
||||||
{
|
{
|
||||||
// uint8_t Mic;
|
// uint8_t Mic;
|
||||||
|
|
||||||
|
4
board.h
4
board.h
@ -25,8 +25,8 @@ void BOARD_PORTCON_Init(void);
|
|||||||
void BOARD_ADC_Init(void);
|
void BOARD_ADC_Init(void);
|
||||||
void BOARD_ADC_GetBatteryInfo(uint16_t *pVoltage, uint16_t *pCurrent);
|
void BOARD_ADC_GetBatteryInfo(uint16_t *pVoltage, uint16_t *pCurrent);
|
||||||
void BOARD_Init(void);
|
void BOARD_Init(void);
|
||||||
void BOARD_EEPROM_load(void);
|
void BOARD_eeprom_load(void);
|
||||||
void BOARD_EEPROM_LoadCalibration(void);
|
void BOARD_eeprom_loadCalibration(void);
|
||||||
unsigned int BOARD_find_channel(const uint32_t frequency);
|
unsigned int BOARD_find_channel(const uint32_t frequency);
|
||||||
uint32_t BOARD_fetchChannelFrequency(const int channel);
|
uint32_t BOARD_fetchChannelFrequency(const int channel);
|
||||||
unsigned int BOARD_fetchChannelStepSetting(const int channel);
|
unsigned int BOARD_fetchChannelStepSetting(const int channel);
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
4
main.c
4
main.c
@ -101,9 +101,9 @@ void Main(void)
|
|||||||
|
|
||||||
BOARD_ADC_GetBatteryInfo(&g_usb_current_voltage, &g_usb_current);
|
BOARD_ADC_GetBatteryInfo(&g_usb_current_voltage, &g_usb_current);
|
||||||
|
|
||||||
BOARD_EEPROM_load();
|
BOARD_eeprom_load();
|
||||||
|
|
||||||
BOARD_EEPROM_LoadCalibration();
|
BOARD_eeprom_loadCalibration();
|
||||||
|
|
||||||
RADIO_configure_channel(0, VFO_CONFIGURE_RELOAD);
|
RADIO_configure_channel(0, VFO_CONFIGURE_RELOAD);
|
||||||
RADIO_configure_channel(1, VFO_CONFIGURE_RELOAD);
|
RADIO_configure_channel(1, VFO_CONFIGURE_RELOAD);
|
||||||
|
8
radio.c
8
radio.c
@ -259,11 +259,15 @@ void RADIO_configure_channel(const unsigned int VFO, const unsigned int configur
|
|||||||
EEPROM_ReadBuffer(Base, &m_channel, sizeof(m_channel));
|
EEPROM_ReadBuffer(Base, &m_channel, sizeof(m_channel));
|
||||||
|
|
||||||
p_vfo->freq_config_rx.frequency = m_channel.frequency;
|
p_vfo->freq_config_rx.frequency = m_channel.frequency;
|
||||||
p_vfo->tx_offset_freq = (m_channel.offset < 100000000) ? m_channel.offset : 0;
|
|
||||||
p_vfo->tx_offset_freq_dir = (m_channel.tx_offset_dir <= TX_OFFSET_FREQ_DIR_SUB) ? m_channel.tx_offset_dir : TX_OFFSET_FREQ_DIR_OFF;
|
p_vfo->tx_offset_freq = (m_channel.tx_offset < MAX_TX_OFFSET) ? m_channel.tx_offset : 0;
|
||||||
|
p_vfo->tx_offset_freq_dir = (m_channel.tx_offset_dir < TX_OFFSET_FREQ_DIR_LAST) ? m_channel.tx_offset_dir : TX_OFFSET_FREQ_DIR_OFF;
|
||||||
|
|
||||||
p_vfo->am_mode = m_channel.am_mode;
|
p_vfo->am_mode = m_channel.am_mode;
|
||||||
|
|
||||||
p_vfo->step_setting = (m_channel.step_setting < ARRAY_SIZE(STEP_FREQ_TABLE)) ? m_channel.step_setting : STEP_12_5kHz;
|
p_vfo->step_setting = (m_channel.step_setting < ARRAY_SIZE(STEP_FREQ_TABLE)) ? m_channel.step_setting : STEP_12_5kHz;
|
||||||
p_vfo->step_freq = STEP_FREQ_TABLE[p_vfo->step_setting];
|
p_vfo->step_freq = STEP_FREQ_TABLE[p_vfo->step_setting];
|
||||||
|
|
||||||
p_vfo->scrambling_type = (m_channel.scrambler < ARRAY_SIZE(g_sub_menu_scrambler)) ? m_channel.scrambler : 0;
|
p_vfo->scrambling_type = (m_channel.scrambler < ARRAY_SIZE(g_sub_menu_scrambler)) ? m_channel.scrambler : 0;
|
||||||
|
|
||||||
p_vfo->freq_config_rx.code_type = m_channel.rx_ctcss_cdcss_type;
|
p_vfo->freq_config_rx.code_type = m_channel.rx_ctcss_cdcss_type;
|
||||||
|
119
settings.c
119
settings.c
@ -44,7 +44,7 @@ eeprom_config_t g_eeprom;
|
|||||||
memset(&state, 0xFF, sizeof(state));
|
memset(&state, 0xFF, sizeof(state));
|
||||||
state.channel = g_eeprom.fm_selected_channel;
|
state.channel = g_eeprom.fm_selected_channel;
|
||||||
state.frequency = g_eeprom.fm_selected_frequency;
|
state.frequency = g_eeprom.fm_selected_frequency;
|
||||||
state.is_channel_selected = g_eeprom.fm_is_channel_mode;
|
state.is_channel_selected = g_eeprom.fm_channel_mode;
|
||||||
|
|
||||||
EEPROM_WriteBuffer8(0x0E88, &state);
|
EEPROM_WriteBuffer8(0x0E88, &state);
|
||||||
|
|
||||||
@ -75,121 +75,6 @@ void SETTINGS_save_vfo_indices(void)
|
|||||||
EEPROM_WriteBuffer8(0x0E80, State);
|
EEPROM_WriteBuffer8(0x0E80, State);
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
const uint8_t calib1[] =
|
|
||||||
{ // my first radios calibration data
|
|
||||||
0x0A, 0x4B, 0x53, 0x56, 0x59, 0x5C, 0x5F, 0x62, 0x64, 0x66, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0x05, 0x46, 0x50, 0x53, 0x56, 0x59, 0x5C, 0x5F,
|
|
||||||
0x62, 0x64, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5A, 0x2D, 0x29, 0x26,
|
|
||||||
0x23, 0x20, 0x1D, 0x1A, 0x17, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0x64, 0x30, 0x2D, 0x29, 0x26, 0x23, 0x20, 0x1D, 0x1A, 0x17, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0x5A, 0x14, 0x11, 0x0E, 0x0B, 0x08, 0x03, 0x02,
|
|
||||||
0x02, 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x64, 0x11, 0x0E, 0x0B,
|
|
||||||
0x08, 0x05, 0x05, 0x04, 0x04, 0x04, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0x32, 0x68, 0x6B, 0x6E, 0x6F, 0x72, 0x75, 0x77, 0x79, 0x7B, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0x28, 0x64, 0x67, 0x6A, 0x6C, 0x6E, 0x71, 0x73,
|
|
||||||
0x76, 0x78, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x32, 0x2D, 0x28,
|
|
||||||
0x24, 0x21, 0x1E, 0x1A, 0x17, 0x16, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0x46, 0x37, 0x32, 0x2D, 0x28, 0x25, 0x22, 0x1E, 0x1B, 0x19, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0x5A, 0x19, 0x0F, 0x0A, 0x09, 0x08, 0x07, 0x06,
|
|
||||||
0x05, 0x04, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x64, 0x1E, 0x14, 0x0F,
|
|
||||||
0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0x6E, 0x00, 0x78, 0x00, 0x82, 0x00, 0x8C, 0x00, 0x86, 0x00, 0xAA, 0x00,
|
|
||||||
0xCE, 0x00, 0xF2, 0x00, 0x32, 0x32, 0x32, 0x64, 0x64, 0x64, 0x8C, 0x8C,
|
|
||||||
0x8C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x32, 0x32, 0x32, 0x64,
|
|
||||||
0x64, 0x64, 0x8C, 0x8C, 0x8C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0x5F, 0x5F, 0x5F, 0x69, 0x69, 0x69, 0x91, 0x91, 0x8F, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0x32, 0x32, 0x32, 0x64, 0x64, 0x64, 0x8C, 0x8C,
|
|
||||||
0x8C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5A, 0x5A, 0x5A, 0x64,
|
|
||||||
0x64, 0x64, 0x82, 0x82, 0x82, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0x5A, 0x5A, 0x5A, 0x64, 0x64, 0x64, 0x8F, 0x91, 0x8A, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0x32, 0x32, 0x32, 0x64, 0x64, 0x64, 0x8C, 0x8C,
|
|
||||||
0x8C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDE, 0x04, 0xFA, 0x06,
|
|
||||||
0x45, 0x07, 0x5E, 0x07, 0xC5, 0x07, 0xFC, 0x08, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0x1E, 0x00, 0x32, 0x00, 0x46, 0x00, 0x5A, 0x00, 0x6E, 0x00, 0x82, 0x00,
|
|
||||||
0x96, 0x00, 0xAA, 0x00, 0xC8, 0x00, 0xE6, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||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
|
||||||
{ // my 2nd radios calibration data
|
|
||||||
0x0A, 0x4B, 0x53, 0x56, 0x59, 0x5C, 0x5F, 0x62, 0x64, 0x66, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0x05, 0x46, 0x50, 0x53, 0x56, 0x59, 0x5C, 0x5F,
|
|
||||||
0x62, 0x64, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5A, 0x2D, 0x29, 0x26,
|
|
||||||
0x23, 0x20, 0x1D, 0x1A, 0x17, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0x64, 0x30, 0x2D, 0x29, 0x26, 0x23, 0x20, 0x1D, 0x1A, 0x17, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0x5A, 0x14, 0x11, 0x0E, 0x0B, 0x08, 0x03, 0x02,
|
|
||||||
0x02, 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x64, 0x11, 0x0E, 0x0B,
|
|
||||||
0x08, 0x05, 0x05, 0x04, 0x04, 0x04, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0x32, 0x68, 0x6B, 0x6E, 0x6F, 0x72, 0x75, 0x77, 0x79, 0x7B, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0x28, 0x64, 0x67, 0x6A, 0x6C, 0x6E, 0x71, 0x73,
|
|
||||||
0x76, 0x78, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x32, 0x2D, 0x28,
|
|
||||||
0x24, 0x21, 0x1E, 0x1A, 0x17, 0x16, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0x46, 0x37, 0x32, 0x2D, 0x28, 0x25, 0x22, 0x1E, 0x1B, 0x19, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF,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, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
|
|
||||||
};
|
|
||||||
|
|
||||||
void SETTINGS_restore_calibration(void)
|
|
||||||
{
|
|
||||||
// const uint8_t buf[8] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
|
||||||
unsigned int index = 0;
|
|
||||||
while (index < sizeof(calib2))
|
|
||||||
{
|
|
||||||
const unsigned int addr = 0x1E00 + index;
|
|
||||||
EEPROM_WriteBuffer8(addr, &calib2[index]);
|
|
||||||
// EEPROM_WriteBuffer8(addr, buf);
|
|
||||||
index += 8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// *************************************************
|
|
||||||
|
|
||||||
void SETTINGS_save(void)
|
void SETTINGS_save(void)
|
||||||
{
|
{
|
||||||
uint8_t State[8];
|
uint8_t State[8];
|
||||||
@ -381,7 +266,7 @@ void SETTINGS_save_channel(const unsigned int channel, const unsigned int vfo, c
|
|||||||
{
|
{
|
||||||
memset(&m_channel, 0, sizeof(m_channel));
|
memset(&m_channel, 0, sizeof(m_channel));
|
||||||
m_channel.frequency = p_vfo->freq_config_rx.frequency;
|
m_channel.frequency = p_vfo->freq_config_rx.frequency;
|
||||||
m_channel.offset = p_vfo->tx_offset_freq;
|
m_channel.tx_offset = p_vfo->tx_offset_freq;
|
||||||
m_channel.rx_ctcss_cdcss_code = p_vfo->freq_config_rx.code;
|
m_channel.rx_ctcss_cdcss_code = p_vfo->freq_config_rx.code;
|
||||||
m_channel.tx_ctcss_cdcss_code = p_vfo->freq_config_tx.code;
|
m_channel.tx_ctcss_cdcss_code = p_vfo->freq_config_tx.code;
|
||||||
m_channel.rx_ctcss_cdcss_type = p_vfo->freq_config_rx.code_type;
|
m_channel.rx_ctcss_cdcss_type = p_vfo->freq_config_rx.code_type;
|
||||||
|
10
settings.h
10
settings.h
@ -63,10 +63,12 @@ enum {
|
|||||||
DUAL_WATCH_CHAN_B
|
DUAL_WATCH_CHAN_B
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define MAX_TX_OFFSET 100000000
|
||||||
enum {
|
enum {
|
||||||
TX_OFFSET_FREQ_DIR_OFF = 0,
|
TX_OFFSET_FREQ_DIR_OFF = 0,
|
||||||
TX_OFFSET_FREQ_DIR_ADD,
|
TX_OFFSET_FREQ_DIR_ADD,
|
||||||
TX_OFFSET_FREQ_DIR_SUB
|
TX_OFFSET_FREQ_DIR_SUB,
|
||||||
|
TX_OFFSET_FREQ_DIR_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -137,7 +139,7 @@ typedef struct {
|
|||||||
// [0]
|
// [0]
|
||||||
uint32_t frequency; //
|
uint32_t frequency; //
|
||||||
// [4]
|
// [4]
|
||||||
uint32_t offset; //
|
uint32_t tx_offset; //
|
||||||
// [8]
|
// [8]
|
||||||
uint8_t rx_ctcss_cdcss_code; //
|
uint8_t rx_ctcss_cdcss_code; //
|
||||||
// [9]
|
// [9]
|
||||||
@ -325,7 +327,7 @@ typedef struct {
|
|||||||
uint8_t noaa_channel_b; //
|
uint8_t noaa_channel_b; //
|
||||||
uint8_t fm_selected_frequency; //
|
uint8_t fm_selected_frequency; //
|
||||||
uint8_t fm_selected_channel; //
|
uint8_t fm_selected_channel; //
|
||||||
uint8_t fm_is_channel_mode; //
|
uint8_t fm_channel_mode; //
|
||||||
uint8_t unused5[5]; // 0xff's
|
uint8_t unused5[5]; // 0xff's
|
||||||
|
|
||||||
// 0x0E90
|
// 0x0E90
|
||||||
@ -481,7 +483,7 @@ typedef struct {
|
|||||||
#ifdef ENABLE_FMRADIO
|
#ifdef ENABLE_FMRADIO
|
||||||
uint16_t fm_selected_frequency;
|
uint16_t fm_selected_frequency;
|
||||||
uint8_t fm_selected_channel;
|
uint8_t fm_selected_channel;
|
||||||
bool fm_is_channel_mode;
|
bool fm_channel_mode;
|
||||||
uint16_t fm_frequency_playing;
|
uint16_t fm_frequency_playing;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ void UI_DisplayFM(void)
|
|||||||
|
|
||||||
if (g_fm_scan_state == FM_SCAN_OFF)
|
if (g_fm_scan_state == FM_SCAN_OFF)
|
||||||
{
|
{
|
||||||
if (!g_eeprom.fm_is_channel_mode)
|
if (!g_eeprom.fm_channel_mode)
|
||||||
{
|
{
|
||||||
for (i = 0; i < ARRAY_SIZE(g_fm_channels); i++)
|
for (i = 0; i < ARRAY_SIZE(g_fm_channels); i++)
|
||||||
{
|
{
|
||||||
@ -109,7 +109,7 @@ void UI_DisplayFM(void)
|
|||||||
sprintf(String + strlen(String), " (%u.%u)", freq / 10, freq % 10);
|
sprintf(String + strlen(String), " (%u.%u)", freq / 10, freq % 10);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (g_eeprom.fm_is_channel_mode && g_input_box_index > 0)
|
if (g_eeprom.fm_channel_mode && g_input_box_index > 0)
|
||||||
{ // user is entering a channel number
|
{ // user is entering a channel number
|
||||||
UI_GenerateChannelString(String, g_fm_channel_position, ' ');
|
UI_GenerateChannelString(String, g_fm_channel_position, ' ');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user