Fix crash when displaying slave panic
This commit is contained in:
		@ -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;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user