File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/modm/platform/i2c/sam_x7x Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,9 @@ Configuration options:
269269
270270 def build (self , env ):
271271 env .outbasepath = "modm/ext/tinyusb"
272- env .copy ("tinyusb/src/device/" , "device/" )
272+ operations = env .copy ("tinyusb/src/device/" , "device/" )
273+ operations = [o for o in operations if "usbd.c" in o .filename ]
274+ env .collect (":build:ccflags" , "-Wno-bad-function-cast" , operations = operations )
273275
274276
275277# -----------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -79,15 +79,15 @@ private:
7979 constexpr bool fastMode = baudrate > 125'000;
8080 // Baudrate threshold above which the low time is fixed to the minimum value of
8181 // 1.3us in fast mode or 4.7us in standard mode.
82- constexpr auto minLowTime = fastMode ? 1.3e-6 : 4.7e-6 ;
82+ constexpr auto minLowTime = fastMode ? 1.3e-6f : 4.7e-6f ;
8383 constexpr auto minLowTimeLimit = 1.f / (2*minLowTime);
8484
8585 // t_high = ((CHDIV * 2^CKDIV) + 3) * (1 / peripheral clock)
8686 // t_low = ((CLDIV * 2^CKDIV) + 3) * (1 / peripheral clock)
8787 if constexpr (baudrate > minLowTimeLimit) {
8888 // calculate ideal low and high prescaler values (formula from ASF vendor HAL)
8989 constexpr auto cldiv = uint32_t(std::round((minLowTime * clock) - 3));
90- constexpr auto tHigh = 1.f / ((baudrate + (baudrate - minLowTimeLimit)) * 2.f);
90+ constexpr auto tHigh = 1.f / ((baudrate + float (baudrate - minLowTimeLimit)) * 2.f);
9191 constexpr auto chdiv = uint32_t(std::round((tHigh * clock) - 3));
9292
9393 // use 2^N pre-divider if max. prescaler exceeds 8 bits
You can’t perform that action at this time.
0 commit comments