summaryrefslogtreecommitdiff
path: root/Sprinter/Sprinter.h
diff options
context:
space:
mode:
authorkliment <kliment.yanev@gmail.com>2011-07-06 12:37:30 +0200
committerkliment <kliment.yanev@gmail.com>2011-07-06 12:37:30 +0200
commitfac34c12d7b6e8e5b516cd24b50127129a1409c7 (patch)
treee8c9714ebeed5d44822443e6f3dfa875ab07996c /Sprinter/Sprinter.h
parentc8767013f10a9b4022e2c260bd0e0d7769a6b1e2 (diff)
Refactored analog to temp and temp to analog to not make distinction between hotend and bed.
Changed both to return integers rather than floats.
Diffstat (limited to 'Sprinter/Sprinter.h')
-rw-r--r--Sprinter/Sprinter.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/Sprinter/Sprinter.h b/Sprinter/Sprinter.h
index 4e3c7ea..1a324a0 100644
--- a/Sprinter/Sprinter.h
+++ b/Sprinter/Sprinter.h
@@ -8,10 +8,31 @@ void process_commands();
void manage_inactivity(byte debug);
void manage_heater();
-float temp2analog(int celsius);
-float temp2analogBed(int celsius);
-float analog2temp(int raw);
-float analog2tempBed(int raw);
+int temp2analogu(int celsius, const short table[][2], int numtemps, int source);
+int analog2tempu(int raw, const short table[][2], int numtemps, int source);
+#ifdef HEATER_USES_THERMISTOR
+ #define HEATERSOURCE 1
+#endif
+#ifdef HEATER_USES_AD595
+ #define HEATERSOURCE 2
+#endif
+#ifdef HEATER_USES_MAX6675
+ #define HEATERSOURCE 3
+#endif
+#ifdef BED_USES_THERMISTOR
+ #define BEDSOURCE 1
+#endif
+#ifdef BED_USES_AD595
+ #define BEDSOURCE 2
+#endif
+#ifdef BED_USES_MAX6675
+ #define BEDSOURCE 3
+#endif
+
+#define temp2analogh( c ) temp2analogu((c),temptable,NUMTEMPS,HEATERSOURCE)
+#define temp2analogBed( c ) temp2analogu((c),bedtemptable,BNUMTEMPS,BEDSOURCE)
+#define analog2temp( c ) analog2tempu((c),temptable,NUMTEMPS,HEATERSOURCE)
+#define analog2tempBed( c ) analog2tempu((c),bedtemptable,BNUMTEMPS,BEDSOURCE)
void FlushSerialRequestResend();
void ClearToSend();