Merge remote-tracking branch 'remotes/OneOfEleven/main'
This commit is contained in:
22
app/app.c
22
app/app.c
@@ -1711,16 +1711,22 @@ void APP_TimeSlice500ms(void)
|
||||
|
||||
if (gDTMF_RX_live_timeout > 0)
|
||||
{
|
||||
if (--gDTMF_RX_live_timeout == 0)
|
||||
#ifdef ENABLE_RSSI_BAR
|
||||
if (center_line == CENTER_LINE_DTMF_DEC ||
|
||||
center_line == CENTER_LINE_NONE) // wait till the center line is free for us to use before timing out
|
||||
#endif
|
||||
{
|
||||
if (gDTMF_RX_live[0] != 0)
|
||||
if (--gDTMF_RX_live_timeout == 0)
|
||||
{
|
||||
memset(gDTMF_RX_live, 0, sizeof(gDTMF_RX_live));
|
||||
gUpdateDisplay = true;
|
||||
if (gDTMF_RX_live[0] != 0)
|
||||
{
|
||||
memset(gDTMF_RX_live, 0, sizeof(gDTMF_RX_live));
|
||||
gUpdateDisplay = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (gDTMF_RX_timeout > 0)
|
||||
if (--gDTMF_RX_timeout == 0)
|
||||
DTMF_clear_RX();
|
||||
@@ -1973,9 +1979,9 @@ void APP_TimeSlice500ms(void)
|
||||
gCurrentFunction != FUNCTION_TRANSMIT &&
|
||||
gCurrentFunction != FUNCTION_RECEIVE)
|
||||
{
|
||||
if (gDTMF_AUTO_RESET_TIME > 0)
|
||||
if (gDTMF_auto_reset_time_500ms > 0)
|
||||
{
|
||||
if (--gDTMF_AUTO_RESET_TIME == 0)
|
||||
if (--gDTMF_auto_reset_time_500ms == 0)
|
||||
{
|
||||
gDTMF_CallState = DTMF_CALL_STATE_NONE;
|
||||
gUpdateDisplay = true;
|
||||
@@ -2463,7 +2469,7 @@ Skip:
|
||||
|
||||
RADIO_SetupRegisters(true);
|
||||
|
||||
gDTMF_AUTO_RESET_TIME = 0;
|
||||
gDTMF_auto_reset_time_500ms = 0;
|
||||
gDTMF_CallState = DTMF_CALL_STATE_NONE;
|
||||
gDTMF_TxStopCountdown_500ms = 0;
|
||||
gDTMF_IsTx = false;
|
||||
|
@@ -54,8 +54,8 @@ char gDTMF_Caller[4];
|
||||
char gDTMF_Callee[4];
|
||||
DTMF_State_t gDTMF_State;
|
||||
uint8_t gDTMF_DecodeRingCountdown_500ms;
|
||||
uint8_t gDTMFChosenContact;
|
||||
uint8_t gDTMF_AUTO_RESET_TIME;
|
||||
uint8_t gDTMF_chosen_contact;
|
||||
uint8_t gDTMF_auto_reset_time_500ms;
|
||||
DTMF_CallState_t gDTMF_CallState;
|
||||
DTMF_ReplyState_t gDTMF_ReplyState;
|
||||
DTMF_CallMode_t gDTMF_CallMode;
|
||||
@@ -403,13 +403,12 @@ void DTMF_Reply(void)
|
||||
if (pString == NULL)
|
||||
return;
|
||||
|
||||
Delay = gEeprom.DTMF_PRELOAD_TIME;
|
||||
Delay = (gEeprom.DTMF_PRELOAD_TIME < 200) ? 200 : gEeprom.DTMF_PRELOAD_TIME;
|
||||
|
||||
if (gEeprom.DTMF_SIDE_TONE)
|
||||
{ // the will also hear the transmitted tones
|
||||
{ // the user will also hear the transmitted tones
|
||||
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
|
||||
gEnableSpeaker = true;
|
||||
Delay = (gEeprom.DTMF_PRELOAD_TIME < 60) ? 60 : gEeprom.DTMF_PRELOAD_TIME;
|
||||
}
|
||||
|
||||
SYSTEM_DelayMs(Delay);
|
||||
|
@@ -83,8 +83,8 @@ extern char gDTMF_Caller[4];
|
||||
extern char gDTMF_Callee[4];
|
||||
extern DTMF_State_t gDTMF_State;
|
||||
extern uint8_t gDTMF_DecodeRingCountdown_500ms;
|
||||
extern uint8_t gDTMFChosenContact;
|
||||
extern uint8_t gDTMF_AUTO_RESET_TIME;
|
||||
extern uint8_t gDTMF_chosen_contact;
|
||||
extern uint8_t gDTMF_auto_reset_time_500ms;
|
||||
extern DTMF_CallState_t gDTMF_CallState;
|
||||
extern DTMF_ReplyState_t gDTMF_ReplyState;
|
||||
extern DTMF_CallMode_t gDTMF_CallMode;
|
||||
|
39
app/menu.c
39
app/menu.c
@@ -51,7 +51,7 @@
|
||||
void writeXtalFreqCal(const int32_t value, const bool update_eeprom)
|
||||
{
|
||||
BK4819_WriteRegister(BK4819_REG_3B, 22656 + value);
|
||||
|
||||
|
||||
if (update_eeprom)
|
||||
{
|
||||
struct
|
||||
@@ -62,9 +62,9 @@
|
||||
uint8_t VOLUME_GAIN;
|
||||
uint8_t DAC_GAIN;
|
||||
} __attribute__((packed)) misc;
|
||||
|
||||
|
||||
gEeprom.BK4819_XTAL_FREQ_LOW = value;
|
||||
|
||||
|
||||
// radio 1 .. 04 00 46 00 50 00 2C 0E
|
||||
// radio 2 .. 05 00 46 00 50 00 2C 0E
|
||||
//
|
||||
@@ -431,7 +431,7 @@ void MENU_AcceptSetting(void)
|
||||
|
||||
BK4819_SetCTCSSFrequency(CTCSS_Options[Code]);
|
||||
}
|
||||
|
||||
|
||||
gRequestSaveChannel = 1;
|
||||
return;
|
||||
|
||||
@@ -630,7 +630,7 @@ void MENU_AcceptSetting(void)
|
||||
break;
|
||||
|
||||
case MENU_D_HOLD:
|
||||
gEeprom.DTMF_AUTO_RESET_TIME = gSubMenuSelection;
|
||||
gEeprom.DTMF_auto_reset_time = gSubMenuSelection;
|
||||
break;
|
||||
|
||||
case MENU_D_PRE:
|
||||
@@ -663,7 +663,7 @@ void MENU_AcceptSetting(void)
|
||||
break;
|
||||
|
||||
case MENU_D_LIST:
|
||||
gDTMFChosenContact = gSubMenuSelection - 1;
|
||||
gDTMF_chosen_contact = gSubMenuSelection - 1;
|
||||
if (gIsDtmfContactValid)
|
||||
{
|
||||
GUI_SelectNextDisplay(DISPLAY_MAIN);
|
||||
@@ -758,19 +758,24 @@ void MENU_AcceptSetting(void)
|
||||
#endif
|
||||
|
||||
case MENU_BATCAL:
|
||||
gBatteryCalibration[0] = 520*gSubMenuSelection/760; //5.2V empty, blinking above this value, reduced functionality below
|
||||
gBatteryCalibration[1] = 700*gSubMenuSelection/760; // 7V, ~5%, 1 bars above this value
|
||||
gBatteryCalibration[2] = 745*gSubMenuSelection/760; // 7.45V, ~17%, 2 bars above this value
|
||||
gBatteryCalibration[3] = gSubMenuSelection; // 7.6V, ~29%, 3 bars above this value
|
||||
gBatteryCalibration[4] = 788*gSubMenuSelection/760; // 7.88V, ~65% 4 bars above this value
|
||||
{
|
||||
uint16_t buf[4];
|
||||
|
||||
gBatteryCalibration[0] = (520ul * gSubMenuSelection) / 760; // 5.20V empty, blinking above this value, reduced functionality below
|
||||
gBatteryCalibration[1] = (700ul * gSubMenuSelection) / 760; // 7.00V, ~5%, 1 bars above this value
|
||||
gBatteryCalibration[2] = (745ul * gSubMenuSelection) / 760; // 7.45V, ~17%, 2 bars above this value
|
||||
gBatteryCalibration[3] = gSubMenuSelection; // 7.6V, ~29%, 3 bars above this value
|
||||
gBatteryCalibration[4] = (788ul * gSubMenuSelection) / 760; // 7.88V, ~65%, 4 bars above this value
|
||||
gBatteryCalibration[5] = 2300;
|
||||
EEPROM_WriteBuffer(0x1F40, gBatteryCalibration);
|
||||
uint16_t buf[4];
|
||||
EEPROM_ReadBuffer(0x1F48, buf, sizeof(buf));
|
||||
|
||||
EEPROM_ReadBuffer( 0x1F48, buf, sizeof(buf));
|
||||
buf[0] = gBatteryCalibration[4];
|
||||
buf[1] = gBatteryCalibration[5];
|
||||
EEPROM_WriteBuffer(0x1F48, buf);
|
||||
EEPROM_WriteBuffer(0x1F48, buf);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gRequestSaveSettings = true;
|
||||
@@ -932,7 +937,7 @@ void MENU_ShowCurrentSetting(void)
|
||||
gSubMenuSelection = gEeprom.VOX_SWITCH ? gEeprom.VOX_LEVEL + 1 : 0;
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
||||
case MENU_ABR:
|
||||
gSubMenuSelection = gEeprom.BACKLIGHT;
|
||||
|
||||
@@ -1039,7 +1044,7 @@ void MENU_ShowCurrentSetting(void)
|
||||
break;
|
||||
|
||||
case MENU_D_HOLD:
|
||||
gSubMenuSelection = gEeprom.DTMF_AUTO_RESET_TIME;
|
||||
gSubMenuSelection = gEeprom.DTMF_auto_reset_time;
|
||||
break;
|
||||
|
||||
case MENU_D_PRE:
|
||||
@@ -1059,7 +1064,7 @@ void MENU_ShowCurrentSetting(void)
|
||||
break;
|
||||
|
||||
case MENU_D_LIST:
|
||||
gSubMenuSelection = gDTMFChosenContact + 1;
|
||||
gSubMenuSelection = gDTMF_chosen_contact + 1;
|
||||
break;
|
||||
|
||||
case MENU_D_LIVE_DEC:
|
||||
|
@@ -125,18 +125,14 @@ typedef struct SpectrumSettings {
|
||||
uint32_t frequencyChangeStep;
|
||||
StepsCount stepsCount;
|
||||
ScanStep scanStepIndex;
|
||||
|
||||
uint16_t scanDelay;
|
||||
uint16_t rssiTriggerLevel;
|
||||
|
||||
|
||||
BK4819_FilterBandwidth_t bw;
|
||||
BK4819_FilterBandwidth_t listenBw;
|
||||
int dbMin;
|
||||
int dbMax;
|
||||
ModulationType modulationType;
|
||||
bool backlightState;
|
||||
uint8_t _pad[2];
|
||||
} SpectrumSettings;
|
||||
|
||||
typedef struct KeyboardState {
|
||||
@@ -151,7 +147,6 @@ typedef struct ScanInfo {
|
||||
uint32_t f, fPeak;
|
||||
uint16_t scanStep;
|
||||
uint8_t measurementsCount;
|
||||
uint8_t _pad[1];
|
||||
} ScanInfo;
|
||||
|
||||
typedef struct RegisterSpec {
|
||||
@@ -160,7 +155,6 @@ typedef struct RegisterSpec {
|
||||
uint8_t offset;
|
||||
uint16_t maxValue;
|
||||
uint16_t inc;
|
||||
uint8_t _pad[2];
|
||||
} RegisterSpec;
|
||||
|
||||
typedef struct PeakInfo {
|
||||
@@ -168,7 +162,6 @@ typedef struct PeakInfo {
|
||||
uint16_t rssi;
|
||||
uint32_t f;
|
||||
uint8_t i;
|
||||
uint8_t _pad[3];
|
||||
} PeakInfo;
|
||||
|
||||
void APP_RunSpectrum(void);
|
||||
|
Reference in New Issue
Block a user