mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-11-09 16:41:21 +08:00
AP_Bootloader: support CAN multicast server
allows for fw update of network peripheral devices
This commit is contained in:
1 parent
f065548866
commit
ef4fce80fb
5 files changed
+48
-5
No files matched your search
@@ -50,7 +50,7 @@ static CANConfig cancfg = {
|
||||
// pipelining is not faster when using ChibiOS CAN driver
|
||||
#define FW_UPDATE_PIPELINE_LEN 1
|
||||
#else
|
||||
static ChibiOS::CANIface can_iface[HAL_NUM_CAN_IFACES];
|
||||
ChibiOS::CANIface can_iface[HAL_NUM_CAN_IFACES];
|
||||
#endif
|
||||
|
||||
#ifndef CAN_APP_VERSION_MAJOR
|
||||
@@ -863,16 +863,13 @@ void can_update()
|
||||
}
|
||||
|
||||
// printf to CAN LogMessage for debugging
|
||||
void can_printf(const char *fmt, ...)
|
||||
void can_vprintf(const char *fmt, va_list ap)
|
||||
{
|
||||
// only on H7 for now, where we have plenty of flash
|
||||
#if defined(STM32H7)
|
||||
uavcan_protocol_debug_LogMessage pkt {};
|
||||
uint8_t buffer[UAVCAN_PROTOCOL_DEBUG_LOGMESSAGE_MAX_SIZE];
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
uint32_t n = vsnprintf((char*)pkt.text.data, sizeof(pkt.text.data), fmt, ap);
|
||||
va_end(ap);
|
||||
pkt.text.len = MIN(n, sizeof(pkt.text.data));
|
||||
|
||||
uint32_t len = uavcan_protocol_debug_LogMessage_encode(&pkt, buffer, true);
|
||||
@@ -887,5 +884,28 @@ void can_printf(const char *fmt, ...)
|
||||
#endif // defined(STM32H7)
|
||||
}
|
||||
|
||||
// printf to CAN LogMessage for debugging
|
||||
void can_printf(const char *fmt, ...)
|
||||
{
|
||||
// only on H7 for now, where we have plenty of flash
|
||||
#if defined(STM32H7)
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
can_vprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
#endif // defined(STM32H7)
|
||||
}
|
||||
|
||||
void can_printf_severity(uint8_t severity, const char *fmt, ...)
|
||||
{
|
||||
// only on H7 for now, where we have plenty of flash
|
||||
#if defined(STM32H7)
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
can_vprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#endif // HAL_USE_CAN
|
||||
Reference in new issue
Block a user