Fix crash when displaying slave panic
This commit is contained in:
parent
02ea501c81
commit
7b335536e2
|
@ -38,13 +38,15 @@ void ErrorPopup::showAMSError() {
|
|||
case AMS_SLAVEPANIC_OPENWIRE:
|
||||
panicKindStr = "OPEN WIRE";
|
||||
break;
|
||||
default:
|
||||
panicKindStr = "UNKNOWN";
|
||||
}
|
||||
touchgfx::Unicode::UnicodeChar panicKindBuf[32];
|
||||
touchgfx::Unicode::strncpy(panicKindBuf, panicKindStr,
|
||||
sizeof(panicKindBuf) / sizeof(*panicKindBuf));
|
||||
touchgfx::Unicode::snprintf(
|
||||
detailsBuffer, sizeof(detailsBuffer) / sizeof(*detailsBuffer),
|
||||
"Slave panic: Slave %d\n[ID: %d, Kind: %s, Arg: %08x]",
|
||||
"Slave panic:\n[ID: %d, Kind: %s, Arg: %08x]",
|
||||
vehicle_state.last_ams_slave_panic.id, panicKindBuf,
|
||||
vehicle_state.last_ams_slave_panic.arg);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue