diff --git a/TouchGFX/config/gcc/app.mk b/TouchGFX/config/gcc/app.mk index c8bb301..6f567ec 100644 --- a/TouchGFX/config/gcc/app.mk +++ b/TouchGFX/config/gcc/app.mk @@ -5,4 +5,4 @@ touchgfx_path := ../Middlewares/ST/touchgfx # Location of the TouchGFX Environment touchgfx_env := C:/TouchGFX/4.21.2/env # Optional additional compiler flags -user_cflags := -DUSE_BPP=16 -std=gnu++1z -Wno-cast-qual -Wno-missing-declarations -Wno-format-truncation +user_cflags := -DUSE_BPP=16 -std=gnu++1z -Wno-cast-qual -Wno-missing-declarations -Wno-format-truncation -Wno-unused-variable diff --git a/TouchGFX/gui/src/driverview_screen/DriverViewPresenter.cpp b/TouchGFX/gui/src/driverview_screen/DriverViewPresenter.cpp index 222b03a..215d18f 100644 --- a/TouchGFX/gui/src/driverview_screen/DriverViewPresenter.cpp +++ b/TouchGFX/gui/src/driverview_screen/DriverViewPresenter.cpp @@ -3,6 +3,11 @@ #include "gui/common/NamedField.hpp" +constexpr int32_t SHOW_ERRORS_FOR = 10000; // ms + +#ifndef SIMULATOR +#include "stm32h7xx_hal.h" +#endif #include "vehicle_state.h" DriverViewPresenter::DriverViewPresenter(DriverViewView &v) @@ -54,9 +59,15 @@ void DriverViewPresenter::updateProgress() { } void DriverViewPresenter::updateErrorPopup() { + static uint32_t last_error = 0; if (vehicle_state.ts_state == TS_ERROR) { view.showAMSError(); +#ifndef SIMULATOR + last_error = HAL_GetTick(); + } else if (HAL_GetTick() - last_error > SHOW_ERRORS_FOR) { +#else } else { +#endif view.clearErrorPopup(); } }