Browse Source

improve lora rx auto reset

Thomas Buck 4 months ago
parent
commit
0e81983f59
2 changed files with 5 additions and 4 deletions
  1. 1
    1
      compile_commands.json
  2. 4
    3
      src/lora.cpp

+ 1
- 1
compile_commands.json View File

1
-.pio/build/loratx/compile_commands.json
1
+.pio/build/lorarx/compile_commands.json

+ 4
- 3
src/lora.cpp View File

368
 #endif // DEEP_SLEEP_TIMEOUT_MS && DEEP_SLEEP_DURATION_S
368
 #endif // DEEP_SLEEP_TIMEOUT_MS && DEEP_SLEEP_DURATION_S
369
 
369
 
370
 #ifndef FEATURE_SML
370
 #ifndef FEATURE_SML
371
-    if (time >= (6UL * 60UL * 60UL * 1000UL) // running for at least 6h
372
-        && ((time - last_rx) >= (30UL * 1000UL))) { // and last lora rx at least 30s ago
373
-        heltec_deep_sleep(10); // attempt reset to avoid lorarx hanging
371
+    if ((time >= (6UL * 60UL * 60UL * 1000UL) // running for at least 6h
372
+        && ((time - last_rx) >= (30UL * 1000UL))) // and last lora rx at least 30s ago
373
+        || ((time - last_rx) >= (4UL * 60UL * 1000UL))) { // or last message longer than 4min ago
374
+        heltec_deep_sleep(5); // attempt reset to avoid lorarx hanging
374
     }
375
     }
375
 #endif // ! FEATURE_SML
376
 #endif // ! FEATURE_SML
376
 
377
 

Loading…
Cancel
Save