Browse Source

AP_HAL_Periph: assert clock is FDCANCLK is 80MHz for H7 boards

apm_2208
bugobliterator 3 years ago committed by Andrew Tridgell
parent
commit
6a0c46d241
  1. 8
      libraries/AP_HAL_ChibiOS/CANFDIface.cpp

8
libraries/AP_HAL_ChibiOS/CANFDIface.cpp

@ -87,7 +87,13 @@ @@ -87,7 +87,13 @@
extern AP_HAL::HAL& hal;
static_assert(STM32_FDCANCLK <= 80U*1000U*1000U, "FDCAN clock must be max 80MHz");
#define STR(x) #x
#define XSTR(x) STR(x)
#if defined(STM32H7)
static_assert(STM32_FDCANCLK == 80U*1000U*1000U, "FDCAN clock must be 80MHz, got " XSTR(STM32_FDCANCLK));
#else
static_assert(STM32_FDCANCLK <= 80U*1000U*1000U, "FDCAN clock must be max 80MHz, got " XSTR(STM32_FDCANCLK));
#endif
using namespace ChibiOS;

Loading…
Cancel
Save