aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/drivers/device/device.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/drivers/device/device.h b/src/drivers/device/device.h
index c98386eb0..7df234cab 100644
--- a/src/drivers/device/device.h
+++ b/src/drivers/device/device.h
@@ -134,11 +134,14 @@ public:
};
/*
- broken out
+ broken out device elements. The bitfields are used to keep
+ the overall value small enough to fit in a float accurately,
+ which makes it possible to transport over the MAVLink
+ parameter protocol without loss of information.
*/
struct DeviceStructure {
- enum DeviceBusType bus_type;
- uint8_t bus; // which instance of the bus type
+ enum DeviceBusType bus_type:3;
+ uint8_t bus:5; // which instance of the bus type
uint8_t address; // address on the bus (eg. I2C address)
uint8_t devtype; // device class specific device type
};