close #23
This commit is contained in:
@@ -47,6 +47,14 @@ Total length of `RC_DATA` payload is 9 bytes
|
||||
| 3 | RX supply volatage, sent in 0,1V |
|
||||
| 4 | RX analog input 1 sent in 0,1V |
|
||||
| 5 | RX analog input 2 sent in 0,1V |
|
||||
| 6 | Flags |
|
||||
|
||||
#### Flags
|
||||
|
||||
| Bit | Meaning |
|
||||
| ---- | ---- |
|
||||
| 00000001 | Device in Failsafe mode |
|
||||
|
||||
|
||||
### `PING` and `PONG` frames
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#define LORA_HARDWARE_SPI
|
||||
|
||||
// #define DEVICE_MODE_TX
|
||||
#define DEVICE_MODE_RX
|
||||
#define DEVICE_MODE_TX
|
||||
// #define DEVICE_MODE_RX
|
||||
|
||||
#define FEATURE_TX_OLED
|
||||
|
||||
|
||||
9
qsp.cpp
9
qsp.cpp
@@ -61,6 +61,14 @@ void encodeRxHealthPayload(QspConfiguration_t *qsp, RxDeviceState_t *rxDeviceSta
|
||||
qsp->payload[3] = rxDeviceState->a1Voltage;
|
||||
qsp->payload[4] = rxDeviceState->a2Voltage;
|
||||
|
||||
uint8_t flags = 0;
|
||||
|
||||
if (qsp->deviceState == DEVICE_STATE_FAILSAFE) {
|
||||
flags |= 0x01 << 0;
|
||||
}
|
||||
|
||||
qsp->payload[5] = flags;
|
||||
|
||||
qsp->payloadLength = 6;
|
||||
}
|
||||
|
||||
@@ -70,6 +78,7 @@ void decodeRxHealthPayload(QspConfiguration_t *qsp, RxDeviceState_t *rxDeviceSta
|
||||
rxDeviceState->rxVoltage = qsp->payload[2];
|
||||
rxDeviceState->a1Voltage = qsp->payload[3];
|
||||
rxDeviceState->a2Voltage = qsp->payload[4];
|
||||
rxDeviceState->flags = qsp->payload[5];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -89,4 +89,5 @@ struct RxDeviceState_t {
|
||||
uint8_t a1Voltage = 0;
|
||||
uint8_t a2Voltage = 0;
|
||||
uint32_t roundtrip = 0;
|
||||
uint8_t flags = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user