From c5c16e97f8e291d355ef7b51fd3b34e268248cfc Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Thu, 8 Oct 2015 18:54:40 -0400 Subject: [PATCH 1/2] Fix -Wundef warning by defining UAVCAN_STM32_BAREMETAL to 0 if it is not defined --- .../stm32/driver/include/uavcan_stm32/build_config.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libuavcan_drivers/stm32/driver/include/uavcan_stm32/build_config.hpp b/libuavcan_drivers/stm32/driver/include/uavcan_stm32/build_config.hpp index 3eba3ba6bf..b3bf403594 100644 --- a/libuavcan_drivers/stm32/driver/include/uavcan_stm32/build_config.hpp +++ b/libuavcan_drivers/stm32/driver/include/uavcan_stm32/build_config.hpp @@ -15,6 +15,10 @@ # define UAVCAN_STM32_NUTTX 0 #endif +#ifndef UAVCAN_STM32_BAREMETAL +# define UAVCAN_STM32_BAREMETAL 0 +#endif + /** * Number of interfaces must be enabled explicitly */ From 45eb37d905489c3ed4305ac2981959d437d84c7d Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Thu, 8 Oct 2015 19:07:14 -0400 Subject: [PATCH 2/2] Use a constructor in UtcSyncParams to compile in C++03 without warnings --- .../driver/include/uavcan_stm32/clock.hpp | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/libuavcan_drivers/stm32/driver/include/uavcan_stm32/clock.hpp b/libuavcan_drivers/stm32/driver/include/uavcan_stm32/clock.hpp index b11438d787..eeceaf3d77 100644 --- a/libuavcan_drivers/stm32/driver/include/uavcan_stm32/clock.hpp +++ b/libuavcan_drivers/stm32/driver/include/uavcan_stm32/clock.hpp @@ -50,13 +50,23 @@ void adjustUtc(uavcan::UtcDuration adjustment); */ struct UtcSyncParams { - float offset_p = 0.01F; ///< PPM per one usec error - float rate_i = 0.02F; ///< PPM per one PPM error for second - float rate_error_corner_freq = 0.01F; - float max_rate_correction_ppm = 300.0F; - float lock_thres_rate_ppm = 2.0F; - uavcan::UtcDuration lock_thres_offset = uavcan::UtcDuration::fromMSec(4); - uavcan::UtcDuration min_jump = uavcan::UtcDuration::fromMSec(10); ///< Min error to jump rather than change rate + float offset_p; ///< PPM per one usec error + float rate_i; ///< PPM per one PPM error for second + float rate_error_corner_freq; + float max_rate_correction_ppm; + float lock_thres_rate_ppm; + uavcan::UtcDuration lock_thres_offset; + uavcan::UtcDuration min_jump; ///< Min error to jump rather than change rate + + UtcSyncParams() + : offset_p(0.01F) + , rate_i(0.02F) + , rate_error_corner_freq(0.01F) + , max_rate_correction_ppm(300.0F) + , lock_thres_rate_ppm(2.0F) + , lock_thres_offset(uavcan::UtcDuration::fromMSec(4)) + , min_jump(uavcan::UtcDuration::fromMSec(10)) + { } }; /**