HAL_ChibiOS: fixed gcc9 warnings

This commit is contained in:
Andrew Tridgell 2020-09-21 09:46:31 +10:00
parent fabbbea0b4
commit 90cd2a38b6
3 changed files with 6 additions and 5 deletions

View File

@ -220,10 +220,10 @@ public:
// CAN Peripheral register structure
static constexpr bxcan::CanType* const Can[HAL_NUM_CAN_IFACES] = {
reinterpret_cast<bxcan::CanType*>(0x40006400)
reinterpret_cast<bxcan::CanType*>(uintptr_t(0x40006400U))
#if HAL_NUM_CAN_IFACES > 1
,
reinterpret_cast<bxcan::CanType*>(0x40006800)
reinterpret_cast<bxcan::CanType*>(uintptr_t(0x40006800U))
#endif
};
};

View File

@ -143,6 +143,7 @@ int __wrap_scanf(const char *fmt, ...)
}
extern "C" {
// alias fiprintf() to fprintf(). This saves flash space
int __wrap_fiprintf(const char *fmt, ...) __attribute__((alias("__wrap_fprintf")));
// empty function fiprintf(), saves flash space for unused code path
int __wrap_fiprintf(const char *fmt, ...);
int __wrap_fiprintf(const char *fmt, ...) { return -1; }
}

View File

@ -83,7 +83,7 @@ static void save_fault_watchdog(uint16_t line, FaultType fault_type, uint32_t fa
pd.fault_thd_prio = tp->prio;
// get first 4 bytes of the name, but only of first fault
if (tp->name && pd.thread_name4[0] == 0) {
strncpy(pd.thread_name4, tp->name, 4);
strncpy_noterm(pd.thread_name4, tp->name, 4);
}
}
pd.fault_icsr = SCB->ICSR;