Selaa lähdekoodia

Matching sign across filwidth vars

Scott Lahteine 7 vuotta sitten
vanhempi
commit
913d9e9a59

+ 3
- 3
Marlin/src/feature/filwidth.cpp Näytä tiedosto

@@ -29,8 +29,8 @@
29 29
 bool filament_sensor = false;                                 // M405/M406 turns filament sensor control ON/OFF.
30 30
 float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA,  // Nominal filament width. Change with M404.
31 31
       filament_width_meas = DEFAULT_MEASURED_FILAMENT_DIA;    // Measured filament diameter
32
-uint8_t meas_delay_cm = MEASUREMENT_DELAY_CM,                 // Distance delay setting
33
-        measurement_delay[MAX_MEASUREMENT_DELAY + 1];         // Ring buffer to delayed measurement. Store extruder factor after subtracting 100
34
-int8_t filwidth_delay_index[2] = { 0, -1 };                   // Indexes into ring buffer
32
+uint8_t meas_delay_cm = MEASUREMENT_DELAY_CM;                 // Distance delay setting
33
+int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1],          // Ring buffer to delayed measurement. Store extruder factor after subtracting 100
34
+       filwidth_delay_index[2] = { 0, -1 };                   // Indexes into ring buffer
35 35
 
36 36
 #endif // FILAMENT_WIDTH_SENSOR

+ 6
- 6
Marlin/src/feature/filwidth.h Näytä tiedosto

@@ -25,11 +25,11 @@
25 25
 
26 26
 #include "../inc/MarlinConfig.h"
27 27
 
28
-extern bool filament_sensor;                                  // M405/M406 turns filament sensor control ON/OFF.
29
-extern float filament_width_nominal,                          // Nominal filament width. Change with M404.
30
-             filament_width_meas;                             // Measured filament diameter
31
-extern uint8_t meas_delay_cm,                                 // Distance delay setting
32
-               measurement_delay[MAX_MEASUREMENT_DELAY + 1];  // Ring buffer to delayed measurement. Store extruder factor after subtracting 100
33
-extern int8_t filwidth_delay_index[2];                        // Indexes into ring buffer
28
+extern bool filament_sensor;                                // M405/M406 turns filament sensor control ON/OFF.
29
+extern float filament_width_nominal,                        // Nominal filament width. Change with M404.
30
+             filament_width_meas;                           // Measured filament diameter
31
+extern uint8_t meas_delay_cm;                               // Distance delay setting
32
+extern int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1], // Ring buffer to delayed measurement. Store extruder factor after subtracting 100
33
+              filwidth_delay_index[2];                      // Indexes into ring buffer
34 34
 
35 35
 #endif // __FILWIDTH_H__

+ 1
- 1
Marlin/src/gcode/feature/filwidth/M404-M407.cpp Näytä tiedosto

@@ -56,7 +56,7 @@ void GcodeSuite::M405() {
56 56
   }
57 57
 
58 58
   if (filwidth_delay_index[1] == -1) { // Initialize the ring buffer if not done since startup
59
-    const uint8_t temp_ratio = thermalManager.widthFil_to_size_ratio();
59
+    const int8_t temp_ratio = thermalManager.widthFil_to_size_ratio();
60 60
 
61 61
     for (uint8_t i = 0; i < COUNT(measurement_delay); ++i)
62 62
       measurement_delay[i] = temp_ratio;

+ 1
- 1
Marlin/src/module/planner.cpp Näytä tiedosto

@@ -1092,7 +1092,7 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const
1092 1092
         // If the index has changed (must have gone forward)...
1093 1093
         if (filwidth_delay_index[0] != filwidth_delay_index[1]) {
1094 1094
           filwidth_e_count = 0; // Reset the E movement counter
1095
-          const uint8_t meas_sample = thermalManager.widthFil_to_size_ratio();
1095
+          const int8_t meas_sample = thermalManager.widthFil_to_size_ratio();
1096 1096
           do {
1097 1097
             filwidth_delay_index[1] = (filwidth_delay_index[1] + 1) % MMD_CM; // The next unused slot
1098 1098
             measurement_delay[filwidth_delay_index[1]] = meas_sample;         // Store the measurement

Loading…
Peruuta
Tallenna