Fix FILAMENT_WIDTH_SENSOR infinite loop issue

Addressing #6992 and #5851
This commit is contained in:
Scott Lahteine
2017-06-23 14:48:02 -05:00
parent a18324bc8d
commit a9f8e518bf
5 changed files with 15 additions and 15 deletions

View File

@ -180,7 +180,7 @@ int16_t Temperature::minttemp_raw[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_RAW_LO_TE
#endif
#if ENABLED(FILAMENT_WIDTH_SENSOR)
int16_t Temperature::meas_shift_index; // Index of a delayed sample in buffer
int8_t Temperature::meas_shift_index; // Index of a delayed sample in buffer
#endif
#if HAS_AUTO_FAN
@ -196,7 +196,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
#endif
#if ENABLED(FILAMENT_WIDTH_SENSOR)
int Temperature::current_raw_filwidth = 0; //Holds measured filament diameter - one extruder only
uint16_t Temperature::current_raw_filwidth = 0; // Measured filament diameter - one extruder only
#endif
#if ENABLED(PROBING_HEATERS_OFF)
@ -957,7 +957,7 @@ void Temperature::updateTemperaturesFromRawValues() {
// Convert raw Filament Width to millimeters
float Temperature::analog2widthFil() {
return current_raw_filwidth / 16383.0 * 5.0;
return current_raw_filwidth * 5.0 * (1.0 / 16383.0);
//return current_raw_filwidth;
}