Show unknown error ID
This commit is contained in:
		@ -4,6 +4,8 @@
 | 
			
		||||
#include "touchgfx/Unicode.hpp"
 | 
			
		||||
#include "vehicle.h"
 | 
			
		||||
 | 
			
		||||
#include <cstdio>
 | 
			
		||||
 | 
			
		||||
ErrorPopup::ErrorPopup() {}
 | 
			
		||||
 | 
			
		||||
void ErrorPopup::initialize() { ErrorPopupBase::initialize(); }
 | 
			
		||||
@ -39,7 +41,10 @@ void ErrorPopup::showAMSError() {
 | 
			
		||||
      panicKindStr = "OPEN WIRE";
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      panicKindStr = "UNKNOWN";
 | 
			
		||||
      static char unknownPanicBuf[32];
 | 
			
		||||
      snprintf(unknownPanicBuf, sizeof(unknownPanicBuf), "UNKNOWN (%02x)",
 | 
			
		||||
               vehicle_state.last_ams_slave_panic.kind);
 | 
			
		||||
      panicKindStr = unknownPanicBuf;
 | 
			
		||||
    }
 | 
			
		||||
    touchgfx::Unicode::UnicodeChar panicKindBuf[32];
 | 
			
		||||
    touchgfx::Unicode::strncpy(panicKindBuf, panicKindStr,
 | 
			
		||||
@ -65,8 +70,9 @@ void ErrorPopup::showAMSError() {
 | 
			
		||||
    break;
 | 
			
		||||
  case AMS_ERROR_NONE:
 | 
			
		||||
  default:
 | 
			
		||||
    touchgfx::Unicode::strncpy(detailsBuffer, "UNKNOWN ERROR",
 | 
			
		||||
                               sizeof(detailsBuffer) / sizeof(*detailsBuffer));
 | 
			
		||||
    touchgfx::Unicode::snprintf(
 | 
			
		||||
        detailsBuffer, sizeof(detailsBuffer) / sizeof(*detailsBuffer),
 | 
			
		||||
        "UNKNOWN ERROR (%02x)", vehicle_state.last_ams_error.kind);
 | 
			
		||||
    break;
 | 
			
		||||
  }
 | 
			
		||||
  details.setWildcard(detailsBuffer);
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user