mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 08:18:35 -07:00
SubGhz: furi_hal_subghz remove preset load function by name
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
entry,status,name,type,params
|
||||
Version,+,32.0,,
|
||||
Version,+,33.0,,
|
||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||
Header,+,applications/services/cli/cli.h,,
|
||||
Header,+,applications/services/cli/cli_vcp.h,,
|
||||
@@ -185,6 +185,7 @@ Header,+,lib/subghz/blocks/decoder.h,,
|
||||
Header,+,lib/subghz/blocks/encoder.h,,
|
||||
Header,+,lib/subghz/blocks/generic.h,,
|
||||
Header,+,lib/subghz/blocks/math.h,,
|
||||
Header,+,lib/subghz/devices/cc1101_configs.h,,
|
||||
Header,+,lib/subghz/environment.h,,
|
||||
Header,+,lib/subghz/protocols/raw.h,,
|
||||
Header,+,lib/subghz/receiver.h,,
|
||||
@@ -1398,7 +1399,6 @@ Function,+,furi_hal_subghz_is_rx_data_crc_valid,_Bool,
|
||||
Function,+,furi_hal_subghz_is_tx_allowed,_Bool,uint32_t
|
||||
Function,+,furi_hal_subghz_load_custom_preset,void,uint8_t*
|
||||
Function,+,furi_hal_subghz_load_patable,void,const uint8_t[8]
|
||||
Function,+,furi_hal_subghz_load_preset,void,FuriHalSubGhzPreset
|
||||
Function,+,furi_hal_subghz_load_registers,void,uint8_t*
|
||||
Function,+,furi_hal_subghz_read_packet,void,"uint8_t*, uint8_t*"
|
||||
Function,+,furi_hal_subghz_reset,void,
|
||||
@@ -3443,6 +3443,12 @@ Variable,+,sequence_set_vibro_on,const NotificationSequence,
|
||||
Variable,+,sequence_single_vibro,const NotificationSequence,
|
||||
Variable,+,sequence_solid_yellow,const NotificationSequence,
|
||||
Variable,+,sequence_success,const NotificationSequence,
|
||||
Variable,+,subghz_device_cc1101_preset_2fsk_dev2_38khz_async_regs,const uint8_t[],
|
||||
Variable,+,subghz_device_cc1101_preset_2fsk_dev47_6khz_async_regs,const uint8_t[],
|
||||
Variable,+,subghz_device_cc1101_preset_gfsk_9_99kb_async_regs,const uint8_t[],
|
||||
Variable,+,subghz_device_cc1101_preset_msk_99_97kb_async_regs,const uint8_t[],
|
||||
Variable,+,subghz_device_cc1101_preset_ook_270khz_async_regs,const uint8_t[],
|
||||
Variable,+,subghz_device_cc1101_preset_ook_650khz_async_regs,const uint8_t[],
|
||||
Variable,+,subghz_protocol_raw,const SubGhzProtocol,
|
||||
Variable,+,subghz_protocol_raw_decoder,const SubGhzProtocolDecoder,
|
||||
Variable,+,subghz_protocol_raw_encoder,const SubGhzProtocolEncoder,
|
||||
|
||||
|
@@ -50,7 +50,6 @@ typedef enum {
|
||||
typedef struct {
|
||||
volatile SubGhzState state;
|
||||
volatile SubGhzRegulation regulation;
|
||||
volatile FuriHalSubGhzPreset preset;
|
||||
const GpioPin* async_mirror_pin;
|
||||
|
||||
uint8_t rolling_counter_mult;
|
||||
@@ -61,7 +60,6 @@ typedef struct {
|
||||
volatile FuriHalSubGhz furi_hal_subghz = {
|
||||
.state = SubGhzStateInit,
|
||||
.regulation = SubGhzRegulationTxRx,
|
||||
.preset = FuriHalSubGhzPresetIDLE,
|
||||
.async_mirror_pin = NULL,
|
||||
.rolling_counter_mult = 1,
|
||||
.dangerous_frequency_i = false,
|
||||
@@ -90,7 +88,6 @@ const GpioPin* furi_hal_subghz_get_data_gpio() {
|
||||
void furi_hal_subghz_init() {
|
||||
furi_assert(furi_hal_subghz.state == SubGhzStateInit);
|
||||
furi_hal_subghz.state = SubGhzStateIdle;
|
||||
furi_hal_subghz.preset = FuriHalSubGhzPresetIDLE;
|
||||
|
||||
furi_hal_spi_acquire(&furi_hal_spi_bus_handle_subghz);
|
||||
|
||||
@@ -144,8 +141,6 @@ void furi_hal_subghz_sleep() {
|
||||
cc1101_shutdown(&furi_hal_spi_bus_handle_subghz);
|
||||
|
||||
furi_hal_spi_release(&furi_hal_spi_bus_handle_subghz);
|
||||
|
||||
furi_hal_subghz.preset = FuriHalSubGhzPresetIDLE;
|
||||
}
|
||||
|
||||
void furi_hal_subghz_dump_state() {
|
||||
@@ -157,37 +152,6 @@ void furi_hal_subghz_dump_state() {
|
||||
furi_hal_spi_release(&furi_hal_spi_bus_handle_subghz);
|
||||
}
|
||||
|
||||
void furi_hal_subghz_load_preset(FuriHalSubGhzPreset preset) {
|
||||
if(preset == FuriHalSubGhzPresetOok650Async) {
|
||||
furi_hal_subghz_load_registers(
|
||||
(uint8_t*)subghz_device_cc1101_preset_ook_650khz_async_regs);
|
||||
furi_hal_subghz_load_patable(subghz_device_cc1101_preset_ook_async_patable);
|
||||
} else if(preset == FuriHalSubGhzPresetOok270Async) {
|
||||
furi_hal_subghz_load_registers(
|
||||
(uint8_t*)subghz_device_cc1101_preset_ook_270khz_async_regs);
|
||||
furi_hal_subghz_load_patable(subghz_device_cc1101_preset_ook_async_patable);
|
||||
} else if(preset == FuriHalSubGhzPreset2FSKDev238Async) {
|
||||
furi_hal_subghz_load_registers(
|
||||
(uint8_t*)subghz_device_cc1101_preset_2fsk_dev2_38khz_async_regs);
|
||||
furi_hal_subghz_load_patable(subghz_device_cc1101_preset_2fsk_async_patable);
|
||||
} else if(preset == FuriHalSubGhzPreset2FSKDev476Async) {
|
||||
furi_hal_subghz_load_registers(
|
||||
(uint8_t*)subghz_device_cc1101_preset_2fsk_dev47_6khz_async_regs);
|
||||
furi_hal_subghz_load_patable(subghz_device_cc1101_preset_2fsk_async_patable);
|
||||
} else if(preset == FuriHalSubGhzPresetMSK99_97KbAsync) {
|
||||
furi_hal_subghz_load_registers(
|
||||
(uint8_t*)subghz_device_cc1101_preset_msk_99_97kb_async_regs);
|
||||
furi_hal_subghz_load_patable(subghz_device_cc1101_preset_msk_async_patable);
|
||||
} else if(preset == FuriHalSubGhzPresetGFSK9_99KbAsync) {
|
||||
furi_hal_subghz_load_registers(
|
||||
(uint8_t*)subghz_device_cc1101_preset_gfsk_9_99kb_async_regs);
|
||||
furi_hal_subghz_load_patable(subghz_device_cc1101_preset_gfsk_async_patable);
|
||||
} else {
|
||||
furi_crash("SubGhz: Missing config.");
|
||||
}
|
||||
furi_hal_subghz.preset = preset;
|
||||
}
|
||||
|
||||
void furi_hal_subghz_load_custom_preset(uint8_t* preset_data) {
|
||||
//load config
|
||||
furi_hal_spi_acquire(&furi_hal_spi_bus_handle_subghz);
|
||||
@@ -203,7 +167,6 @@ void furi_hal_subghz_load_custom_preset(uint8_t* preset_data) {
|
||||
//load pa table
|
||||
memcpy(&pa[0], &preset_data[i + 2], 8);
|
||||
furi_hal_subghz_load_patable(pa);
|
||||
furi_hal_subghz.preset = FuriHalSubGhzPresetCustom;
|
||||
|
||||
//show debug
|
||||
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
|
||||
|
||||
@@ -60,12 +60,6 @@ void furi_hal_subghz_sleep();
|
||||
*/
|
||||
void furi_hal_subghz_dump_state();
|
||||
|
||||
/** Load registers from preset by preset name
|
||||
*
|
||||
* @param preset to load
|
||||
*/
|
||||
void furi_hal_subghz_load_preset(FuriHalSubGhzPreset preset);
|
||||
|
||||
/** Load custom registers from preset
|
||||
*
|
||||
* @param preset_data registers to load
|
||||
|
||||
Reference in New Issue
Block a user