|
@@ -616,12 +616,12 @@ static uint8_t target_extruder;
|
616
|
616
|
float cartes[XYZ] = { 0 };
|
617
|
617
|
|
618
|
618
|
#if ENABLED(FILAMENT_WIDTH_SENSOR)
|
619
|
|
- bool filament_sensor = false; //M405 turns on filament_sensor control, M406 turns it off
|
620
|
|
- float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA, // Nominal filament width. Change with M404
|
|
619
|
+ bool filament_sensor = false; // M405 turns on filament sensor control. M406 turns it off.
|
|
620
|
+ float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA, // Nominal filament width. Change with M404.
|
621
|
621
|
filament_width_meas = DEFAULT_MEASURED_FILAMENT_DIA; // Measured filament diameter
|
622
|
|
- int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1]; // Ring buffer to delayed measurement. Store extruder factor after subtracting 100
|
623
|
|
- int filwidth_delay_index[2] = { 0, -1 }; // Indexes into ring buffer
|
624
|
|
- int meas_delay_cm = MEASUREMENT_DELAY_CM; //distance delay setting
|
|
622
|
+ int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1]; // Ring buffer to delayed measurement. Store extruder factor after subtracting 100
|
|
623
|
+ int filwidth_delay_index[2] = { 0, -1 }; // Indexes into ring buffer
|
|
624
|
+ int meas_delay_cm = MEASUREMENT_DELAY_CM; // Distance delay setting
|
625
|
625
|
#endif
|
626
|
626
|
|
627
|
627
|
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
|
@@ -8220,10 +8220,10 @@ inline void gcode_M400() { stepper.synchronize(); }
|
8220
|
8220
|
NOMORE(meas_delay_cm, MAX_MEASUREMENT_DELAY);
|
8221
|
8221
|
|
8222
|
8222
|
if (filwidth_delay_index[1] == -1) { // Initialize the ring buffer if not done since startup
|
8223
|
|
- int temp_ratio = thermalManager.widthFil_to_size_ratio();
|
|
8223
|
+ const int temp_ratio = thermalManager.widthFil_to_size_ratio() - 100; // -100 to scale within a signed byte
|
8224
|
8224
|
|
8225
|
8225
|
for (uint8_t i = 0; i < COUNT(measurement_delay); ++i)
|
8226
|
|
- measurement_delay[i] = temp_ratio - 100; // Subtract 100 to scale within a signed byte
|
|
8226
|
+ measurement_delay[i] = temp_ratio;
|
8227
|
8227
|
|
8228
|
8228
|
filwidth_delay_index[0] = filwidth_delay_index[1] = 0;
|
8229
|
8229
|
}
|
|
@@ -10279,7 +10279,7 @@ void process_next_command() {
|
10279
|
10279
|
case 407: // M407: Display measured filament diameter
|
10280
|
10280
|
gcode_M407();
|
10281
|
10281
|
break;
|
10282
|
|
- #endif // ENABLED(FILAMENT_WIDTH_SENSOR)
|
|
10282
|
+ #endif // FILAMENT_WIDTH_SENSOR
|
10283
|
10283
|
|
10284
|
10284
|
#if PLANNER_LEVELING
|
10285
|
10285
|
case 420: // M420: Enable/Disable Bed Leveling
|