@@ -262,8 +262,6 @@ typedef struct SettingsDataStruct {
262262 #if ENABLED(FILAMENT_SWITCH_AND_MOTION)
263263 float runout_motion_distance_mm; // M412 L
264264 #endif
265- #else
266- uint8_t runout_placeholder[3 ]; // Keeps layout stable when sensor disabled
267265 #endif
268266
269267 //
@@ -984,10 +982,10 @@ void MarlinSettings::postprocess() {
984982 //
985983 #if HAS_FILAMENT_SENSOR
986984 {
987- bool runout_enabled[ NUM_RUNOUT_SENSORS ] ;
988- bool runout_monitoring ;
985+ bool runout_monitoring ;
986+ bool runout_enabled[ NUM_RUNOUT_SENSORS ] ;
989987 #if HAS_FILAMENT_RUNOUT_DISTANCE
990- float runout_distance_mm[NUM_RUNOUT_SENSORS ];
988+ float runout_distance_mm[NUM_RUNOUT_SENSORS ];
991989 #endif
992990 uint8_t runout_mode[NUM_RUNOUT_SENSORS ];
993991 for (uint8_t e = 0 ; e < NUM_RUNOUT_SENSORS ; ++e) {
@@ -1009,12 +1007,6 @@ void MarlinSettings::postprocess() {
10091007 EEPROM_WRITE (runout.motion_distance ());
10101008 #endif
10111009 }
1012- #else
1013- {
1014- uint8_t runout_placeholder[3 ] = { 0 };
1015- _FIELD_TEST (runout_placeholder);
1016- EEPROM_WRITE (runout_placeholder);
1017- }
10181010 #endif
10191011
10201012 //
@@ -2095,12 +2087,6 @@ void MarlinSettings::postprocess() {
20952087 runout.reset ();
20962088 }
20972089 }
2098- #else
2099- {
2100- uint8_t runout_placeholder[3 ];
2101- _FIELD_TEST (runout_placeholder);
2102- EEPROM_READ (runout_placeholder);
2103- }
21042090 #endif
21052091
21062092 //
@@ -3419,21 +3405,21 @@ void MarlinSettings::reset() {
34193405 //
34203406
34213407 #if HAS_FILAMENT_SENSOR
3422- {
3423- constexpr bool runout_enabled_defaults[] = FIL_RUNOUT_ENABLED ;
3424- constexpr uint8_t runout_mode_defaults[] = FIL_RUNOUT_MODE ;
3425- static_assert (COUNT (runout_enabled_defaults) == NUM_RUNOUT_SENSORS , " FIL_RUNOUT_ENABLED must have NUM_RUNOUT_SENSORS entries." );
3426- static_assert (COUNT (runout_mode_defaults) == NUM_RUNOUT_SENSORS , " FIL_RUNOUT_MODE must have NUM_RUNOUT_SENSORS entries." );
3427- COPY (runout.enabled , runout_enabled_defaults);
3428- runout.monitoring = true ;
3429- for (uint8_t e = 0 ; e < NUM_RUNOUT_SENSORS ; ++e) {
3430- runout.mode [e] = (RunoutMode)runout_mode_defaults[e];
3431- #if HAS_FILAMENT_RUNOUT_DISTANCE
3432- runout.set_runout_distance (FILAMENT_RUNOUT_DISTANCE_MM , e);
3433- #endif
3434- }
3408+ {
3409+ constexpr bool runout_enabled_defaults[] = FIL_RUNOUT_ENABLED ;
3410+ constexpr uint8_t runout_mode_defaults[] = FIL_RUNOUT_MODE ;
3411+ static_assert (COUNT (runout_enabled_defaults) == NUM_RUNOUT_SENSORS , " FIL_RUNOUT_ENABLED must have NUM_RUNOUT_SENSORS entries." );
3412+ static_assert (COUNT (runout_mode_defaults) == NUM_RUNOUT_SENSORS , " FIL_RUNOUT_MODE must have NUM_RUNOUT_SENSORS entries." );
3413+ COPY (runout.enabled , runout_enabled_defaults);
3414+ runout.monitoring = true ;
3415+ for (uint8_t e = 0 ; e < NUM_RUNOUT_SENSORS ; ++e) {
3416+ runout.mode [e] = (RunoutMode)runout_mode_defaults[e];
3417+ #if HAS_FILAMENT_RUNOUT_DISTANCE
3418+ runout.set_runout_distance (FILAMENT_RUNOUT_DISTANCE_MM , e);
3419+ #endif
34353420 }
34363421 runout.reset ();
3422+ }
34373423 #endif
34383424
34393425 //
@@ -4204,7 +4190,10 @@ void MarlinSettings::reset() {
42044190 //
42054191 // Filament Runout Sensor
42064192 //
4207- TERN_ (HAS_FILAMENT_SENSOR , gcode.M591_report (forReplay));
4193+ #if HAS_FILAMENT_SENSOR
4194+ gcode.M412_report (forReplay);
4195+ gcode.M591_report (forReplay);
4196+ #endif
42084197
42094198 #if HAS_ETHERNET
42104199 CONFIG_ECHO_HEADING (" Ethernet" );
0 commit comments