From e35f2538038858d93d020d06f96a27eb080a3ba0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 8 Dec 2019 22:49:06 +1100 Subject: [PATCH] HAL_ChibiOS: added assert for systime_t size --- libraries/AP_HAL_ChibiOS/system.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_HAL_ChibiOS/system.cpp b/libraries/AP_HAL_ChibiOS/system.cpp index 9c5a004082..51fa98d9f5 100644 --- a/libraries/AP_HAL_ChibiOS/system.cpp +++ b/libraries/AP_HAL_ChibiOS/system.cpp @@ -25,6 +25,12 @@ #include "hal.h" #include +#if CH_CFG_ST_RESOLUTION == 16 +static_assert(sizeof(systime_t) == 2, "expected 16 bit systime_t"); +#elif CH_CFG_ST_RESOLUTION == 32 +static_assert(sizeof(systime_t) == 4, "expected 32 bit systime_t"); +#endif + extern const AP_HAL::HAL& hal; extern "C" {