From 7be327967507955628087fa4aa36e8be1506996c Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Mon, 13 Mar 2023 16:57:57 +1300 Subject: [PATCH] cubeorangeplus: add check for SMPS support If NuttX is built without support for SMPS it can brick the hardware. Therefore, I suggest that we add this additional compile-time check. Signed-off-by: Julian Oes --- boards/cubepilot/cubeorangeplus/src/board_config.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/boards/cubepilot/cubeorangeplus/src/board_config.h b/boards/cubepilot/cubeorangeplus/src/board_config.h index 5cab2c5f82..ad81b75d1e 100644 --- a/boards/cubepilot/cubeorangeplus/src/board_config.h +++ b/boards/cubepilot/cubeorangeplus/src/board_config.h @@ -44,6 +44,16 @@ #include #include +/** + * If NuttX is built without support for SMPS it can brick the hardware. + * Therefore, we make sure the NuttX headers are correct. + */ +#include "hardware/stm32h7x3xx_pwr.h" +#if STM32_PWR_CR3_SMPSEXTHP != (1 << 3) +# error "No SMPS support in NuttX submodule"); +#endif + + /* PX4IO connection configuration */ #define BOARD_USES_PX4IO_VERSION 2 #define PX4IO_SERIAL_DEVICE "/dev/ttyS3"