mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-06-29 10:20:55 +00:00
Fix and improve EEPROM storage (#12054)
* Clean up Temperature PID * Improve EEPROM read/write/validate * Group `SINGLENOZZLE` saved settings * Group planner saved settings * Group filament change saved settings * Group skew saved settings * Group `FWRETRACT` saved settings
This commit is contained in:
parent
9b5c1a5e77
commit
d556dc1865
35 changed files with 1151 additions and 1246 deletions
Marlin/src/module
|
@ -2413,7 +2413,7 @@ void Stepper::report_positions() {
|
|||
#if HAS_MOTOR_CURRENT_PWM
|
||||
|
||||
void Stepper::refresh_motor_power() {
|
||||
for (uint8_t i = 0; i < COUNT(motor_current_setting); ++i) {
|
||||
LOOP_L_N(i, COUNT(motor_current_setting)) {
|
||||
switch (i) {
|
||||
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
|
||||
case 0:
|
||||
|
@ -2443,7 +2443,7 @@ void Stepper::report_positions() {
|
|||
|
||||
#elif HAS_MOTOR_CURRENT_PWM
|
||||
|
||||
if (WITHIN(driver, 0, 2))
|
||||
if (WITHIN(driver, 0, COUNT(motor_current_setting) - 1))
|
||||
motor_current_setting[driver] = current; // update motor_current_setting
|
||||
|
||||
#define _WRITE_CURRENT_PWM(P) analogWrite(MOTOR_CURRENT_PWM_## P ##_PIN, 255L * current / (MOTOR_CURRENT_PWM_RANGE))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue