Browse Source

HAL_ChibiOS: fixed gcc9 warnings

c415-sdk
Andrew Tridgell 4 years ago
parent
commit
90cd2a38b6
  1. 4
      libraries/AP_HAL_ChibiOS/CANIface.h
  2. 5
      libraries/AP_HAL_ChibiOS/stdio.cpp
  3. 2
      libraries/AP_HAL_ChibiOS/system.cpp

4
libraries/AP_HAL_ChibiOS/CANIface.h

@ -220,10 +220,10 @@ public: @@ -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
};
};

5
libraries/AP_HAL_ChibiOS/stdio.cpp

@ -143,6 +143,7 @@ int __wrap_scanf(const char *fmt, ...) @@ -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; }
}

2
libraries/AP_HAL_ChibiOS/system.cpp

@ -83,7 +83,7 @@ static void save_fault_watchdog(uint16_t line, FaultType fault_type, uint32_t fa @@ -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;

Loading…
Cancel
Save