Remake it more properly

still has problems, need to rewrite subghz_devices tx/rx switch code, checking strcmp every time is not good too, but better than loading whole config from microsd
This commit is contained in:
MX
2023-07-29 03:51:46 +03:00
parent 58beca313d
commit 0f9c6ba847
7 changed files with 87 additions and 55 deletions

View File

@@ -53,7 +53,7 @@ typedef struct {
const GpioPin* async_mirror_pin;
uint8_t rolling_counter_mult;
bool timestamp_file_names : 1;
bool ext_power_amp : 1;
bool dangerous_frequency_i : 1;
} FuriHalSubGhz;
@@ -62,6 +62,7 @@ volatile FuriHalSubGhz furi_hal_subghz = {
.regulation = SubGhzRegulationTxRx,
.async_mirror_pin = NULL,
.rolling_counter_mult = 1,
.ext_power_amp = false,
.dangerous_frequency_i = false,
};
@@ -77,6 +78,14 @@ void furi_hal_subghz_set_dangerous_frequency(bool state_i) {
furi_hal_subghz.dangerous_frequency_i = state_i;
}
void furi_hal_subghz_set_ext_power_amp(bool enabled) {
furi_hal_subghz.ext_power_amp = enabled;
}
bool furi_hal_subghz_get_ext_power_amp() {
return furi_hal_subghz.ext_power_amp;
}
void furi_hal_subghz_set_async_mirror_pin(const GpioPin* pin) {
furi_hal_subghz.async_mirror_pin = pin;
}

View File

@@ -282,6 +282,11 @@ void furi_hal_subghz_stop_async_tx();
// */
// void furi_hal_subghz_select_radio_type(SubGhzRadioType state);
// External CC1101 Ebytes power amplifier control
void furi_hal_subghz_set_ext_power_amp(bool enabled);
bool furi_hal_subghz_get_ext_power_amp();
#ifdef __cplusplus
}
#endif