Browse Source

ADC sensor fix inspired by 'Evgen2' on Twitter

Scott Lahteine 7 years ago
parent
commit
662105c1b6
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      Marlin/temperature.cpp

+ 2
- 1
Marlin/temperature.cpp View File

@@ -2093,7 +2093,8 @@ void Temperature::isr() {
2093 2093
   } // temp_count >= OVERSAMPLENR
2094 2094
 
2095 2095
   // Go to the next state, up to SensorsReady
2096
-  adc_sensor_state = (ADCSensorState)((int(adc_sensor_state) + 1) % int(StartupDelay));
2096
+  adc_sensor_state = (ADCSensorState)(int(adc_sensor_state) + 1);
2097
+  if (adc_sensor_state > SensorsReady) adc_sensor_state = (ADCSensorState)0;
2097 2098
 
2098 2099
   #if ENABLED(BABYSTEPPING)
2099 2100
     LOOP_XYZ(axis) {

Loading…
Cancel
Save