Browse Source

Fix direct sampling after subghz worker deletion.

antirez 3 years ago
parent
commit
d1c86b3497
1 changed files with 7 additions and 0 deletions
  1. 7 0
      view_direct_sampling.c

+ 7 - 0
view_direct_sampling.c

@@ -49,6 +49,13 @@ void view_enter_direct_sampling(ProtoViewApp *app) {
         !app->txrx->debug_timer_sampling)
     {
         furi_hal_subghz_stop_async_rx();
+
+        // To read data asynchronously directly from the view, we need
+        // to put the CC1101 back into reception mode (the previous call
+        // to stop the async RX will put it into idle) and configure the
+        // G0 pin for reading.
+        furi_hal_subghz_rx();
+        furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);
     } else {
         raw_sampling_worker_stop(app);
     }