PWM name into warning message

This commit is contained in:
rusEfi 2020-04-19 21:48:14 -04:00
parent 2203b2867a
commit 4854d123bb
2 changed files with 4 additions and 4 deletions

View File

@ -2073,7 +2073,7 @@ typedef enum {
CUSTOM_ERR_TIMER_TEST_CALLBACK_WRONG_TIME = 6708,
CUSTOM_ERR_6709 = 6709,
CUSTOM_DUTY_INVALID = 6710,
CUSTOM_DUTY_TOO_HIGH = 6711,
CUSTOM_PWM_DUTY_TOO_HIGH = 6711,
CUSTOM_ERR_PWM_STATE_ASSERT = 6712,
CUSTOM_ERR_PWM_CALLBACK_ASSERT = 6713,
CUSTOM_ERR_PWM_SWITCH_ASSERT = 6714,

View File

@ -67,13 +67,13 @@ void SimplePwm::setSimplePwmDutyCycle(float dutyCycle) {
return;
}
if (cisnan(dutyCycle)) {
warning(CUSTOM_DUTY_INVALID, "spwd:dutyCycle %.2f", dutyCycle);
warning(CUSTOM_DUTY_INVALID, "%s spwd:dutyCycle %.2f", name, dutyCycle);
return;
} else if (dutyCycle < 0) {
warning(CUSTOM_DUTY_TOO_LOW, "spwd:dutyCycle %.2f", dutyCycle);
warning(CUSTOM_DUTY_TOO_LOW, "%s dutyCycle %.2f", name, dutyCycle);
dutyCycle = 0;
} else if (dutyCycle > 1) {
warning(CUSTOM_DUTY_TOO_HIGH, "spwd:dutyCycle %.2f", dutyCycle);
warning(CUSTOM_PWM_DUTY_TOO_HIGH, "%s duty %.2f", name, dutyCycle);
dutyCycle = 1;
}
if (dutyCycle == 0.0f && stateChangeCallback != NULL) {