better error handling

This commit is contained in:
rusefi 2017-03-12 15:57:33 -04:00
parent e0ae6eb7fd
commit 10e5cc8702
1 changed files with 7 additions and 1 deletions

View File

@ -105,6 +105,9 @@ void FuelSchedule::clear() {
isReady = false;
}
/**
* @returns false in case of error, true if success
*/
bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_S) {
efiAssert(engine!=NULL, "engine is NULL", false);
@ -183,7 +186,10 @@ bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_S) {
ev->isSimultanious = isSimultanious;
efiAssert(TRIGGER_SHAPE(getSize()) > 0, "uninitialized TriggerShape", false);
if (TRIGGER_SHAPE(getSize()) < 1) {
warning(CUSTOM_ERR_6111, "uninitialized TriggerShape");
return false;
}
TRIGGER_SHAPE(findTriggerPosition(&ev->injectionStart, angle PASS_ENGINE_PARAMETER));
#if EFI_UNIT_TEST || defined(__DOXYGEN__)