Explorar el Código

RemoteIDModule.ino: properly set the bt4 sending period depending on the number of bt4 states

Dusan Zivkovic hace 3 años
padre
commit
1dd1c352a2
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      RemoteIDModule/RemoteIDModule.ino

+ 2 - 1
RemoteIDModule/RemoteIDModule.ino

@@ -393,8 +393,9 @@ void loop()
     }
 
     static uint32_t last_update_bt4_ms;
+    int bt4_states = UAS_data.BasicIDValid[1] ? 7 : 6;
     if (g.bt4_rate > 0 &&
-        now_ms - last_update_bt4_ms > 200/g.bt4_rate) {
+        now_ms - last_update_bt4_ms > (1000.0f/(bt4_states - 1))/g.bt4_rate) {
         last_update_bt4_ms = now_ms;
         ble.transmit_legacy(UAS_data);
     }