Просмотр исходного кода

Disable debug timer sampling mode.

antirez 3 лет назад
Родитель
Сommit
65d7c7007f
5 измененных файлов с 14 добавлено и 15 удалено
  1. 2 2
      app.c
  2. 2 4
      app.h
  3. 2 2
      app_subghz.c
  4. 2 2
      view_direct_sampling.c
  5. 6 5
      view_settings.c

+ 2 - 2
app.c

@@ -130,7 +130,7 @@ ProtoViewApp* protoview_app_alloc() {
 
     /* Setup rx worker and environment. */
     app->txrx->freq_mod_changed = false;
-    app->txrx->debug_direct_sampling = false;
+    app->txrx->debug_timer_sampling = false;
     app->txrx->last_g0_change_time = DWT->CYCCNT;
     app->txrx->last_g0_value = false;
     app->txrx->worker = subghz_worker_alloc();
@@ -181,7 +181,7 @@ void protoview_app_free(ProtoViewApp *app) {
     subghz_setting_free(app->setting);
 
     // Worker stuff.
-    if (!app->txrx->debug_direct_sampling) {
+    if (!app->txrx->debug_timer_sampling) {
         subghz_receiver_free(app->txrx->receiver);
         subghz_environment_free(app->txrx->environment);
         subghz_worker_free(app->txrx->worker);

+ 2 - 4
app.h

@@ -73,11 +73,9 @@ struct ProtoViewTxRx {
     SubGhzReceiver* receiver;
     TxRxState txrx_state; /* Receiving, idle or sleeping? */
 
-    /* Direct sampling mode state. */
-    bool debug_direct_sampling; /* Read data from GDO0 in a busy loop. Only
+    /* Timer sampling mode state. */
+    bool debug_timer_sampling;  /* Read data from GDO0 in a busy loop. Only
                                    for testing. */
-    FuriThread *ds_thread;      /* Direct sampling thread. */
-    bool ds_thread_running;     /* Exit condition for the thread. */
     uint32_t last_g0_change_time; /* Last high->low (or reverse) switch. */
     bool last_g0_value;           /* Current value (high or low): we are
                                      checking the duration in the timer

+ 2 - 2
app_subghz.c

@@ -60,7 +60,7 @@ uint32_t radio_rx(ProtoViewApp* app) {
     furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);
     furi_hal_subghz_flush_rx();
     furi_hal_subghz_rx();
-    if (!app->txrx->debug_direct_sampling) {
+    if (!app->txrx->debug_timer_sampling) {
 
         furi_hal_subghz_start_async_rx(subghz_worker_rx_callback,
                                        app->txrx->worker);
@@ -76,7 +76,7 @@ uint32_t radio_rx(ProtoViewApp* app) {
 void radio_rx_end(ProtoViewApp* app) {
     furi_assert(app);
     if (app->txrx->txrx_state == TxRxStateRx) {
-        if (!app->txrx->debug_direct_sampling) {
+        if (!app->txrx->debug_timer_sampling) {
             if(subghz_worker_is_running(app->txrx->worker)) {
                 subghz_worker_stop(app->txrx->worker);
                 furi_hal_subghz_stop_async_rx();

+ 2 - 2
view_direct_sampling.c

@@ -34,7 +34,7 @@ void process_input_direct_sampling(ProtoViewApp *app, InputEvent input) {
  * the CC1101 data directly. */
 void view_enter_direct_sampling(ProtoViewApp *app) {
     if (app->txrx->txrx_state == TxRxStateRx &&
-        !app->txrx->debug_direct_sampling)
+        !app->txrx->debug_timer_sampling)
     {
         subghz_worker_stop(app->txrx->worker);
     } else {
@@ -45,7 +45,7 @@ void view_enter_direct_sampling(ProtoViewApp *app) {
 /* Exit view. Restore the subghz thread. */
 void view_exit_direct_sampling(ProtoViewApp *app) {
     if (app->txrx->txrx_state == TxRxStateRx &&
-        !app->txrx->debug_direct_sampling)
+        !app->txrx->debug_timer_sampling)
     {
         subghz_worker_start(app->txrx->worker);
     } else {

+ 6 - 5
view_settings.c

@@ -20,8 +20,8 @@ void render_view_settings(Canvas *const canvas, ProtoViewApp *app) {
     canvas_set_font(canvas, FontSecondary);
     canvas_draw_str(canvas,10,61,"Use up and down to modify");
 
-    if (app->txrx->debug_direct_sampling)
-        canvas_draw_str(canvas,3,52,"(DEBUG direct sampling is ON)");
+    if (app->txrx->debug_timer_sampling)
+        canvas_draw_str(canvas,3,52,"(DEBUG timer sampling is ON)");
 
     /* Show frequency. We can use big numbers font since it's just a number. */
     if (app->current_view == ViewFrequencySettings) {
@@ -43,15 +43,16 @@ void process_input_settings(ProtoViewApp *app, InputEvent input) {
          * modulation. */
         app->frequency = subghz_setting_get_default_frequency(app->setting);
         app->modulation = 0;
-    } else if (input.type == InputTypeLong && input.key == InputKeyDown) {
+    } else if (0 && input.type == InputTypeLong && input.key == InputKeyDown) {
         /* Long pressing to down switches between normal and debug
-         * direct sampling mode. */
+         * timer sampling mode. NOTE: this feature is disabled for users,
+         * only useful for devs (if useful at all). */
 
         /* We have to stop the previous sampling system. */
         radio_rx_end(app);
 
         /* Then switch mode and start the new one. */
-        app->txrx->debug_direct_sampling = !app->txrx->debug_direct_sampling;
+        app->txrx->debug_timer_sampling = !app->txrx->debug_timer_sampling;
         radio_begin(app);
         radio_rx(app);
     } else if (input.type == InputTypePress &&