From 464dc9102f28d85144bdbb572c1acf987d2910bc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 27 Jun 2018 13:30:56 +1000 Subject: [PATCH] AP_HAL: added device types for SITL and fixed a stack init bug for make_bus_id --- libraries/AP_HAL/Device.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL/Device.h b/libraries/AP_HAL/Device.h index 7768618050..c592578225 100644 --- a/libraries/AP_HAL/Device.h +++ b/libraries/AP_HAL/Device.h @@ -30,7 +30,8 @@ public: BUS_TYPE_UNKNOWN = 0, BUS_TYPE_I2C = 1, BUS_TYPE_SPI = 2, - BUS_TYPE_UAVCAN = 3 + BUS_TYPE_UAVCAN = 3, + BUS_TYPE_SITL = 4 }; enum Speed { @@ -230,7 +231,7 @@ public: * the standard HAL Device types, such as UAVCAN devices */ static uint32_t make_bus_id(enum BusType bus_type, uint8_t bus, uint8_t address, uint8_t devtype) { - union DeviceId d; + union DeviceId d {}; d.devid_s.bus_type = bus_type; d.devid_s.bus = bus; d.devid_s.address = address;