summaryrefslogtreecommitdiff
path: root/Sprinter/Sprinter.pde
diff options
context:
space:
mode:
authorkliment <kliment.yanev@gmail.com>2011-07-06 12:40:33 +0200
committerkliment <kliment.yanev@gmail.com>2011-07-06 12:40:33 +0200
commitef2c71aa4e918999019dcb29ffac3c1c902cb4ad (patch)
treec31536510898a944be47c67eeaf2d11c8acfffe8 /Sprinter/Sprinter.pde
parentfac34c12d7b6e8e5b516cd24b50127129a1409c7 (diff)
Removed float calculations from temp conversion functions
Diffstat (limited to 'Sprinter/Sprinter.pde')
-rw-r--r--Sprinter/Sprinter.pde8
1 files changed, 4 insertions, 4 deletions
diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde
index 2c06bd7..d4ba90d 100644
--- a/Sprinter/Sprinter.pde
+++ b/Sprinter/Sprinter.pde
@@ -1347,10 +1347,10 @@ int temp2analogu(int celsius, const short table[][2], int numtemps, int source)
}
#elif defined (HEATER_USES_AD595) || defined (BED_USES_AD595)
if(source==2)
- return celsius * (1024.0 / (5.0 * 100.0) );
+ return celsius * 1024 / (500);
#elif defined (HEATER_USES_MAX6675) || defined (BED_USES_MAX6675)
if(source==3)
- return celsius * 4.0;
+ return celsius * 4;
#endif
return -1;
}
@@ -1383,10 +1383,10 @@ int analog2tempu(int raw,const short table[][2], int numtemps, int source) {
}
#elif defined (HEATER_USES_AD595) || defined (BED_USES_AD595)
if(source==2)
- return raw * ((5.0 * 100.0) / 1024.0);
+ return raw * 500 / 1024;
#elif defined (HEATER_USES_MAX6675) || defined (BED_USES_MAX6675)
if(source==3)
- return raw * 0.25;
+ return raw / 4;
#endif
return -1;
}