Browse Source

Fix temp init, loosen ADC grace period

Scott Lahteine 6 years ago
parent
commit
9853331b34
2 changed files with 5 additions and 5 deletions
  1. 2
    2
      Marlin/src/HAL/HAL_LPC1768/HAL.h
  2. 3
    3
      Marlin/src/module/temperature.cpp

+ 2
- 2
Marlin/src/HAL/HAL_LPC1768/HAL.h View File

147
 #define HAL_READ_ADC()         FilteredADC::get_result()
147
 #define HAL_READ_ADC()         FilteredADC::get_result()
148
 #define HAL_ADC_READY()        FilteredADC::finished_conversion()
148
 #define HAL_ADC_READY()        FilteredADC::finished_conversion()
149
 
149
 
150
-// A grace period for the ADC readings to stabilize before they start causing thermal protection errors.
151
-#define THERMAL_PROTECTION_GRACE_PERIOD 800
150
+// A grace period to allow ADC readings to stabilize, preventing false alarms
151
+#define THERMAL_PROTECTION_GRACE_PERIOD 1000
152
 
152
 
153
 // Parse a G-code word into a pin index
153
 // Parse a G-code word into a pin index
154
 int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
154
 int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);

+ 3
- 3
Marlin/src/module/temperature.cpp View File

1531
     }while(0)
1531
     }while(0)
1532
     #define _TEMP_MAX_E(NR) do{ \
1532
     #define _TEMP_MAX_E(NR) do{ \
1533
       temp_range[NR].maxtemp = HEATER_ ##NR## _MAXTEMP; \
1533
       temp_range[NR].maxtemp = HEATER_ ##NR## _MAXTEMP; \
1534
-      while (analog_to_celsius_hotend(temp_range[NR].raw_min, NR) > HEATER_ ##NR## _MAXTEMP) \
1534
+      while (analog_to_celsius_hotend(temp_range[NR].raw_max, NR) > HEATER_ ##NR## _MAXTEMP) \
1535
         temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \
1535
         temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \
1536
     }while(0)
1536
     }while(0)
1537
 
1537
 
1589
       while (analog_to_celsius_bed(mintemp_raw_BED) < BED_MINTEMP) mintemp_raw_BED += TEMPDIR(BED) * (OVERSAMPLENR);
1589
       while (analog_to_celsius_bed(mintemp_raw_BED) < BED_MINTEMP) mintemp_raw_BED += TEMPDIR(BED) * (OVERSAMPLENR);
1590
     #endif
1590
     #endif
1591
     #ifdef BED_MAXTEMP
1591
     #ifdef BED_MAXTEMP
1592
-      while (analog_to_celsius_bed(maxtemp_raw_BED) > BED_MAXTEMP) mintemp_raw_BED -= TEMPDIR(BED) * (OVERSAMPLENR);
1592
+      while (analog_to_celsius_bed(maxtemp_raw_BED) > BED_MAXTEMP) maxtemp_raw_BED -= TEMPDIR(BED) * (OVERSAMPLENR);
1593
     #endif
1593
     #endif
1594
   #endif // HAS_HEATED_BED
1594
   #endif // HAS_HEATED_BED
1595
 
1595
 
1598
       while (analog_to_celsius_chamber(mintemp_raw_CHAMBER) < CHAMBER_MINTEMP) mintemp_raw_CHAMBER += TEMPDIR(CHAMBER) * (OVERSAMPLENR);
1598
       while (analog_to_celsius_chamber(mintemp_raw_CHAMBER) < CHAMBER_MINTEMP) mintemp_raw_CHAMBER += TEMPDIR(CHAMBER) * (OVERSAMPLENR);
1599
     #endif
1599
     #endif
1600
     #ifdef CHAMBER_MAXTEMP
1600
     #ifdef CHAMBER_MAXTEMP
1601
-      while (analog_to_celsius_chamber(maxtemp_raw_CHAMBER) > CHAMBER_MAXTEMP) mintemp_raw_CHAMBER -= TEMPDIR(CHAMBER) * (OVERSAMPLENR);
1601
+      while (analog_to_celsius_chamber(maxtemp_raw_CHAMBER) > CHAMBER_MAXTEMP) maxtemp_raw_CHAMBER -= TEMPDIR(CHAMBER) * (OVERSAMPLENR);
1602
     #endif
1602
     #endif
1603
   #endif
1603
   #endif
1604
 
1604
 

Loading…
Cancel
Save