Skip to content

Commit 54dd9df

Browse files
committed
usb clock 0.1% tolerance
1 parent e551cb3 commit 54dd9df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modm/platform/usb/stm32/usb.hpp.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include <modm/platform/device.hpp>
1616
#include <modm/platform/gpio/connector.hpp>
17+
#include <modm/math/tolerance.hpp>
1718

1819
%% set name = "Usb" ~ port | capitalize
1920

@@ -28,7 +29,7 @@ public:
2829
static void
2930
initialize(uint8_t priority=3)
3031
{
31-
static_assert(SystemClock::Usb == 48_MHz, "{{ name }} must have a 48MHz clock!");
32+
static_assert(isValueInTolerance(48_MHz, SystemClock::Usb, 0.1_pct), "{{ name }} must have a 48MHz clock!");
3233
%% if target.family in ["g0", "l4", "l5"]
3334
#ifdef PWR_CR2_USV
3435
PWR->CR2 |= PWR_CR2_USV;

0 commit comments

Comments
 (0)