6
6
7
7
#define TAG "SubGhz"
8
8
9
- /* static void subghz_txrx_radio_device_power_on(SubGhzTxRx* instance) {
9
+ static void subghz_txrx_radio_device_power_on (SubGhzTxRx * instance ) {
10
10
UNUSED (instance );
11
11
uint8_t attempts = 5 ;
12
12
while (-- attempts > 0 ) {
20
20
furi_hal_power_check_otg_fault () ? 1 : 0 );
21
21
}
22
22
}
23
- }*/
23
+ }
24
24
25
25
static void subghz_txrx_radio_device_power_off (SubGhzTxRx * instance ) {
26
26
UNUSED (instance );
@@ -39,14 +39,14 @@ SubGhzTxRx* subghz_txrx_alloc() {
39
39
40
40
instance -> txrx_state = SubGhzTxRxStateSleep ;
41
41
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 );
44
44
45
45
instance -> worker = subghz_worker_alloc ();
46
46
/* instance->fff_data = flipper_format_string_alloc(); */
47
47
48
48
instance -> environment = subghz_environment_alloc ();
49
- /* instance->is_database_loaded =
49
+ instance -> is_database_loaded =
50
50
subghz_environment_load_keystore (instance -> environment , SUBGHZ_KEYSTORE_DIR_NAME );
51
51
subghz_environment_load_keystore (instance -> environment , SUBGHZ_KEYSTORE_DIR_USER_NAME );
52
52
subghz_environment_set_came_atomo_rainbow_table_file_name (
@@ -70,12 +70,15 @@ SubGhzTxRx* subghz_txrx_alloc() {
70
70
instance -> radio_device_type = SubGhzRadioDeviceTypeInternal ;
71
71
instance -> radio_device_type =
72
72
subghz_txrx_radio_device_set (instance , SubGhzRadioDeviceTypeExternalCC1101 );
73
- */
73
+
74
+ FURI_LOG_D (TAG , "completed TXRX alloc" );
75
+
74
76
return instance ;
75
77
}
76
78
77
79
void subghz_txrx_free (SubGhzTxRx * instance ) {
78
80
furi_assert (instance );
81
+ FURI_LOG_D (TAG , "freeing TXRX" );
79
82
80
83
if (instance -> radio_device_type != SubGhzRadioDeviceTypeInternal ) {
81
84
subghz_txrx_radio_device_power_off (instance );
@@ -85,7 +88,7 @@ void subghz_txrx_free(SubGhzTxRx* instance) {
85
88
subghz_devices_deinit ();
86
89
87
90
subghz_worker_free (instance -> worker );
88
- // subghz_receiver_free(instance->receiver);
91
+ subghz_receiver_free (instance -> receiver );
89
92
subghz_environment_free (instance -> environment );
90
93
/*flipper_format_free(instance->fff_data);*/
91
94
furi_string_free (instance -> preset -> name );
@@ -162,6 +165,7 @@ static void subghz_txrx_begin(SubGhzTxRx* instance, uint8_t* preset_data) {
162
165
subghz_devices_idle (instance -> radio_device );
163
166
subghz_devices_load_preset (instance -> radio_device , FuriHalSubGhzPresetCustom , preset_data );
164
167
instance -> txrx_state = SubGhzTxRxStateIDLE ;
168
+ FURI_LOG_D (TAG , "completed subghz_txrx_begin" );
165
169
}
166
170
167
171
/*static uint32_t subghz_txrx_rx(SubGhzTxRx* instance, uint32_t frequency) {
@@ -190,6 +194,7 @@ static void subghz_txrx_idle(SubGhzTxRx* instance) {
190
194
subghz_txrx_speaker_off (instance );
191
195
instance -> txrx_state = SubGhzTxRxStateIDLE ;
192
196
}
197
+ FURI_LOG_D (TAG , "completed subghz_txrx_idle" );
193
198
}
194
199
195
200
/*static void subghz_txrx_rx_end(SubGhzTxRx* instance) {
@@ -223,6 +228,7 @@ static bool subghz_txrx_tx(SubGhzTxRx* instance, uint32_t frequency) {
223
228
instance -> txrx_state = SubGhzTxRxStateTx ;
224
229
}
225
230
231
+ FURI_LOG_D (TAG , "completed subghz_txrx_tx" );
226
232
return ret ;
227
233
}
228
234
@@ -235,7 +241,8 @@ SubGhzTxRxStartTxState subghz_txrx_tx_start(SubGhzTxRx* instance, FlipperFormat*
235
241
SubGhzTxRxStartTxState ret = SubGhzTxRxStartTxStateErrorParserOthers ;
236
242
FuriString * temp_str = furi_string_alloc ();
237
243
uint32_t repeat = 200 ;
238
- UNUSED (repeat );
244
+
245
+ FURI_LOG_D (TAG , "starting loop in subghz_txrx_tx_start" );
239
246
do {
240
247
if (!flipper_format_rewind (flipper_format )) {
241
248
FURI_LOG_E (TAG , "Rewind error" );
@@ -419,10 +426,10 @@ void subghz_txrx_stop(SubGhzTxRx* instance) {
419
426
return instance->hopper_state;
420
427
}*/
421
428
422
- /* void subghz_txrx_hopper_set_state(SubGhzTxRx* instance, SubGhzHopperState state) {
429
+ void subghz_txrx_hopper_set_state (SubGhzTxRx * instance , SubGhzHopperState state ) {
423
430
furi_assert (instance );
424
431
instance -> hopper_state = state ;
425
- }*/
432
+ }
426
433
427
434
/*void subghz_txrx_hopper_unpause(SubGhzTxRx* instance) {
428
435
furi_assert(instance);
@@ -479,10 +486,10 @@ void subghz_txrx_speaker_unmute(SubGhzTxRx* instance) {
479
486
}
480
487
}
481
488
482
- /* void subghz_txrx_speaker_set_state(SubGhzTxRx* instance, SubGhzSpeakerState state) {
489
+ void subghz_txrx_speaker_set_state (SubGhzTxRx * instance , SubGhzSpeakerState state ) {
483
490
furi_assert (instance );
484
491
instance -> speaker_state = state ;
485
- }*/
492
+ }
486
493
487
494
/*SubGhzSpeakerState subghz_txrx_speaker_get_state(SubGhzTxRx* instance) {
488
495
furi_assert(instance);
@@ -548,7 +555,7 @@ void subghz_txrx_speaker_unmute(SubGhzTxRx* instance) {
548
555
context);
549
556
}*/
550
557
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 ) {
552
559
furi_assert (instance );
553
560
554
561
bool is_connect = false;
@@ -567,9 +574,9 @@ void subghz_txrx_speaker_unmute(SubGhzTxRx* instance) {
567
574
subghz_txrx_radio_device_power_off (instance );
568
575
}
569
576
return is_connect ;
570
- }*/
577
+ }
571
578
572
- /* SubGhzRadioDeviceType
579
+ SubGhzRadioDeviceType
573
580
subghz_txrx_radio_device_set (SubGhzTxRx * instance , SubGhzRadioDeviceType radio_device_type ) {
574
581
furi_assert (instance );
575
582
@@ -589,7 +596,7 @@ void subghz_txrx_speaker_unmute(SubGhzTxRx* instance) {
589
596
}
590
597
591
598
return instance -> radio_device_type ;
592
- }*/
599
+ }
593
600
594
601
/*SubGhzRadioDeviceType subghz_txrx_radio_device_get(SubGhzTxRx* instance) {
595
602
furi_assert(instance);
0 commit comments