AP_Radio: pack telemetry structures

This commit is contained in:
Andrew Tridgell 2018-01-18 19:34:24 +11:00
parent 4aa604a193
commit cc8a37b2fc

View File

@ -19,7 +19,7 @@ enum telem_type {
#define TELEM_FLAG_VIDEO (1U<<6) #define TELEM_FLAG_VIDEO (1U<<6)
#define TELEM_FLAG_HYBRID (1U<<7) #define TELEM_FLAG_HYBRID (1U<<7)
struct telem_status { struct PACKED telem_status {
uint8_t pps; // packets per second received uint8_t pps; // packets per second received
uint8_t rssi; // lowpass rssi uint8_t rssi; // lowpass rssi
uint8_t flags; // TELEM_FLAG_* uint8_t flags; // TELEM_FLAG_*
@ -30,13 +30,13 @@ struct telem_status {
}; };
// play a tune // play a tune
struct telem_play { struct PACKED telem_play {
uint8_t seq; uint8_t seq;
uint8_t tune_index; uint8_t tune_index;
}; };
// write to new firmware // write to new firmware
struct telem_firmware { struct PACKED telem_firmware {
uint8_t seq; uint8_t seq;
uint8_t len; uint8_t len;
uint16_t offset; uint16_t offset;
@ -46,7 +46,7 @@ struct telem_firmware {
/* /*
telemetry packet from RX to TX telemetry packet from RX to TX
*/ */
struct telem_packet { struct PACKED telem_packet {
uint8_t crc; // simple CRC uint8_t crc; // simple CRC
enum telem_type type; enum telem_type type;
union { union {
@ -67,7 +67,7 @@ enum tx_telem_type {
tx_status structure sent one byte at a time to RX. This is packed tx_status structure sent one byte at a time to RX. This is packed
into channels 8, 9 and 10 (using 32 bits of a possible 33) into channels 8, 9 and 10 (using 32 bits of a possible 33)
*/ */
struct telem_tx_status { struct PACKED telem_tx_status {
uint8_t crc; uint8_t crc;
enum tx_telem_type type; enum tx_telem_type type;
uint16_t data; uint16_t data;