better error message

This commit is contained in:
rusefi 2018-05-20 13:36:15 -04:00
parent c757009065
commit 5f9c44c094
1 changed files with 4 additions and 1 deletions

View File

@ -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);