Pārlūkot izejas kodu

Patches to work around "register spill" compiler bug

Scott Lahteine 8 gadus atpakaļ
vecāks
revīzija
6618346148
2 mainītis faili ar 15 papildinājumiem un 1 dzēšanām
  1. 13
    0
      Marlin/temperature.cpp
  2. 2
    1
      Marlin/temperature.h

+ 13
- 0
Marlin/temperature.cpp Parādīt failu

24
  * temperature.cpp - temperature control
24
  * temperature.cpp - temperature control
25
  */
25
  */
26
 
26
 
27
+
28
+
27
 #include "Marlin.h"
29
 #include "Marlin.h"
28
 #include "ultralcd.h"
30
 #include "ultralcd.h"
29
 #include "temperature.h"
31
 #include "temperature.h"
666
  *  - Apply filament width to the extrusion rate (may move)
668
  *  - Apply filament width to the extrusion rate (may move)
667
  *  - Update the heated bed PID output value
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
 void Temperature::manage_heater() {
682
 void Temperature::manage_heater() {
670
 
683
 
671
   if (!temp_meas_ready) return;
684
   if (!temp_meas_ready) return;

+ 2
- 1
Marlin/temperature.h Parādīt failu

241
     /**
241
     /**
242
      * Call periodically to manage heaters
242
      * Call periodically to manage heaters
243
      */
243
      */
244
-    static void manage_heater();
244
+    //static void manage_heater(); // changed to address compiler error
245
+    static void manage_heater()  __attribute__((__optimize__("O2")));
245
 
246
 
246
     /**
247
     /**
247
      * Preheating hotends
248
      * Preheating hotends

Notiek ielāde…
Atcelt
Saglabāt