소스 검색

Define to disable the subghz worker filter.

The subghz worker code inside the Flipper firmware has an hardcoded
filter discarding packets that are shorter than 30us. This code messes
with the opaque structure to disable it in order to try receiving higher
data rates messages.
antirez 3 년 전
부모
커밋
811d8f3c00
1개의 변경된 파일31개의 추가작업 그리고 0개의 파일을 삭제
  1. 31 0
      app.c

+ 31 - 0
app.c

@@ -3,6 +3,32 @@
 
 #include "app.h"
 
+/* If this define is enabled, ProtoView is going to mess with the
+ * otherwise opaque SubGhzWorker structure in order to disable
+ * its filter for samples shorter than a given amount (30us at the
+ * time I'm writing this comment).
+ *
+ * This structure must be taken in sync with the one of the firmware. */
+#define PROTOVIEW_DISABLE_SUBGHZ_FILTER 0
+
+#ifdef PROTOVIEW_DISABLE_SUBGHZ_FILTER
+struct SubGhzWorker {
+    FuriThread* thread;
+    FuriStreamBuffer* stream;
+
+    volatile bool running;
+    volatile bool overrun;
+
+    LevelDuration filter_level_duration;
+    bool filter_running;
+    uint16_t filter_duration;
+
+    SubGhzWorkerOverrunCallback overrun_callback;
+    SubGhzWorkerPairCallback pair_callback;
+    void* context;
+};
+#endif
+
 RawSamplesBuffer *RawSamples, *DetectedSamples;
 extern const SubGhzProtocolRegistry protoview_protocol_registry;
 
@@ -75,6 +101,11 @@ ProtoViewApp* protoview_app_alloc() {
 
     /* Setup rx worker and environment. */
     app->txrx->worker = subghz_worker_alloc();
+
+#ifdef PROTOVIEW_DISABLE_SUBGHZ_FILTER
+    app->txrx->worker->filter_running = 0;
+#endif
+
     app->txrx->environment = subghz_environment_alloc();
     subghz_environment_set_protocol_registry(
         app->txrx->environment, (void*)&protoview_protocol_registry);