This commit is contained in:
Willy-JL
2024-04-05 03:25:28 +01:00
7 changed files with 2 additions and 106 deletions

View File

@@ -20,12 +20,6 @@ const char* const timestamp_names_text[TIMESTAMP_NAMES_COUNT] = {
"ON", "ON",
}; };
#define EXT_MOD_POWER_AMP_COUNT 2
const char* const ext_mod_power_amp_text[EXT_MOD_POWER_AMP_COUNT] = {
"OFF",
"ON",
};
#define DEBUG_P_COUNT 2 #define DEBUG_P_COUNT 2
const char* const debug_pin_text[DEBUG_P_COUNT] = { const char* const debug_pin_text[DEBUG_P_COUNT] = {
"OFF", "OFF",
@@ -104,27 +98,6 @@ static void subghz_scene_receiver_config_set_debug_counter(VariableItem* item) {
furi_hal_subghz_set_rolling_counter_mult(debug_counter_val[index]); furi_hal_subghz_set_rolling_counter_mult(debug_counter_val[index]);
} }
static void subghz_scene_reciever_config_set_ext_mod_power_amp_text(VariableItem* item) {
SubGhz* subghz = variable_item_get_context(item);
uint8_t index = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, ext_mod_power_amp_text[index]);
subghz->last_settings->external_module_power_amp = index == 1;
// Set globally in furi hal
furi_hal_subghz_set_ext_power_amp(subghz->last_settings->external_module_power_amp);
subghz_last_settings_save(subghz->last_settings);
// reinit external device
const SubGhzRadioDeviceType current = subghz_txrx_radio_device_get(subghz->txrx);
if(current != SubGhzRadioDeviceTypeInternal) {
subghz_txrx_radio_device_set(subghz->txrx, SubGhzRadioDeviceTypeInternal);
subghz_txrx_radio_device_set(subghz->txrx, current);
}
}
static void subghz_scene_receiver_config_set_gps(VariableItem* item) { static void subghz_scene_receiver_config_set_gps(VariableItem* item) {
SubGhz* subghz = variable_item_get_context(item); SubGhz* subghz = variable_item_get_context(item);
uint8_t index = variable_item_get_current_value_index(item); uint8_t index = variable_item_get_current_value_index(item);
@@ -194,16 +167,6 @@ void subghz_scene_radio_settings_on_enter(void* context) {
variable_item_set_current_value_index(item, value_index); variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, radio_device_text[value_index]); variable_item_set_current_value_text(item, radio_device_text[value_index]);
item = variable_item_list_add(
variable_item_list,
"Ext Power Amp",
EXT_MOD_POWER_AMP_COUNT,
subghz_scene_reciever_config_set_ext_mod_power_amp_text,
subghz);
value_index = subghz->last_settings->external_module_power_amp ? 1 : 0;
variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, ext_mod_power_amp_text[value_index]);
item = variable_item_list_add( item = variable_item_list_add(
variable_item_list, variable_item_list,
"GPS Baudrate", "GPS Baudrate",

View File

@@ -26,8 +26,5 @@ void subghz_extended_freq() {
SubGhzLastSettings* last_settings = subghz_last_settings_alloc(); SubGhzLastSettings* last_settings = subghz_last_settings_alloc();
subghz_last_settings_load(last_settings, 0); subghz_last_settings_load(last_settings, 0);
// Set globally in furi hal
furi_hal_subghz_set_ext_power_amp(last_settings->external_module_power_amp);
subghz_last_settings_free(last_settings); subghz_last_settings_free(last_settings);
} }

View File

@@ -20,11 +20,6 @@ typedef struct {
uint32_t preset_index; // AKA Modulation uint32_t preset_index; // AKA Modulation
uint32_t frequency_analyzer_feedback_level; uint32_t frequency_analyzer_feedback_level;
float frequency_analyzer_trigger; float frequency_analyzer_trigger;
// TODO not using but saved so as not to change the version
bool external_module_enabled;
bool external_module_power_5v_disable;
bool external_module_power_amp;
// saved so as not to change the version
bool protocol_file_names; bool protocol_file_names;
uint32_t gps_baudrate; uint32_t gps_baudrate;
bool enable_hopping; bool enable_hopping;

View File

@@ -35,7 +35,7 @@ bool subghz_devices_begin(const SubGhzDevice* device) {
SubGhzDeviceConf conf = { SubGhzDeviceConf conf = {
.ver = 1, .ver = 1,
.extended_range = false, // TODO .extended_range = false, // TODO
.power_amp = furi_hal_subghz_get_ext_power_amp(), .power_amp = true,
}; };
ret = device->interconnect->begin(&conf); ret = device->interconnect->begin(&conf);

View File

@@ -1643,7 +1643,6 @@ Function,-,furi_hal_subghz_dump_state,void,
Function,+,furi_hal_subghz_flush_rx,void, Function,+,furi_hal_subghz_flush_rx,void,
Function,+,furi_hal_subghz_flush_tx,void, Function,+,furi_hal_subghz_flush_tx,void,
Function,+,furi_hal_subghz_get_data_gpio,const GpioPin*, Function,+,furi_hal_subghz_get_data_gpio,const GpioPin*,
Function,+,furi_hal_subghz_get_ext_power_amp,_Bool,
Function,+,furi_hal_subghz_get_lqi,uint8_t, Function,+,furi_hal_subghz_get_lqi,uint8_t,
Function,+,furi_hal_subghz_get_rolling_counter_mult,int8_t, Function,+,furi_hal_subghz_get_rolling_counter_mult,int8_t,
Function,+,furi_hal_subghz_get_rssi,float, Function,+,furi_hal_subghz_get_rssi,float,
@@ -1661,7 +1660,6 @@ Function,+,furi_hal_subghz_reset,void,
Function,+,furi_hal_subghz_rx,void, Function,+,furi_hal_subghz_rx,void,
Function,+,furi_hal_subghz_rx_pipe_not_empty,_Bool, Function,+,furi_hal_subghz_rx_pipe_not_empty,_Bool,
Function,+,furi_hal_subghz_set_async_mirror_pin,void,const GpioPin* Function,+,furi_hal_subghz_set_async_mirror_pin,void,const GpioPin*
Function,+,furi_hal_subghz_set_ext_power_amp,void,_Bool
Function,+,furi_hal_subghz_set_frequency,uint32_t,uint32_t Function,+,furi_hal_subghz_set_frequency,uint32_t,uint32_t
Function,+,furi_hal_subghz_set_frequency_and_path,uint32_t,uint32_t Function,+,furi_hal_subghz_set_frequency_and_path,uint32_t,uint32_t
Function,+,furi_hal_subghz_set_path,void,FuriHalSubGhzPath Function,+,furi_hal_subghz_set_path,void,FuriHalSubGhzPath
1 entry status name type params
1643 Function + furi_hal_subghz_flush_rx void
1644 Function + furi_hal_subghz_flush_tx void
1645 Function + furi_hal_subghz_get_data_gpio const GpioPin*
Function + furi_hal_subghz_get_ext_power_amp _Bool
1646 Function + furi_hal_subghz_get_lqi uint8_t
1647 Function + furi_hal_subghz_get_rolling_counter_mult int8_t
1648 Function + furi_hal_subghz_get_rssi float
1660 Function + furi_hal_subghz_rx void
1661 Function + furi_hal_subghz_rx_pipe_not_empty _Bool
1662 Function + furi_hal_subghz_set_async_mirror_pin void const GpioPin*
Function + furi_hal_subghz_set_ext_power_amp void _Bool
1663 Function + furi_hal_subghz_set_frequency uint32_t uint32_t
1664 Function + furi_hal_subghz_set_frequency_and_path uint32_t uint32_t
1665 Function + furi_hal_subghz_set_path void FuriHalSubGhzPath

View File

@@ -52,7 +52,6 @@ typedef struct {
const GpioPin* async_mirror_pin; const GpioPin* async_mirror_pin;
int8_t rolling_counter_mult; int8_t rolling_counter_mult;
bool ext_power_amp : 1;
bool extended_frequency_i : 1; bool extended_frequency_i : 1;
bool bypass_region : 1; bool bypass_region : 1;
} FuriHalSubGhz; } FuriHalSubGhz;
@@ -62,7 +61,6 @@ volatile FuriHalSubGhz furi_hal_subghz = {
.regulation = SubGhzRegulationTxRx, .regulation = SubGhzRegulationTxRx,
.async_mirror_pin = NULL, .async_mirror_pin = NULL,
.rolling_counter_mult = 1, .rolling_counter_mult = 1,
.ext_power_amp = false,
.extended_frequency_i = false, .extended_frequency_i = false,
.bypass_region = false, .bypass_region = false,
}; };
@@ -83,14 +81,6 @@ void furi_hal_subghz_set_bypass_region(bool enabled) {
furi_hal_subghz.bypass_region = enabled; furi_hal_subghz.bypass_region = enabled;
} }
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(void) {
return furi_hal_subghz.ext_power_amp;
}
void furi_hal_subghz_set_async_mirror_pin(const GpioPin* pin) { void furi_hal_subghz_set_async_mirror_pin(const GpioPin* pin) {
furi_hal_subghz.async_mirror_pin = pin; furi_hal_subghz.async_mirror_pin = pin;
} }

View File

@@ -238,54 +238,7 @@ bool furi_hal_subghz_is_async_tx_complete(void);
*/ */
void furi_hal_subghz_stop_async_tx(void); void furi_hal_subghz_stop_async_tx(void);
// /** Initialize and switch to power save mode Used by internal API-HAL // External CC1101 Ebytes power amplifier control is now enabled by default
// * initialization routine Can be used to reinitialize device to safe state and
// * send it to sleep
// * @return true if initialisation is successfully
// */
// bool furi_hal_subghz_init_check(void);
// /** Switching between internal and external radio
// * @param state SubGhzRadioInternal or SubGhzRadioExternal
// * @return true if switching is successful
// */
// bool furi_hal_subghz_init_radio_type(SubGhzRadioType state);
// /** Get current radio
// * @return SubGhzRadioInternal or SubGhzRadioExternal
// */
// SubGhzRadioType furi_hal_subghz_get_radio_type(void);
// /** Check for a radio module
// * @return true if check is successful
// */
// bool furi_hal_subghz_check_radio(void);
// /** Turn on the power of the external radio module
// * @return true if power-up is successful
// */
// bool furi_hal_subghz_enable_ext_power(void);
// /** Turn off the power of the external radio module
// */
// void furi_hal_subghz_disable_ext_power(void);
// /** If true - disable 5v power of the external radio module
// */
// void furi_hal_subghz_set_external_power_disable(bool state);
// /** Get the current state of the external power disable flag
// */
// bool furi_hal_subghz_get_external_power_disable(void);
// /** Set what radio module we will be using
// */
// 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(void);
#ifdef __cplusplus #ifdef __cplusplus
} }