|
|
|
|
153
|
#if CURRENT_STEP_DOWN > 0
|
153
|
#if CURRENT_STEP_DOWN > 0
|
154
|
// Decrease current if is_otpw is true and driver is enabled and there's been more than 4 warnings
|
154
|
// Decrease current if is_otpw is true and driver is enabled and there's been more than 4 warnings
|
155
|
if (data.is_otpw && st.isEnabled() && st.otpw_count > 4) {
|
155
|
if (data.is_otpw && st.isEnabled() && st.otpw_count > 4) {
|
156
|
- st.rms_current(st.getMilliamps() - (CURRENT_STEP_DOWN));
|
|
|
|
|
156
|
+ st.rms_current(MAX(int16_t(st.getMilliamps() - (CURRENT_STEP_DOWN)), 0));
|
157
|
#if ENABLED(REPORT_CURRENT_CHANGE)
|
157
|
#if ENABLED(REPORT_CURRENT_CHANGE)
|
158
|
st.printLabel();
|
158
|
st.printLabel();
|
159
|
SERIAL_ECHOLNPAIR(" current decreased to ", st.getMilliamps());
|
159
|
SERIAL_ECHOLNPAIR(" current decreased to ", st.getMilliamps());
|