better error message

This commit is contained in:
rusefi 2018-01-21 16:06:03 -05:00
parent 5ca6b5dfca
commit 0fe7598c7d
1 changed files with 3 additions and 1 deletions

View File

@ -52,7 +52,9 @@ void PwmConfig::init(float *st, single_wave_s *waves) {
* @param dutyCycle value between 0 and 1
*/
void SimplePwm::setSimplePwmDutyCycle(float dutyCycle) {
efiAssertVoid(dutyCycle >= 0 && dutyCycle <= 1, "spwd:dutyCycle");
if (dutyCycle < 0 || dutyCycle > 1) {
firmwareError(CUSTOM_ERR_ASSERT_VOID, "spwd:dutyCycle %f", dutyCycle);
}
multiWave.setSwitchTime(0, dutyCycle);
}