mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 22:31:25 +03:00
added ENABLE_FM_DEV_CAL_MENU option to enable FM deviation calibration
This commit is contained in:
parent
277b7fb4a4
commit
c21f4a7987
4
Makefile
4
Makefile
@ -51,6 +51,7 @@ ENABLE_WIDE_RX := 1
|
|||||||
ENABLE_TX_WHEN_AM := 0
|
ENABLE_TX_WHEN_AM := 0
|
||||||
# Freq calibration 188 B
|
# Freq calibration 188 B
|
||||||
ENABLE_F_CAL_MENU := 0
|
ENABLE_F_CAL_MENU := 0
|
||||||
|
ENABLE_FM_DEV_CAL_MENU := 1
|
||||||
ENABLE_TX_UNLOCK_MENU := 0
|
ENABLE_TX_UNLOCK_MENU := 0
|
||||||
#ENABLE_TX_POWER_CAL_MENU := 0
|
#ENABLE_TX_POWER_CAL_MENU := 0
|
||||||
ENABLE_TX_POWER_FIX := 1
|
ENABLE_TX_POWER_FIX := 1
|
||||||
@ -392,6 +393,9 @@ endif
|
|||||||
ifeq ($(ENABLE_F_CAL_MENU),1)
|
ifeq ($(ENABLE_F_CAL_MENU),1)
|
||||||
CFLAGS += -DENABLE_F_CAL_MENU
|
CFLAGS += -DENABLE_F_CAL_MENU
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(ENABLE_FM_DEV_CAL_MENU),1)
|
||||||
|
CFLAGS += -DENABLE_FM_DEV_CAL_MENU
|
||||||
|
endif
|
||||||
ifeq ($(ENABLE_TX_UNLOCK_MENU),1)
|
ifeq ($(ENABLE_TX_UNLOCK_MENU),1)
|
||||||
CFLAGS += -DENABLE_TX_UNLOCK_MENU
|
CFLAGS += -DENABLE_TX_UNLOCK_MENU
|
||||||
endif
|
endif
|
||||||
|
@ -71,6 +71,7 @@ ENABLE_TRIM_TRAILING_ZEROS := 1 trim away any trailing zeros on freq
|
|||||||
ENABLE_WIDE_RX := 1 full 18MHz to 1300MHz RX (though front-end/PA not designed for full range)
|
ENABLE_WIDE_RX := 1 full 18MHz to 1300MHz RX (though front-end/PA not designed for full range)
|
||||||
ENABLE_TX_WHEN_AM := 0 allow TX (always FM) when RX is set to AM
|
ENABLE_TX_WHEN_AM := 0 allow TX (always FM) when RX is set to AM
|
||||||
ENABLE_F_CAL_MENU := 0 enable frequency calibration hidden menu
|
ENABLE_F_CAL_MENU := 0 enable frequency calibration hidden menu
|
||||||
|
ENABLE_FM_DEV_CAL_MENU := 0 enable FM deviation calibration hidden menu
|
||||||
ENABLE_TX_UNLOCK_MENU := 0 allow TX everywhere EXCEPT airband (108~137) .. TX harmonic content will cause interference to other services, do so entirely at your own risk !
|
ENABLE_TX_UNLOCK_MENU := 0 allow TX everywhere EXCEPT airband (108~137) .. TX harmonic content will cause interference to other services, do so entirely at your own risk !
|
||||||
ENABLE_TX_POWER_CAL_MENU := 0 used to compute the TX power register values .. leave at '0'
|
ENABLE_TX_POWER_CAL_MENU := 0 used to compute the TX power register values .. leave at '0'
|
||||||
ENABLE_TX_POWER_FIX := 1 fix the TX output power, L ~ 10mW, M ~ 500mW, H ~ 4W, U ~ user settable
|
ENABLE_TX_POWER_FIX := 1 fix the TX output power, L ~ 10mW, M ~ 500mW, H ~ 4W, U ~ user settable
|
||||||
|
46
app/menu.c
46
app/menu.c
@ -373,6 +373,18 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_FM_DEV_CAL_MENU
|
||||||
|
case MENU_TX_FM_DEV_CAL_N:
|
||||||
|
*pMin = FM_DEV_LIMIT_LOWER_NARROW;
|
||||||
|
*pMax = FM_DEV_LIMIT_UPPER_NARROW;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MENU_TX_FM_DEV_CAL_W:
|
||||||
|
*pMin = FM_DEV_LIMIT_LOWER_WIDE;
|
||||||
|
*pMax = FM_DEV_LIMIT_UPPER_WIDE;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_F_CAL_MENU
|
#ifdef ENABLE_F_CAL_MENU
|
||||||
case MENU_F_CALI:
|
case MENU_F_CALI:
|
||||||
*pMin = -50;
|
*pMin = -50;
|
||||||
@ -910,6 +922,26 @@ void MENU_AcceptSetting(void)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_FM_DEV_CAL_MENU
|
||||||
|
case MENU_TX_FM_DEV_CAL_N:
|
||||||
|
g_eeprom.calib.deviation_narrow = g_sub_menu_selection;
|
||||||
|
{
|
||||||
|
uint16_t index = (uint16_t)(((uint8_t *)&g_eeprom.calib.deviation_narrow) - ((uint8_t *)&g_eeprom));
|
||||||
|
index &= ~7u;
|
||||||
|
EEPROM_WriteBuffer8(index, &g_eeprom.calib.deviation_narrow);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MENU_TX_FM_DEV_CAL_W:
|
||||||
|
g_eeprom.calib.deviation_wide = g_sub_menu_selection;
|
||||||
|
{
|
||||||
|
uint16_t index = (uint16_t)(((uint8_t *)&g_eeprom.calib.deviation_wide) - ((uint8_t *)&g_eeprom));
|
||||||
|
index &= ~7u;
|
||||||
|
EEPROM_WriteBuffer8(index, &g_eeprom.calib.deviation_wide);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_F_CAL_MENU
|
#ifdef ENABLE_F_CAL_MENU
|
||||||
case MENU_F_CALI:
|
case MENU_F_CALI:
|
||||||
writeXtalFreqCal(g_sub_menu_selection, true);
|
writeXtalFreqCal(g_sub_menu_selection, true);
|
||||||
@ -1389,6 +1421,16 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_FM_DEV_CAL_MENU
|
||||||
|
case MENU_TX_FM_DEV_CAL_N:
|
||||||
|
g_sub_menu_selection = g_eeprom.calib.deviation_narrow;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MENU_TX_FM_DEV_CAL_W:
|
||||||
|
g_sub_menu_selection = g_eeprom.calib.deviation_wide;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_F_CAL_MENU
|
#ifdef ENABLE_F_CAL_MENU
|
||||||
case MENU_F_CALI:
|
case MENU_F_CALI:
|
||||||
g_sub_menu_selection = g_eeprom.calib.bk4819_xtal_freq_low;
|
g_sub_menu_selection = g_eeprom.calib.bk4819_xtal_freq_low;
|
||||||
@ -1536,7 +1578,11 @@ static void MENU_Key_0_to_9(key_code_t Key, bool key_pressed, bool key_held)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_FM_DEV_CAL_MENU
|
||||||
|
if (g_menu_cursor == MENU_BAT_CAL || g_menu_cursor == MENU_TX_FM_DEV_CAL_N || g_menu_cursor == MENU_TX_FM_DEV_CAL_W)
|
||||||
|
#else
|
||||||
if (g_menu_cursor == MENU_BAT_CAL)
|
if (g_menu_cursor == MENU_BAT_CAL)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
g_sub_menu_selection = INPUTBOX_value(); // get the current value from the input box
|
g_sub_menu_selection = INPUTBOX_value(); // get the current value from the input box
|
||||||
|
|
||||||
|
@ -404,10 +404,10 @@ void BK4819_EnableVox(uint16_t VoxEnableThreshold, uint16_t VoxDisableThreshold)
|
|||||||
BK4819_write_reg(0x31, BK4819_read_reg(0x31) | (1u << 2));
|
BK4819_write_reg(0x31, BK4819_read_reg(0x31) | (1u << 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BK4819_set_TX_deviation(const bool narrow)
|
void BK4819_set_TX_deviation(uint16_t deviation)
|
||||||
{
|
{
|
||||||
// const uint8_t scrambler = (BK4819_read_reg(0x31) >> 1) & 1u;
|
// const uint8_t scrambler = (BK4819_read_reg(0x31) >> 1) & 1u;
|
||||||
uint16_t deviation = narrow ? 900 : 1232;
|
// uint16_t deviation = narrow ? 900 : 1232;
|
||||||
// if (scrambler)
|
// if (scrambler)
|
||||||
// deviation -= 200;
|
// deviation -= 200;
|
||||||
if (deviation > 4095)
|
if (deviation > 4095)
|
||||||
|
@ -79,7 +79,7 @@ void BK4819_set_CTCSS_freq(const uint32_t control_word);
|
|||||||
void BK4819_set_tail_detection(const uint32_t freq_10Hz);
|
void BK4819_set_tail_detection(const uint32_t freq_10Hz);
|
||||||
void BK4819_EnableVox(uint16_t Vox1Threshold, uint16_t Vox0Threshold);
|
void BK4819_EnableVox(uint16_t Vox1Threshold, uint16_t Vox0Threshold);
|
||||||
|
|
||||||
void BK4819_set_TX_deviation(const bool narrow);
|
void BK4819_set_TX_deviation(uint16_t deviation);
|
||||||
|
|
||||||
void BK4819_SetFilterBandwidth(const BK4819_filter_bandwidth_t Bandwidth);
|
void BK4819_SetFilterBandwidth(const BK4819_filter_bandwidth_t Bandwidth);
|
||||||
|
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
50
radio.c
50
radio.c
@ -413,8 +413,8 @@ void RADIO_configure_channel(const unsigned int VFO, const unsigned int configur
|
|||||||
uint16_t threshold_enable;
|
uint16_t threshold_enable;
|
||||||
uint16_t threshold_disable;
|
uint16_t threshold_disable;
|
||||||
|
|
||||||
if (level > (ARRAY_SIZE(g_eeprom.calib.vox[0].threshold) - 1))
|
if (level > (ARRAY_SIZE(g_eeprom.calib.vox_threshold_enable) - 1))
|
||||||
level = ARRAY_SIZE(g_eeprom.calib.vox[0].threshold) - 1;
|
level = ARRAY_SIZE(g_eeprom.calib.vox_threshold_enable) - 1;
|
||||||
|
|
||||||
// my eeprom values ..
|
// my eeprom values ..
|
||||||
//
|
//
|
||||||
@ -423,11 +423,11 @@ void RADIO_configure_channel(const unsigned int VFO, const unsigned int configur
|
|||||||
//
|
//
|
||||||
#ifdef ENABLE_VOX_MORE_SENSITIVE
|
#ifdef ENABLE_VOX_MORE_SENSITIVE
|
||||||
// more sensitive
|
// more sensitive
|
||||||
threshold_enable = g_eeprom.calib.vox[0].threshold[level] / 3;
|
threshold_enable = g_eeprom.calib.vox_threshold_enable[level] / 3;
|
||||||
threshold_disable = (threshold_enable > 13) ? threshold_enable - 10 : 3;
|
threshold_disable = (threshold_enable > 13) ? threshold_enable - 10 : 3;
|
||||||
#else
|
#else
|
||||||
threshold_enable = g_eeprom.calib.vox[0].threshold[level];
|
threshold_enable = g_eeprom.calib.vox_threshold_enable[level];
|
||||||
threshold_disable = g_eeprom.calib.vox[1].threshold[level];
|
threshold_disable = g_eeprom.calib.vox_threshold_disable[level];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BK4819_EnableVox(threshold_enable, threshold_disable);
|
BK4819_EnableVox(threshold_enable, threshold_disable);
|
||||||
@ -688,6 +688,8 @@ void RADIO_select_vfos(void)
|
|||||||
|
|
||||||
BK4819_filter_bandwidth_t RADIO_set_bandwidth(BK4819_filter_bandwidth_t bandwidth, const int mode)
|
BK4819_filter_bandwidth_t RADIO_set_bandwidth(BK4819_filter_bandwidth_t bandwidth, const int mode)
|
||||||
{
|
{
|
||||||
|
uint16_t deviation;
|
||||||
|
|
||||||
switch (bandwidth)
|
switch (bandwidth)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
@ -719,6 +721,44 @@ BK4819_filter_bandwidth_t RADIO_set_bandwidth(BK4819_filter_bandwidth_t bandwidt
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_FM_DEV_CAL_MENU
|
||||||
|
switch (bandwidth)
|
||||||
|
{
|
||||||
|
case BK4819_FILTER_BW_WIDE:
|
||||||
|
if (g_eeprom.calib.deviation_wide < FM_DEV_LIMIT_LOWER_WIDE || g_eeprom.calib.deviation_wide > FM_DEV_LIMIT_UPPER_WIDE)
|
||||||
|
deviation = FM_DEV_LIMIT_DEFAULT_WIDE;
|
||||||
|
else
|
||||||
|
deviation = g_eeprom.calib.deviation_wide;
|
||||||
|
break;
|
||||||
|
case BK4819_FILTER_BW_NARROW:
|
||||||
|
if (g_eeprom.calib.deviation_narrow < FM_DEV_LIMIT_LOWER_NARROW || g_eeprom.calib.deviation_narrow > FM_DEV_LIMIT_UPPER_NARROW)
|
||||||
|
deviation = FM_DEV_LIMIT_DEFAULT_NARROW;
|
||||||
|
else
|
||||||
|
deviation = g_eeprom.calib.deviation_narrow;
|
||||||
|
break;
|
||||||
|
case BK4819_FILTER_BW_NARROWER:
|
||||||
|
if (g_eeprom.calib.deviation_narrow < FM_DEV_LIMIT_LOWER_NARROW || g_eeprom.calib.deviation_narrow > FM_DEV_LIMIT_UPPER_NARROW)
|
||||||
|
deviation = FM_DEV_LIMIT_DEFAULT_NARROW;
|
||||||
|
else
|
||||||
|
deviation = g_eeprom.calib.deviation_narrow;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
switch (bandwidth)
|
||||||
|
{
|
||||||
|
case BK4819_FILTER_BW_WIDE:
|
||||||
|
deviation = g_eeprom.calib.deviation_wide;
|
||||||
|
break;
|
||||||
|
case BK4819_FILTER_BW_NARROW:
|
||||||
|
deviation = g_eeprom.calib.deviation_narrow;
|
||||||
|
break;
|
||||||
|
case BK4819_FILTER_BW_NARROWER:
|
||||||
|
deviation = g_eeprom.calib.deviation_narrow;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
BK4819_set_TX_deviation(deviation);
|
||||||
|
|
||||||
BK4819_SetFilterBandwidth(bandwidth);
|
BK4819_SetFilterBandwidth(bandwidth);
|
||||||
|
|
||||||
return bandwidth;
|
return bandwidth;
|
||||||
|
22
settings.c
22
settings.c
@ -52,8 +52,9 @@ void SETTINGS_write_eeprom_config(void)
|
|||||||
|
|
||||||
void SETTINGS_write_eeprom_calib(void)
|
void SETTINGS_write_eeprom_calib(void)
|
||||||
{ // save the entire EEPROM calibration contents
|
{ // save the entire EEPROM calibration contents
|
||||||
const unsigned int index = (unsigned int)(((uint8_t *)&g_eeprom.calib) - ((uint8_t *)&g_eeprom));
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
unsigned int index = (unsigned int)(((uint8_t *)&g_eeprom.calib) - ((uint8_t *)&g_eeprom));
|
||||||
|
index &= ~7u;
|
||||||
for (i = 0; i < sizeof(g_eeprom.calib); i += 8)
|
for (i = 0; i < sizeof(g_eeprom.calib); i += 8)
|
||||||
EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom.calib) + i);
|
EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom.calib) + i);
|
||||||
}
|
}
|
||||||
@ -65,9 +66,11 @@ void SETTINGS_write_eeprom_calib(void)
|
|||||||
unsigned int index;
|
unsigned int index;
|
||||||
|
|
||||||
index = (unsigned int)(((uint8_t *)&g_eeprom.config.setting.fm_radio) - ((uint8_t *)&g_eeprom));
|
index = (unsigned int)(((uint8_t *)&g_eeprom.config.setting.fm_radio) - ((uint8_t *)&g_eeprom));
|
||||||
|
index &= ~7u;
|
||||||
EEPROM_WriteBuffer8(index, &g_eeprom.config.setting.fm_radio);
|
EEPROM_WriteBuffer8(index, &g_eeprom.config.setting.fm_radio);
|
||||||
|
|
||||||
index = (unsigned int)(((uint8_t *)&g_eeprom.config.setting.fm_channel) - ((uint8_t *)&g_eeprom));
|
index = (unsigned int)(((uint8_t *)&g_eeprom.config.setting.fm_channel) - ((uint8_t *)&g_eeprom));
|
||||||
|
index &= ~7u;
|
||||||
for (i = 0; i < sizeof(g_eeprom.config.setting.fm_channel); i += 8)
|
for (i = 0; i < sizeof(g_eeprom.config.setting.fm_channel); i += 8)
|
||||||
EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom.config.setting.fm_channel) + i);
|
EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom.config.setting.fm_channel) + i);
|
||||||
}
|
}
|
||||||
@ -75,14 +78,16 @@ void SETTINGS_write_eeprom_calib(void)
|
|||||||
|
|
||||||
void SETTINGS_save_vfo_indices(void)
|
void SETTINGS_save_vfo_indices(void)
|
||||||
{
|
{
|
||||||
const uint16_t index = (uint16_t)(((uint8_t *)&g_eeprom.config.setting.indices) - ((uint8_t *)&g_eeprom));
|
uint16_t index = (uint16_t)(((uint8_t *)&g_eeprom.config.setting.indices) - ((uint8_t *)&g_eeprom));
|
||||||
|
index &= ~7u;
|
||||||
EEPROM_WriteBuffer8(index, &g_eeprom.config.setting.indices);
|
EEPROM_WriteBuffer8(index, &g_eeprom.config.setting.indices);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SETTINGS_save_attributes(void)
|
void SETTINGS_save_attributes(void)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
const unsigned int index = (unsigned int )(((uint8_t *)&g_eeprom.config.channel_attributes) - ((uint8_t *)&g_eeprom));
|
unsigned int index = (unsigned int )(((uint8_t *)&g_eeprom.config.channel_attributes) - ((uint8_t *)&g_eeprom));
|
||||||
|
index &= ~7u;
|
||||||
for (i = 0; i < sizeof(g_eeprom.config.channel_attributes); i += 8)
|
for (i = 0; i < sizeof(g_eeprom.config.channel_attributes); i += 8)
|
||||||
EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom.config.channel_attributes) + i);
|
EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom.config.channel_attributes) + i);
|
||||||
}
|
}
|
||||||
@ -90,7 +95,8 @@ void SETTINGS_save_attributes(void)
|
|||||||
void SETTINGS_save_channel_names(void)
|
void SETTINGS_save_channel_names(void)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
const unsigned int index = (unsigned int)(((uint8_t *)&g_eeprom.config.channel_name) - ((uint8_t *)&g_eeprom));
|
unsigned int index = (unsigned int)(((uint8_t *)&g_eeprom.config.channel_name) - ((uint8_t *)&g_eeprom));
|
||||||
|
index &= ~7u;
|
||||||
for (i = 0; i < sizeof(g_eeprom.config.channel_name); i += 8)
|
for (i = 0; i < sizeof(g_eeprom.config.channel_name); i += 8)
|
||||||
EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom.config.channel_name) + i);
|
EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom.config.channel_name) + i);
|
||||||
}
|
}
|
||||||
@ -116,6 +122,7 @@ void SETTINGS_read_eeprom(void)
|
|||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
// channel sanity checks ..
|
// channel sanity checks ..
|
||||||
|
|
||||||
for (index = 0; index < ARRAY_SIZE(g_eeprom.config.channel); index++)
|
for (index = 0; index < ARRAY_SIZE(g_eeprom.config.channel); index++)
|
||||||
{
|
{
|
||||||
// if (g_eeprom.config.channel_attributes[index].band <= BAND7_470MHz)
|
// if (g_eeprom.config.channel_attributes[index].band <= BAND7_470MHz)
|
||||||
@ -392,6 +399,13 @@ void SETTINGS_read_eeprom(void)
|
|||||||
|
|
||||||
// memset(&g_eeprom.calib.unused3, 0xff, sizeof(g_eeprom.calib.unused3));
|
// memset(&g_eeprom.calib.unused3, 0xff, sizeof(g_eeprom.calib.unused3));
|
||||||
|
|
||||||
|
// #ifdef ENABLE_FM_DEV_CAL_MENU
|
||||||
|
if (g_eeprom.calib.deviation_narrow < FM_DEV_LIMIT_LOWER_NARROW || g_eeprom.calib.deviation_narrow > FM_DEV_LIMIT_UPPER_NARROW)
|
||||||
|
g_eeprom.calib.deviation_narrow = FM_DEV_LIMIT_DEFAULT_NARROW;
|
||||||
|
if (g_eeprom.calib.deviation_wide < FM_DEV_LIMIT_LOWER_WIDE || g_eeprom.calib.deviation_wide > FM_DEV_LIMIT_UPPER_WIDE)
|
||||||
|
g_eeprom.calib.deviation_wide = FM_DEV_LIMIT_DEFAULT_WIDE;
|
||||||
|
// #endif
|
||||||
|
|
||||||
if (g_eeprom.calib.battery[0] >= 5000)
|
if (g_eeprom.calib.battery[0] >= 5000)
|
||||||
{
|
{
|
||||||
g_eeprom.calib.battery[0] = 1900;
|
g_eeprom.calib.battery[0] = 1900;
|
||||||
|
25
settings.h
25
settings.h
@ -24,6 +24,16 @@
|
|||||||
#include "dcs.h"
|
#include "dcs.h"
|
||||||
#include "frequencies.h"
|
#include "frequencies.h"
|
||||||
|
|
||||||
|
enum {
|
||||||
|
FM_DEV_LIMIT_LOWER_NARROW = 700,
|
||||||
|
FM_DEV_LIMIT_DEFAULT_NARROW = 900,
|
||||||
|
FM_DEV_LIMIT_UPPER_NARROW = 1100,
|
||||||
|
|
||||||
|
FM_DEV_LIMIT_LOWER_WIDE = 950,
|
||||||
|
FM_DEV_LIMIT_DEFAULT_WIDE = 1250,
|
||||||
|
FM_DEV_LIMIT_UPPER_WIDE = 1500
|
||||||
|
};
|
||||||
|
|
||||||
enum mod_mode_e {
|
enum mod_mode_e {
|
||||||
MOD_MODE_FM = 0,
|
MOD_MODE_FM = 0,
|
||||||
MOD_MODE_AM,
|
MOD_MODE_AM,
|
||||||
@ -518,10 +528,19 @@ typedef struct {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// 0x1F50
|
// 0x1F50
|
||||||
struct {
|
uint16_t vox_threshold_enable[10]; //
|
||||||
uint16_t threshold[10]; //
|
|
||||||
uint8_t unused[4]; // 0xff's
|
uint8_t unused[4]; // 0xff's
|
||||||
} __attribute__((packed)) vox[2];
|
|
||||||
|
// 0x1F68
|
||||||
|
uint16_t vox_threshold_disable[10]; //
|
||||||
|
// #ifdef ENABLE_FM_DEV_CAL_MENU
|
||||||
|
// 1of11
|
||||||
|
uint16_t deviation_narrow; //
|
||||||
|
uint16_t deviation_wide; //
|
||||||
|
// #else
|
||||||
|
// // QS
|
||||||
|
// uint8_t unused[4]; // 0xff's
|
||||||
|
// #endif
|
||||||
|
|
||||||
// 0x1F80
|
// 0x1F80
|
||||||
uint8_t mic_gain_dB2[5]; //
|
uint8_t mic_gain_dB2[5]; //
|
||||||
|
26
ui/menu.c
26
ui/menu.c
@ -163,8 +163,13 @@ const t_menu_item g_menu_list[] =
|
|||||||
{"TX CAL", VOICE_ID_INVALID, MENU_TX_CALI, }, // L/M/H TX power calibration
|
{"TX CAL", VOICE_ID_INVALID, MENU_TX_CALI, }, // L/M/H TX power calibration
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_FM_DEV_CAL_MENU
|
||||||
|
{"FN CAL", VOICE_ID_INVALID, MENU_TX_FM_DEV_CAL_N, }, // narrow FM deviation calibration
|
||||||
|
{"FW CAL", VOICE_ID_INVALID, MENU_TX_FM_DEV_CAL_W, }, // wide FM deviation calibration
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_F_CAL_MENU
|
#ifdef ENABLE_F_CAL_MENU
|
||||||
{"F CAL", VOICE_ID_INVALID, MENU_F_CALI }, // reference xtal calibration
|
{"FR CAL", VOICE_ID_INVALID, MENU_F_CALI }, // reference xtal calibration
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{"F LOCK", VOICE_ID_INVALID, MENU_FREQ_LOCK }, // country/area specific
|
{"F LOCK", VOICE_ID_INVALID, MENU_FREQ_LOCK }, // country/area specific
|
||||||
@ -180,8 +185,8 @@ const t_menu_item g_menu_list[] =
|
|||||||
// ************************************
|
// ************************************
|
||||||
};
|
};
|
||||||
|
|
||||||
// number of hidden menu items at the end of the list - KEEP THIS CORRECT
|
// number of hidden menu items at the end of the list - KEEP THIS CORRECT !
|
||||||
const unsigned int g_hidden_menu_count = 9;
|
const unsigned int g_hidden_menu_count = 12;
|
||||||
|
|
||||||
// ***************************************************************************************
|
// ***************************************************************************************
|
||||||
|
|
||||||
@ -441,6 +446,10 @@ void UI_SortMenu(const bool hide_hidden)
|
|||||||
hidden_menu_count--;
|
hidden_menu_count--;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ENABLE_FM_DEV_CAL_MENU
|
||||||
|
hidden_menu_count -= 2;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef ENABLE_F_CAL_MENU
|
#ifndef ENABLE_F_CAL_MENU
|
||||||
hidden_menu_count--;
|
hidden_menu_count--;
|
||||||
#endif
|
#endif
|
||||||
@ -1233,6 +1242,17 @@ void UI_DisplayMenu(void)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_FM_DEV_CAL_MENU
|
||||||
|
case MENU_TX_FM_DEV_CAL_N: // narrow FM deviation calibration
|
||||||
|
case MENU_TX_FM_DEV_CAL_W: // wide FM deviation calibration
|
||||||
|
strcpy(str, "FM DEV ");
|
||||||
|
strcat(str, (g_menu_cursor == MENU_TX_FM_DEV_CAL_N) ? "N\n" : "W\n");
|
||||||
|
sprintf(str + strlen(str), g_in_sub_menu ? "> %04d" : "%d", g_sub_menu_selection);
|
||||||
|
if (g_current_function == FUNCTION_TRANSMIT)
|
||||||
|
BK4819_set_TX_deviation(g_sub_menu_selection);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_F_CAL_MENU
|
#ifdef ENABLE_F_CAL_MENU
|
||||||
case MENU_F_CALI:
|
case MENU_F_CALI:
|
||||||
{
|
{
|
||||||
|
@ -155,6 +155,11 @@ enum
|
|||||||
MENU_TX_CALI, // L/M/H TX power calibration
|
MENU_TX_CALI, // L/M/H TX power calibration
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_FM_DEV_CAL_MENU
|
||||||
|
MENU_TX_FM_DEV_CAL_N, // narrow FM deviation calibration
|
||||||
|
MENU_TX_FM_DEV_CAL_W, // wide FM deviation calibration
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_F_CAL_MENU
|
#ifdef ENABLE_F_CAL_MENU
|
||||||
MENU_F_CALI, // 26MHz reference xtal calibration
|
MENU_F_CALI, // 26MHz reference xtal calibration
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user