Fix EOT blocking issue and EOT is now fixed at 4s

This commit is contained in:
Armel FAUVEAU
2024-02-16 19:50:49 +01:00
parent 3e6c2959ae
commit 04da5ae1dc
4 changed files with 57 additions and 56 deletions

12
audio.c
View File

@@ -46,8 +46,8 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
#endif
#ifdef ENABLE_FEAT_F4HWN
Beep != BEEP_400HZ_30MS &&
Beep != BEEP_500HZ_30MS &&
Beep != BEEP_600HZ_30MS &&
Beep != BEEP_800HZ_30MS &&
#endif
!gEeprom.BEEP_CONTROL)
return;
@@ -108,12 +108,12 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
ToneFrequency = 400;
BK4819_WriteRegister(BK4819_REG_70, BK4819_REG_70_ENABLE_TONE1 | ((1 & 0x7f) << BK4819_REG_70_SHIFT_TONE1_TUNING_GAIN));
break;
case BEEP_600HZ_30MS:
ToneFrequency = 600;
case BEEP_500HZ_30MS:
ToneFrequency = 500;
BK4819_WriteRegister(BK4819_REG_70, BK4819_REG_70_ENABLE_TONE1 | ((1 & 0x7f) << BK4819_REG_70_SHIFT_TONE1_TUNING_GAIN));
break;
case BEEP_800HZ_30MS:
ToneFrequency = 800;
case BEEP_600HZ_30MS:
ToneFrequency = 600;
BK4819_WriteRegister(BK4819_REG_70, BK4819_REG_70_ENABLE_TONE1 | ((1 & 0x7f) << BK4819_REG_70_SHIFT_TONE1_TUNING_GAIN));
break;
#endif
@@ -158,8 +158,8 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
break;
#ifdef ENABLE_FEAT_F4HWN
case BEEP_400HZ_30MS:
case BEEP_500HZ_30MS:
case BEEP_600HZ_30MS:
case BEEP_800HZ_30MS:
BK4819_ExitTxMute();
Duration = 30;
break;

View File

@@ -38,8 +38,8 @@ enum BEEP_Type_t
BEEP_880HZ_40MS_OPTIONAL,
#ifdef ENABLE_FEAT_F4HWN
BEEP_400HZ_30MS,
BEEP_500HZ_30MS,
BEEP_600HZ_30MS,
BEEP_800HZ_30MS,
#endif
BEEP_880HZ_60MS_TRIPLE_BEEP
};

19
misc.c
View File

@@ -44,11 +44,20 @@ const uint16_t key_debounce_10ms = 20 / 10; // 20ms
const uint8_t scan_delay_10ms = 210 / 10; // 210ms
const uint16_t dual_watch_count_after_tx_10ms = 3600 / 10; // 3.6 sec after TX ends
const uint16_t dual_watch_count_after_rx_10ms = 1000 / 10; // 1 sec after RX ends ?
const uint16_t dual_watch_count_after_1_10ms = 5000 / 10; // 5 sec
const uint16_t dual_watch_count_after_2_10ms = 3600 / 10; // 3.6 sec
const uint16_t dual_watch_count_noaa_10ms = 70 / 10; // 70ms
#ifdef ENABLE_FEAT_F4HWN
const uint16_t dual_watch_count_after_tx_10ms = 420; // 4.2 sec after TX ends
const uint16_t dual_watch_count_after_rx_10ms = 1000 / 10; // 1 sec after RX ends ?
const uint16_t dual_watch_count_after_1_10ms = 5000 / 10; // 5 sec
const uint16_t dual_watch_count_after_2_10ms = 420; // 4.2 sec
const uint16_t dual_watch_count_noaa_10ms = 70 / 10; // 70ms
#else
const uint16_t dual_watch_count_after_tx_10ms = 3600 / 10; // 3.6 sec after TX ends
const uint16_t dual_watch_count_after_rx_10ms = 1000 / 10; // 1 sec after RX ends ?
const uint16_t dual_watch_count_after_1_10ms = 5000 / 10; // 5 sec
const uint16_t dual_watch_count_after_2_10ms = 3600 / 10; // 3.6 sec
const uint16_t dual_watch_count_noaa_10ms = 70 / 10; // 70ms
#endif
#ifdef ENABLE_VOX
const uint16_t dual_watch_count_after_vox_10ms = 200 / 10; // 200ms
#endif

View File

@@ -467,59 +467,51 @@ void UI_MAIN_TimeSlice500ms(void)
DisplayRSSIBar(true);
}
#ifdef ENABLE_FEAT_F4HWN // Blink Green Led for white...
else if(gSetting_set_eot > 0)
else if(gSetting_set_eot > 0 && RxBlinkLed == 2)
{
if(RxBlinkLed == 2)
if(RxBlinkLedCounter <= 8)
{
if(RxBlinkLedCounter <= 10)
if(RxBlinkLedCounter % 2 == 0)
{
if(RxBlinkLedCounter % 2 == 0)
if(gSetting_set_eot > 1 )
{
if(gSetting_set_eot > 1 )
{
BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2_GREEN, false);
}
BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2_GREEN, false);
}
else
{
if(gSetting_set_eot > 1 )
{
BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2_GREEN, true);
}
if(RxBlinkLedCounter <= 6)
{
if(gSetting_set_eot == 1 || gSetting_set_eot == 3)
{
AUDIO_PlayBeep(BEEP_400HZ_30MS);
}
}
else
{
if(gSetting_set_eot == 1 || gSetting_set_eot == 3)
{
if(RxBlinkLedCounter <= 8)
{
AUDIO_PlayBeep(BEEP_600HZ_30MS);
}
else
{
AUDIO_PlayBeep(BEEP_800HZ_30MS);
}
SYSTEM_DelayMs(200);
}
else if(gSetting_set_eot == 2)
{
SYSTEM_DelayMs(400);
}
}
}
RxBlinkLedCounter += 1;
}
else
{
RxBlinkLed = 0;
if(gSetting_set_eot > 1 )
{
BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2_GREEN, true);
}
if(gSetting_set_eot == 1 || gSetting_set_eot == 3)
{
switch(RxBlinkLedCounter)
{
case 1:
AUDIO_PlayBeep(BEEP_400HZ_30MS);
break;
case 3:
AUDIO_PlayBeep(BEEP_400HZ_30MS);
break;
case 5:
AUDIO_PlayBeep(BEEP_500HZ_30MS);
break;
case 7:
AUDIO_PlayBeep(BEEP_600HZ_30MS);
break;
}
}
}
RxBlinkLedCounter += 1;
}
else
{
RxBlinkLed = 0;
}
}
#endif