odewdney 10 years ago
parent
commit
39fae9e3a3
1 changed files with 18 additions and 1 deletions
  1. 18
    1
      Marlin/Marlin.h

+ 18
- 1
Marlin/Marlin.h View File

@@ -38,6 +38,23 @@
38 38
 #include "HardwareSerial.h"
39 39
 #endif
40 40
 
41
+
42
+#ifdef __GNUC__
43
+#ifndef GCC_VERSION
44
+#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
45
+#endif
46
+#if GCC_VERSION < 40602 // Test for GCC < 4.6.2
47
+#ifdef PROGMEM
48
+#undef PROGMEM
49
+#define PROGMEM __attribute__((section(".progmem.data"))) // Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734#c4
50
+#ifdef PSTR
51
+#undef PSTR
52
+#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];})) // Copied from pgmspace.h in avr-libc source
53
+#endif
54
+#endif
55
+#endif
56
+#endif
57
+
41 58
 #include "MarlinSerial.h"
42 59
 
43 60
 #ifndef cbi
@@ -269,4 +286,4 @@ extern void digipot_i2c_init();
269 286
 
270 287
 #endif
271 288
 
272
-extern void calculate_volumetric_multipliers();
289
+extern void calculate_volumetric_multipliers();

Loading…
Cancel
Save