|
@@ -24,6 +24,8 @@
|
24
|
24
|
* temperature.cpp - temperature control
|
25
|
25
|
*/
|
26
|
26
|
|
|
27
|
+
|
|
28
|
+
|
27
|
29
|
#include "Marlin.h"
|
28
|
30
|
#include "ultralcd.h"
|
29
|
31
|
#include "temperature.h"
|
|
@@ -666,6 +668,17 @@ float Temperature::get_pid_output(int e) {
|
666
|
668
|
* - Apply filament width to the extrusion rate (may move)
|
667
|
669
|
* - Update the heated bed PID output value
|
668
|
670
|
*/
|
|
671
|
+
|
|
672
|
+/**
|
|
673
|
+ * The following line SOMETIMES results in the dreaded "unable to find a register to spill in class 'POINTER_REGS'"
|
|
674
|
+ * compile error.
|
|
675
|
+ * thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS);
|
|
676
|
+ *
|
|
677
|
+ * This is due to a bug in the C++ compiler used by the Arduino IDE from 1.6.10 to at least 1.8.1.
|
|
678
|
+ *
|
|
679
|
+ * The work around is to add the compiler flag "__attribute__((__optimize__("O2")))" to the declaration for manage_heater()
|
|
680
|
+ */
|
|
681
|
+//void Temperature::manage_heater() __attribute__((__optimize__("O2")));
|
669
|
682
|
void Temperature::manage_heater() {
|
670
|
683
|
|
671
|
684
|
if (!temp_meas_ready) return;
|