From 53f971095d5631f2706519426ab53a60797be07b Mon Sep 17 00:00:00 2001 From: daid Date: Fri, 16 Jan 2015 16:48:22 +0100 Subject: [PATCH] Revert "Reduce PROGMEM warnings" --- Marlin/Configuration.h | 1 + Marlin/ConfigurationStore.cpp | 12 ++++++------ Marlin/LiquidCrystalRus.cpp | 2 +- Marlin/Marlin.h | 19 ------------------- Marlin/Marlin_main.cpp | 6 +++--- Marlin/planner.cpp | 2 +- Marlin/speed_lookuptable.h | 8 ++++---- Marlin/temperature.cpp | 1 - 8 files changed, 16 insertions(+), 35 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index f0b180bf84..4e0786199d 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -791,5 +791,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of #include "Configuration_adv.h" +#include "thermistortables.h" #endif //__CONFIGURATION_H diff --git a/Marlin/ConfigurationStore.cpp b/Marlin/ConfigurationStore.cpp index 30af7d08af..9a64d19f54 100644 --- a/Marlin/ConfigurationStore.cpp +++ b/Marlin/ConfigurationStore.cpp @@ -423,14 +423,14 @@ void Config_RetrieveSettings() void Config_ResetDefault() { - const static float tmp1[] MARLIN_PROGMEM =DEFAULT_AXIS_STEPS_PER_UNIT; - const static float tmp2[] MARLIN_PROGMEM =DEFAULT_MAX_FEEDRATE; - const static long tmp3[] MARLIN_PROGMEM =DEFAULT_MAX_ACCELERATION; + float tmp1[]=DEFAULT_AXIS_STEPS_PER_UNIT; + float tmp2[]=DEFAULT_MAX_FEEDRATE; + long tmp3[]=DEFAULT_MAX_ACCELERATION; for (short i=0;i<4;i++) { - axis_steps_per_unit[i]=pgm_read_float(&tmp1[i]); - max_feedrate[i]=pgm_read_float(&tmp2[i]); - max_acceleration_units_per_sq_second[i]=pgm_read_float(&tmp3[i]); + axis_steps_per_unit[i]=tmp1[i]; + max_feedrate[i]=tmp2[i]; + max_acceleration_units_per_sq_second[i]=tmp3[i]; #ifdef SCARA axis_scaling[i]=1; #endif//SCARA diff --git a/Marlin/LiquidCrystalRus.cpp b/Marlin/LiquidCrystalRus.cpp index a9204a8a66..6ee2c112e9 100644 --- a/Marlin/LiquidCrystalRus.cpp +++ b/Marlin/LiquidCrystalRus.cpp @@ -13,7 +13,7 @@ // it is a Russian alphabet translation // except 0401 --> 0xa2 = ╗, 0451 --> 0xb5 -const prog_uint8_t utf_recode[] PROGMEM = +const PROGMEM uint8_t utf_recode[] = { 0x41,0xa0,0x42,0xa1,0xe0,0x45,0xa3,0xa4,0xa5,0xa6,0x4b,0xa7,0x4d,0x48,0x4f, 0xa8,0x50,0x43,0x54,0xa9,0xaa,0x58,0xe1,0xab,0xac,0xe2,0xad,0xae,0x62,0xaf,0xb0,0xb1, 0x61,0xb2,0xb3,0xb4,0xe3,0x65,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0x6f, diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index da1b4891bb..7a1afa3517 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -41,25 +41,6 @@ #include "HardwareSerial.h" #endif - -#ifdef __GNUC__ -#ifndef GCC_VERSION2 -#define GCC_VERSION2 (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -#endif - -#if GCC_VERSION2 < 40602 // Test for GCC < 4.6.2 -#ifdef PROGMEM -#define MARLIN_PROGMEM __attribute__((section(".progmem.data"))) -#ifdef PSTR -#undef PSTR -#define PSTR(s) (__extension__({static const prog_char __c[] MARLIN_PROGMEM = (s); &__c[0];})) // Copied from pgmspace.h in avr-libc source -#endif -#endif -#endif -#endif - - - #include "MarlinSerial.h" #ifndef cbi diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 57afd1131a..f4d53497b7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -338,8 +338,8 @@ bool cancel_heatup = false ; int meas_delay_cm = MEASUREMENT_DELAY_CM; //distance delay setting #endif -const prog_char errormagic[] MARLIN_PROGMEM = "Error:"; -const prog_char echomagic[] MARLIN_PROGMEM = "echo:"; +const char errormagic[] PROGMEM = "Error:"; +const char echomagic[] PROGMEM = "echo:"; //=========================================================================== //=============================Private Variables============================= @@ -865,7 +865,7 @@ DEFINE_PGM_READ_ANY(float, float); DEFINE_PGM_READ_ANY(signed char, byte); #define XYZ_CONSTS_FROM_CONFIG(type, array, CONFIG) \ -static const type array##_P[3] MARLIN_PROGMEM = \ +static const PROGMEM type array##_P[3] = \ { X_##CONFIG, Y_##CONFIG, Z_##CONFIG }; \ static inline type array(int axis) \ { return pgm_read_any(&array##_P[axis]); } diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 7c43ef65cf..5d9fba948d 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -80,7 +80,7 @@ unsigned long axis_steps_per_sqr_second[NUM_AXIS]; matrix_3x3 plan_bed_level_matrix = { 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 1.0 + 0.0, 0.0, 1.0, }; #endif // #ifdef ENABLE_AUTO_BED_LEVELING diff --git a/Marlin/speed_lookuptable.h b/Marlin/speed_lookuptable.h index 67530a455b..b7c00f1aea 100644 --- a/Marlin/speed_lookuptable.h +++ b/Marlin/speed_lookuptable.h @@ -5,7 +5,7 @@ #if F_CPU == 16000000 -const prog_uint16_t speed_lookuptable_fast[256][2] MARLIN_PROGMEM = {\ +const uint16_t speed_lookuptable_fast[256][2] PROGMEM = {\ { 62500, 55556}, { 6944, 3268}, { 3676, 1176}, { 2500, 607}, { 1893, 369}, { 1524, 249}, { 1275, 179}, { 1096, 135}, { 961, 105}, { 856, 85}, { 771, 69}, { 702, 58}, { 644, 49}, { 595, 42}, { 553, 37}, { 516, 32}, { 484, 28}, { 456, 25}, { 431, 23}, { 408, 20}, { 388, 19}, { 369, 16}, { 353, 16}, { 337, 14}, @@ -40,7 +40,7 @@ const prog_uint16_t speed_lookuptable_fast[256][2] MARLIN_PROGMEM = {\ { 31, 0}, { 31, 0}, { 31, 0}, { 31, 1}, { 30, 0}, { 30, 0}, { 30, 0}, { 30, 0} }; -const prog_uint16_t speed_lookuptable_slow[256][2] MARLIN_PROGMEM = {\ +const uint16_t speed_lookuptable_slow[256][2] PROGMEM = {\ { 62500, 12500}, { 50000, 8334}, { 41666, 5952}, { 35714, 4464}, { 31250, 3473}, { 27777, 2777}, { 25000, 2273}, { 22727, 1894}, { 20833, 1603}, { 19230, 1373}, { 17857, 1191}, { 16666, 1041}, { 15625, 920}, { 14705, 817}, { 13888, 731}, { 13157, 657}, { 12500, 596}, { 11904, 541}, { 11363, 494}, { 10869, 453}, { 10416, 416}, { 10000, 385}, { 9615, 356}, { 9259, 331}, @@ -77,7 +77,7 @@ const prog_uint16_t speed_lookuptable_slow[256][2] MARLIN_PROGMEM = {\ #elif F_CPU == 20000000 -const uint16_t speed_lookuptable_fast[256][2] MARLIN_PROGMEM = { +const uint16_t speed_lookuptable_fast[256][2] PROGMEM = { {62500, 54055}, {8445, 3917}, {4528, 1434}, {3094, 745}, {2349, 456}, {1893, 307}, {1586, 222}, {1364, 167}, {1197, 131}, {1066, 105}, {961, 86}, {875, 72}, {803, 61}, {742, 53}, {689, 45}, {644, 40}, {604, 35}, {569, 32}, {537, 28}, {509, 25}, {484, 23}, {461, 21}, {440, 19}, {421, 17}, @@ -112,7 +112,7 @@ const uint16_t speed_lookuptable_fast[256][2] MARLIN_PROGMEM = { {39, 0}, {39, 0}, {39, 1}, {38, 0}, {38, 0}, {38, 0}, {38, 0}, {38, 0}, }; -const uint16_t speed_lookuptable_slow[256][2] MARLIN_PROGMEM = { +const uint16_t speed_lookuptable_slow[256][2] PROGMEM = { {62500, 10417}, {52083, 7441}, {44642, 5580}, {39062, 4340}, {34722, 3472}, {31250, 2841}, {28409, 2368}, {26041, 2003}, {24038, 1717}, {22321, 1488}, {20833, 1302}, {19531, 1149}, {18382, 1021}, {17361, 914}, {16447, 822}, {15625, 745}, {14880, 676}, {14204, 618}, {13586, 566}, {13020, 520}, {12500, 481}, {12019, 445}, {11574, 414}, {11160, 385}, diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index d04f1fefb1..f6eadaa483 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -33,7 +33,6 @@ #include "ultralcd.h" #include "temperature.h" #include "watchdog.h" -#include "thermistortables.h" #include "Sd2PinMap.h"