Parcourir la source

improve lora rx auto reset

Thomas Buck il y a 2 mois
Parent
révision
0e81983f59
2 fichiers modifiés avec 5 ajouts et 4 suppressions
  1. 1
    1
      compile_commands.json
  2. 4
    3
      src/lora.cpp

+ 1
- 1
compile_commands.json Voir le fichier

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

+ 4
- 3
src/lora.cpp Voir le fichier

@@ -368,9 +368,10 @@ void lora_run(void) {
368 368
 #endif // DEEP_SLEEP_TIMEOUT_MS && DEEP_SLEEP_DURATION_S
369 369
 
370 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 376
 #endif // ! FEATURE_SML
376 377
 

Chargement…
Annuler
Enregistrer