Skip to content

Commit

Permalink
Match sign for filwidth across vars
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 20, 2017
1 parent 98159c0 commit 4f375cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Marlin/Marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,9 @@ void report_current_position();
extern bool filament_sensor; // Flag that filament sensor readings should control extrusion
extern float filament_width_nominal, // Theoretical filament diameter i.e., 3.00 or 1.75
filament_width_meas; // Measured filament diameter
extern uint8_t meas_delay_cm, // Delay distance
measurement_delay[]; // Ring buffer to delay measurement
extern int8_t filwidth_delay_index[2]; // Ring buffer indexes. Used by planner, temperature, and main code
extern uint8_t meas_delay_cm; // Delay distance
extern int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1], // Ring buffer to delay measurement
filwidth_delay_index[2]; // Ring buffer indexes. Used by planner, temperature, and main code
#endif

#if ENABLED(ADVANCED_PAUSE_FEATURE)
Expand Down
8 changes: 4 additions & 4 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,9 @@ float cartes[XYZ] = { 0 };
bool filament_sensor = false; // M405 turns on filament sensor control. M406 turns it off.
float filament_width_nominal = DEFAULT_NOMINAL_FILAMENT_DIA, // Nominal filament width. Change with M404.
filament_width_meas = DEFAULT_MEASURED_FILAMENT_DIA; // Measured filament diameter
uint8_t meas_delay_cm = MEASUREMENT_DELAY_CM, // Distance delay setting
measurement_delay[MAX_MEASUREMENT_DELAY + 1]; // Ring buffer to delayed measurement. Store extruder factor after subtracting 100
int8_t filwidth_delay_index[2] = { 0, -1 }; // Indexes into ring buffer
uint8_t meas_delay_cm = MEASUREMENT_DELAY_CM; // Distance delay setting
int8_t measurement_delay[MAX_MEASUREMENT_DELAY + 1], // Ring buffer to delayed measurement. Store extruder factor after subtracting 100
filwidth_delay_index[2] = { 0, -1 }; // Indexes into ring buffer
#endif

#if ENABLED(FILAMENT_RUNOUT_SENSOR)
Expand Down Expand Up @@ -9588,7 +9588,7 @@ inline void gcode_M400() { stepper.synchronize(); }
}

if (filwidth_delay_index[1] == -1) { // Initialize the ring buffer if not done since startup
const uint8_t temp_ratio = thermalManager.widthFil_to_size_ratio();
const int8_t temp_ratio = thermalManager.widthFil_to_size_ratio();

for (uint8_t i = 0; i < COUNT(measurement_delay); ++i)
measurement_delay[i] = temp_ratio;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ void Planner::_buffer_steps(const int32_t (&target)[XYZE], float fr_mm_s, const
// If the index has changed (must have gone forward)...
if (filwidth_delay_index[0] != filwidth_delay_index[1]) {
filwidth_e_count = 0; // Reset the E movement counter
const uint8_t meas_sample = thermalManager.widthFil_to_size_ratio();
const int8_t meas_sample = thermalManager.widthFil_to_size_ratio();
do {
filwidth_delay_index[1] = (filwidth_delay_index[1] + 1) % MMD_CM; // The next unused slot
measurement_delay[filwidth_delay_index[1]] = meas_sample; // Store the measurement
Expand Down

0 comments on commit 4f375cd

Please sign in to comment.