PWM name into warning message
This commit is contained in:
parent
35ffb13ca4
commit
a89d819318
|
@ -2073,7 +2073,7 @@ typedef enum {
|
||||||
CUSTOM_ERR_TIMER_TEST_CALLBACK_WRONG_TIME = 6708,
|
CUSTOM_ERR_TIMER_TEST_CALLBACK_WRONG_TIME = 6708,
|
||||||
CUSTOM_ERR_6709 = 6709,
|
CUSTOM_ERR_6709 = 6709,
|
||||||
CUSTOM_DUTY_INVALID = 6710,
|
CUSTOM_DUTY_INVALID = 6710,
|
||||||
CUSTOM_DUTY_TOO_HIGH = 6711,
|
CUSTOM_PWM_DUTY_TOO_HIGH = 6711,
|
||||||
CUSTOM_ERR_PWM_STATE_ASSERT = 6712,
|
CUSTOM_ERR_PWM_STATE_ASSERT = 6712,
|
||||||
CUSTOM_ERR_PWM_CALLBACK_ASSERT = 6713,
|
CUSTOM_ERR_PWM_CALLBACK_ASSERT = 6713,
|
||||||
CUSTOM_ERR_PWM_SWITCH_ASSERT = 6714,
|
CUSTOM_ERR_PWM_SWITCH_ASSERT = 6714,
|
||||||
|
|
|
@ -67,13 +67,13 @@ void SimplePwm::setSimplePwmDutyCycle(float dutyCycle) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (cisnan(dutyCycle)) {
|
if (cisnan(dutyCycle)) {
|
||||||
warning(CUSTOM_DUTY_INVALID, "spwd:dutyCycle %.2f", dutyCycle);
|
warning(CUSTOM_DUTY_INVALID, "%s spwd:dutyCycle %.2f", name, dutyCycle);
|
||||||
return;
|
return;
|
||||||
} else if (dutyCycle < 0) {
|
} 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;
|
dutyCycle = 0;
|
||||||
} else if (dutyCycle > 1) {
|
} 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;
|
dutyCycle = 1;
|
||||||
}
|
}
|
||||||
if (dutyCycle == 0.0f && stateChangeCallback != NULL) {
|
if (dutyCycle == 0.0f && stateChangeCallback != NULL) {
|
||||||
|
|
Loading…
Reference in New Issue