Improve new action for RescueOps

This commit is contained in:
Armel FAUVEAU
2024-11-23 07:05:04 +01:00
parent 3bad2a3b0f
commit 54d5c2fb68
5 changed files with 22 additions and 35 deletions

View File

@@ -621,25 +621,14 @@ void ACTION_BackLightOnDemand(void)
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS #ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
void ACTION_Power_High(void) void ACTION_Power_High(void)
{ {
if (gTxVfo->OUTPUT_POWER == gInitialPower) gPowerHigh = !gPowerHigh;
gTxVfo->OUTPUT_POWER = OUTPUT_POWER_HIGH; gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
else if(gTxVfo->OUTPUT_POWER == OUTPUT_POWER_HIGH)
gTxVfo->OUTPUT_POWER = gInitialPower;
} }
void ACTION_Remove_Shift(void) void ACTION_Remove_Shift(void)
{ {
if(gTxVfo->TX_OFFSET_FREQUENCY_DIRECTION != 0) gRemoveShift = !gRemoveShift;
{ gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
if(gTxVfo->pTX == &gTxVfo->freq_config_TX)
{
gTxVfo->pTX = &gTxVfo->freq_config_RX;
}
else
{
gTxVfo->pTX = &gTxVfo->freq_config_TX;
}
}
} }
#endif #endif
#endif #endif

4
misc.c
View File

@@ -138,8 +138,8 @@ enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
uint8_t lErrorsDuringAirCopy = 0; uint8_t lErrorsDuringAirCopy = 0;
uint8_t gAircopyStep = 0; uint8_t gAircopyStep = 0;
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS #ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
bool gResetPower = false; bool gPowerHigh = false;
uint8_t gInitialPower = 0; bool gRemoveShift = false;
#endif #endif
#endif #endif

4
misc.h
View File

@@ -191,8 +191,8 @@ extern enum BacklightOnRxTx_t gSetting_backlight_on_tx_rx;
extern uint8_t lErrorsDuringAirCopy; extern uint8_t lErrorsDuringAirCopy;
extern uint8_t gAircopyStep; extern uint8_t gAircopyStep;
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS #ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
extern bool gResetPower; extern bool gPowerHigh;
extern uint8_t gInitialPower; extern bool gRemoveShift;
#endif #endif
#endif #endif

22
radio.c
View File

@@ -159,14 +159,6 @@ void RADIO_InitInfo(VFO_Info_t *pInfo, const uint8_t ChannelSave, const uint32_t
void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure) void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure)
{ {
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
if(configure == VFO_CONFIGURE_RELOAD)
{
gResetPower = true;
}
#endif
VFO_Info_t *pVfo = &gEeprom.VfoInfo[VFO]; VFO_Info_t *pVfo = &gEeprom.VfoInfo[VFO];
if (!gSetting_350EN) { if (!gSetting_350EN) {
@@ -436,6 +428,20 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure
pVfo->Compander = att.compander; pVfo->Compander = att.compander;
RADIO_ConfigureSquelchAndOutputPower(pVfo); RADIO_ConfigureSquelchAndOutputPower(pVfo);
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
if(gRemoveShift)
{
pVfo->pTX = &pVfo->freq_config_RX;
gRequestSaveChannel = 1;
}
if(gPowerHigh)
{
pVfo->OUTPUT_POWER = OUTPUT_POWER_HIGH;
gRequestSaveChannel = 1;
}
#endif
} }
void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo) void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo)

View File

@@ -1202,14 +1202,6 @@ void UI_DisplayMain(void)
uint8_t arrowPos = 19; uint8_t arrowPos = 19;
bool userPower = false; bool userPower = false;
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
if(gResetPower) // RO is active
{
gInitialPower = currentPower;
gResetPower = false;
}
#endif
if(currentPower == OUTPUT_POWER_USER) if(currentPower == OUTPUT_POWER_USER)
{ {
currentPower = gSetting_set_pwr; currentPower = gSetting_set_pwr;