Skip to content

Commit b0d7e1f

Browse files
committed
[build] Fix multiple compilation warnings
1 parent f01fd0a commit b0d7e1f

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

ext/hathach/module.lb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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
# -----------------------------------------------------------------------------

src/modm/platform/core/cortex/assert.cpp.in

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ modm_assert_report(_modm_assertion_info *cinfo)
8484
}
8585
}
8686

87-
// Mingw64 :facepalm;
88-
#if defined(__MINGW64__) && !defined(__clang__)
89-
#define PRIuPTR "I64u"
90-
#endif
91-
9287
modm_weak
9388
void modm_abandon(const modm::AssertionInfo &info)
9489
{

src/modm/platform/i2c/sam_x7x/i2c_master.hpp.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)