66
77#define TAG "SubGhz"
88
9- /* static void subghz_txrx_radio_device_power_on(SubGhzTxRx* instance) {
9+ static void subghz_txrx_radio_device_power_on (SubGhzTxRx * instance ) {
1010 UNUSED (instance );
1111 uint8_t attempts = 5 ;
1212 while (-- attempts > 0 ) {
2020 furi_hal_power_check_otg_fault () ? 1 : 0 );
2121 }
2222 }
23- }*/
23+ }
2424
2525static void subghz_txrx_radio_device_power_off (SubGhzTxRx * instance ) {
2626 UNUSED (instance );
@@ -39,14 +39,14 @@ SubGhzTxRx* subghz_txrx_alloc() {
3939
4040 instance -> txrx_state = SubGhzTxRxStateSleep ;
4141
42- // subghz_txrx_hopper_set_state(instance, SubGhzHopperStateOFF);
43- // subghz_txrx_speaker_set_state(instance, SubGhzSpeakerStateDisable);
42+ subghz_txrx_hopper_set_state (instance , SubGhzHopperStateOFF );
43+ subghz_txrx_speaker_set_state (instance , SubGhzSpeakerStateDisable );
4444
4545 instance -> worker = subghz_worker_alloc ();
4646/* instance->fff_data = flipper_format_string_alloc(); */
4747
4848 instance -> environment = subghz_environment_alloc ();
49- /* instance->is_database_loaded =
49+ instance -> is_database_loaded =
5050 subghz_environment_load_keystore (instance -> environment , SUBGHZ_KEYSTORE_DIR_NAME );
5151 subghz_environment_load_keystore (instance -> environment , SUBGHZ_KEYSTORE_DIR_USER_NAME );
5252 subghz_environment_set_came_atomo_rainbow_table_file_name (
@@ -70,12 +70,15 @@ SubGhzTxRx* subghz_txrx_alloc() {
7070 instance -> radio_device_type = SubGhzRadioDeviceTypeInternal ;
7171 instance -> radio_device_type =
7272 subghz_txrx_radio_device_set (instance , SubGhzRadioDeviceTypeExternalCC1101 );
73- */
73+
74+ FURI_LOG_D (TAG , "completed TXRX alloc" );
75+
7476 return instance ;
7577}
7678
7779void subghz_txrx_free (SubGhzTxRx * instance ) {
7880 furi_assert (instance );
81+ FURI_LOG_D (TAG , "freeing TXRX" );
7982
8083 if (instance -> radio_device_type != SubGhzRadioDeviceTypeInternal ) {
8184 subghz_txrx_radio_device_power_off (instance );
@@ -85,7 +88,7 @@ void subghz_txrx_free(SubGhzTxRx* instance) {
8588 subghz_devices_deinit ();
8689
8790 subghz_worker_free (instance -> worker );
88- // subghz_receiver_free(instance->receiver);
91+ subghz_receiver_free (instance -> receiver );
8992 subghz_environment_free (instance -> environment );
9093 /*flipper_format_free(instance->fff_data);*/
9194 furi_string_free (instance -> preset -> name );
@@ -162,6 +165,7 @@ static void subghz_txrx_begin(SubGhzTxRx* instance, uint8_t* preset_data) {
162165 subghz_devices_idle (instance -> radio_device );
163166 subghz_devices_load_preset (instance -> radio_device , FuriHalSubGhzPresetCustom , preset_data );
164167 instance -> txrx_state = SubGhzTxRxStateIDLE ;
168+ FURI_LOG_D (TAG , "completed subghz_txrx_begin" );
165169}
166170
167171/*static uint32_t subghz_txrx_rx(SubGhzTxRx* instance, uint32_t frequency) {
@@ -190,6 +194,7 @@ static void subghz_txrx_idle(SubGhzTxRx* instance) {
190194 subghz_txrx_speaker_off (instance );
191195 instance -> txrx_state = SubGhzTxRxStateIDLE ;
192196 }
197+ FURI_LOG_D (TAG , "completed subghz_txrx_idle" );
193198}
194199
195200/*static void subghz_txrx_rx_end(SubGhzTxRx* instance) {
@@ -223,6 +228,7 @@ static bool subghz_txrx_tx(SubGhzTxRx* instance, uint32_t frequency) {
223228 instance -> txrx_state = SubGhzTxRxStateTx ;
224229 }
225230
231+ FURI_LOG_D (TAG , "completed subghz_txrx_tx" );
226232 return ret ;
227233}
228234
@@ -235,7 +241,8 @@ SubGhzTxRxStartTxState subghz_txrx_tx_start(SubGhzTxRx* instance, FlipperFormat*
235241 SubGhzTxRxStartTxState ret = SubGhzTxRxStartTxStateErrorParserOthers ;
236242 FuriString * temp_str = furi_string_alloc ();
237243 uint32_t repeat = 200 ;
238- UNUSED (repeat );
244+
245+ FURI_LOG_D (TAG , "starting loop in subghz_txrx_tx_start" );
239246 do {
240247 if (!flipper_format_rewind (flipper_format )) {
241248 FURI_LOG_E (TAG , "Rewind error" );
@@ -419,10 +426,10 @@ void subghz_txrx_stop(SubGhzTxRx* instance) {
419426 return instance->hopper_state;
420427}*/
421428
422- /* void subghz_txrx_hopper_set_state(SubGhzTxRx* instance, SubGhzHopperState state) {
429+ void subghz_txrx_hopper_set_state (SubGhzTxRx * instance , SubGhzHopperState state ) {
423430 furi_assert (instance );
424431 instance -> hopper_state = state ;
425- }*/
432+ }
426433
427434/*void subghz_txrx_hopper_unpause(SubGhzTxRx* instance) {
428435 furi_assert(instance);
@@ -479,10 +486,10 @@ void subghz_txrx_speaker_unmute(SubGhzTxRx* instance) {
479486 }
480487}
481488
482- /* void subghz_txrx_speaker_set_state(SubGhzTxRx* instance, SubGhzSpeakerState state) {
489+ void subghz_txrx_speaker_set_state (SubGhzTxRx * instance , SubGhzSpeakerState state ) {
483490 furi_assert (instance );
484491 instance -> speaker_state = state ;
485- }*/
492+ }
486493
487494/*SubGhzSpeakerState subghz_txrx_speaker_get_state(SubGhzTxRx* instance) {
488495 furi_assert(instance);
@@ -548,7 +555,7 @@ void subghz_txrx_speaker_unmute(SubGhzTxRx* instance) {
548555 context);
549556}*/
550557
551- /* bool subghz_txrx_radio_device_is_external_connected(SubGhzTxRx* instance, const char* name) {
558+ bool subghz_txrx_radio_device_is_external_connected (SubGhzTxRx * instance , const char * name ) {
552559 furi_assert (instance );
553560
554561 bool is_connect = false;
@@ -567,9 +574,9 @@ void subghz_txrx_speaker_unmute(SubGhzTxRx* instance) {
567574 subghz_txrx_radio_device_power_off (instance );
568575 }
569576 return is_connect ;
570- }*/
577+ }
571578
572- /* SubGhzRadioDeviceType
579+ SubGhzRadioDeviceType
573580 subghz_txrx_radio_device_set (SubGhzTxRx * instance , SubGhzRadioDeviceType radio_device_type ) {
574581 furi_assert (instance );
575582
@@ -589,7 +596,7 @@ void subghz_txrx_speaker_unmute(SubGhzTxRx* instance) {
589596 }
590597
591598 return instance -> radio_device_type ;
592- }*/
599+ }
593600
594601/*SubGhzRadioDeviceType subghz_txrx_radio_device_get(SubGhzTxRx* instance) {
595602 furi_assert(instance);
0 commit comments