summaryrefslogtreecommitdiff
path: root/Sprinter/Sprinter.pde
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2011-07-16 11:57:42 +0200
committerAlessandro Ranellucci <aar@cpan.org>2011-07-16 11:57:42 +0200
commitef0ad69571bf9e8ebe134280b1d584919790f878 (patch)
tree0ef4254b1b4bc4634269c038d6b00accb0866690 /Sprinter/Sprinter.pde
parent02566cc007ed8d460e34226c9542282c3e260605 (diff)
Bugfix: smoothed temperature was initialized without respecting HEATER_USES_*
Diffstat (limited to 'Sprinter/Sprinter.pde')
-rw-r--r--Sprinter/Sprinter.pde3
1 files changed, 2 insertions, 1 deletions
diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde
index b31a629..79c66e6 100644
--- a/Sprinter/Sprinter.pde
+++ b/Sprinter/Sprinter.pde
@@ -133,7 +133,7 @@ float tt = 0, bt = 0;
int temp_iState_max = 100 * PID_INTEGRAL_DRIVE_MAX / PID_IGAIN;
#endif
#ifdef SMOOTHING
- uint32_t nma = SMOOTHFACTOR * analogRead(TEMP_0_PIN);
+ uint32_t nma = 0;
#endif
#ifdef WATCHPERIOD
int watch_raw = -1000;
@@ -1268,6 +1268,7 @@ inline void manage_heater()
current_raw = read_max6675();
#endif
#ifdef SMOOTHING
+ if (!nma) nma = SMOOTHFACTOR * current_raw;
nma = (nma + current_raw) - (nma / SMOOTHFACTOR);
current_raw = nma / SMOOTHFACTOR;
#endif