TX module LED indication
This commit is contained in:
@@ -648,8 +648,24 @@ void loop(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Handle LED updates
|
||||
*/
|
||||
if (txDeviceState.nextLedUpdate < currentMillis) {
|
||||
|
||||
if (txDeviceState.isReceiving) {
|
||||
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
|
||||
txDeviceState.nextLedUpdate = currentMillis + 300;
|
||||
} else if (txInput.isReceiving()) {
|
||||
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
|
||||
txDeviceState.nextLedUpdate = currentMillis + 100;
|
||||
} else {
|
||||
digitalWrite(LED_BUILTIN, HIGH);
|
||||
txDeviceState.nextLedUpdate = currentMillis + 200;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ struct TxDeviceState_t {
|
||||
uint8_t flags = 0;
|
||||
uint32_t roundtrip = 0;
|
||||
bool isReceiving = false; //Indicates that TX module is receiving frames from RX module
|
||||
uint32_t nextLedUpdate = 0;
|
||||
};
|
||||
|
||||
struct RxDeviceState_t {
|
||||
|
||||
Reference in New Issue
Block a user