Ver Fonte

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

Dusan Zivkovic há 3 anos atrás
pai
commit
1dd1c352a2
1 ficheiros alterados com 2 adições e 1 exclusões
  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);
     }