summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkliment <kliment.yanev@gmail.com>2011-07-06 14:22:06 +0200
committerkliment <kliment.yanev@gmail.com>2011-07-06 14:22:06 +0200
commit8dafab9b9a51ae91e1a5c5f5f03e7e2d6ba5be01 (patch)
treeff2288b98b677fc5f76f55ffaa36fd6806213e79
parent709a84956be02e91e12e6dc368d92ebb936630fc (diff)
Single definition temp tables
-rw-r--r--Sprinter/thermistortables.h181
1 files changed, 33 insertions, 148 deletions
diff --git a/Sprinter/thermistortables.h b/Sprinter/thermistortables.h
index e21b647..6c583af 100644
--- a/Sprinter/thermistortables.h
+++ b/Sprinter/thermistortables.h
@@ -1,11 +1,11 @@
#ifndef THERMISTORTABLES_H_
#define THERMISTORTABLES_H_
-#if THERMISTORHEATER == 1 //100k bed thermistor
+#if (THERMISTORHEATER == 1) || (THERMISTORBED == 1) //100k bed thermistor
-#define NUMTEMPS 61
-const short temptable[NUMTEMPS][2] = {
+#define NUMTEMPS_1 61
+const short temptable_1[NUMTEMPS_1][2] = {
{ 23 , 300 },
{ 25 , 295 },
{ 27 , 290 },
@@ -68,10 +68,10 @@ const short temptable[NUMTEMPS][2] = {
{ 1004 , 5 },
{ 1008 , 0 } //safety
};
-
-#elif THERMISTORHEATER == 2 //200k bed thermistor
-#define NUMTEMPS 21
-const short temptable[NUMTEMPS][2] = {
+#endif
+#if (THERMISTORHEATER == 2) || (THERMISTORBED == 2) //200k bed thermistor
+#define NUMTEMPS_2 21
+const short temptable_2[NUMTEMPS_2][2] = {
{1, 848},
{54, 275},
{107, 228},
@@ -95,9 +95,10 @@ const short temptable[NUMTEMPS][2] = {
{1020, 0} //safety
};
-#elif THERMISTORHEATER == 3 //mendel-parts
-#define NUMTEMPS 28
-const short temptable[NUMTEMPS][2] = {
+#endif
+#if (THERMISTORHEATER == 3) || (THERMISTORBED == 3) //mendel-parts
+#define NUMTEMPS_3 28
+const short temptable_3[NUMTEMPS_3][2] = {
{1,864},
{21,300},
{25,290},
@@ -128,147 +129,31 @@ const short temptable[NUMTEMPS][2] = {
{1018,-20}
};
-#else
-#error No thermistor table specified
-
#endif
-
-#if THERMISTORHEATER==THERMISTORBED
-#define BNUMTEMPS NUMTEMPS
-#define bedtemptable temptable
-#else
-#if THERMISTORBED == 1 //100k bed thermistor
-
-
-#define BNUMTEMPS 61
-const short bedtemptable[BNUMTEMPS][2] = {
-{ 23 , 300 },
-{ 25 , 295 },
-{ 27 , 290 },
-{ 28 , 285 },
-{ 31 , 280 },
-{ 33 , 275 },
-{ 35 , 270 },
-{ 38 , 265 },
-{ 41 , 260 },
-{ 44 , 255 },
-{ 48 , 250 },
-{ 52 , 245 },
-{ 56 , 240 },
-{ 61 , 235 },
-{ 66 , 230 },
-{ 71 , 225 },
-{ 78 , 220 },
-{ 84 , 215 },
-{ 92 , 210 },
-{ 100 , 205 },
-{ 109 , 200 },
-{ 120 , 195 },
-{ 131 , 190 },
-{ 143 , 185 },
-{ 156 , 180 },
-{ 171 , 175 },
-{ 187 , 170 },
-{ 205 , 165 },
-{ 224 , 160 },
-{ 245 , 155 },
-{ 268 , 150 },
-{ 293 , 145 },
-{ 320 , 140 },
-{ 348 , 135 },
-{ 379 , 130 },
-{ 411 , 125 },
-{ 445 , 120 },
-{ 480 , 115 },
-{ 516 , 110 },
-{ 553 , 105 },
-{ 591 , 100 },
-{ 628 , 95 },
-{ 665 , 90 },
-{ 702 , 85 },
-{ 737 , 80 },
-{ 770 , 75 },
-{ 801 , 70 },
-{ 830 , 65 },
-{ 857 , 60 },
-{ 881 , 55 },
-{ 903 , 50 },
-{ 922 , 45 },
-{ 939 , 40 },
-{ 954 , 35 },
-{ 966 , 30 },
-{ 977 , 25 },
-{ 985 , 20 },
-{ 993 , 15 },
-{ 999 , 10 },
-{ 1004 , 5 },
-{ 1008 , 0 } //safety
-};
-
-#elif THERMISTORBED == 2 //200k bed thermistor
-#define BNUMTEMPS 21
-const short bedtemptable[BNUMTEMPS][2] = {
- {1, 848},
- {54, 275},
- {107, 228},
- {160, 202},
- {213, 185},
- {266, 171},
- {319, 160},
- {372, 150},
- {425, 141},
- {478, 133},
- {531, 125},
- {584, 118},
- {637, 110},
- {690, 103},
- {743, 95},
- {796, 86},
- {849, 77},
- {902, 65},
- {955, 49},
- {1008, 17},
- {1020, 0} //safety
-};
-
-#elif THERMISTORBED == 3 //mendel-parts
-#define BNUMTEMPS 28
-const short bedtemptable[BNUMTEMPS][2] = {
- {1,864},
- {21,300},
- {25,290},
- {29,280},
- {33,270},
- {39,260},
- {46,250},
- {54,240},
- {64,230},
- {75,220},
- {90,210},
- {107,200},
- {128,190},
- {154,180},
- {184,170},
- {221,160},
- {265,150},
- {316,140},
- {375,130},
- {441,120},
- {513,110},
- {588,100},
- {734,80},
- {856,60},
- {938,40},
- {986,20},
- {1008,0},
- {1018,-20}
- };
-#else
+#if THERMISTORHEATER == 1
+#define NUMTEMPS NUMTEMPS_1
+#define temptable temptable_1
+#elif THERMISTORHEATER == 2
+#define NUMTEMPS NUMTEMPS_2
+#define temptable temptable_2
+#elif THERMISTORHEATER == 3
+#define NUMTEMPS NUMTEMPS_3
+#define temptable temptable_3
+#elif defined HEATER_USES_THERMISTOR
+#error No heater thermistor table specified
+#endif
+#if THERMISTORBED == 1
+#define BNUMTEMPS NUMTEMPS_1
+#define bedtemptable temptable_1
+#elif THERMISTORBED == 2
+#define BNUMTEMPS NUMTEMPS_2
+#define bedtemptable temptable_2
+#elif THERMISTORBED == 3
+#define BNUMTEMPS NUMTEMPS_3
+#define bedtemptable temptable_3
+#elif defined BED_USES_THERMISTOR
#error No bed thermistor table specified
-
#endif
-
-#endif //if THERMISTORHEATER==THERMISTORBED
#endif //THERMISTORTABLES_H_