From 5f9c44c0942c4046e64ee6e5994dd62a637018a0 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 20 May 2018 13:36:15 -0400 Subject: [PATCH] better error message --- firmware/hw_layer/microsecond_timer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/hw_layer/microsecond_timer.cpp b/firmware/hw_layer/microsecond_timer.cpp index fc8ad73034..71d5863a57 100644 --- a/firmware/hw_layer/microsecond_timer.cpp +++ b/firmware/hw_layer/microsecond_timer.cpp @@ -72,7 +72,10 @@ void setHardwareUsTimer(int32_t timeUs) { if (GPTDEVICE.state == GPT_ONESHOT) gptStopTimerI(&GPTDEVICE); - efiAssertVoid(GPTDEVICE.state == GPT_READY, "hw timer"); + if (GPTDEVICE.state != GPT_READY) { + firmwareError(CUSTOM_ERR_6541, "HW timer state %d", GPTDEVICE.state); + return; + } if (hasFirmwareError()) return; gptStartOneShotI(&GPTDEVICE, timeUs);