summaryrefslogtreecommitdiff
path: root/Sprinter
diff options
context:
space:
mode:
Diffstat (limited to 'Sprinter')
-rw-r--r--Sprinter/Configuration.h2
-rw-r--r--Sprinter/Sd2Card.cpp4
-rw-r--r--Sprinter/SdFatUtil.h4
-rw-r--r--Sprinter/SdFile.cpp4
-rw-r--r--Sprinter/heater.cpp26
-rw-r--r--Sprinter/thermistortables.h4
6 files changed, 34 insertions, 10 deletions
diff --git a/Sprinter/Configuration.h b/Sprinter/Configuration.h
index 5d5d78e..382741e 100644
--- a/Sprinter/Configuration.h
+++ b/Sprinter/Configuration.h
@@ -175,7 +175,7 @@ const int NUM_AXIS = 4; // The axis order in all axis related arrays is X, Y, Z,
//#define RAPID_OSCILLATION_REDUCTION
#ifdef RAPID_OSCILLATION_REDUCTION
-long min_time_before_dir_change = 30; //milliseconds
+const long min_time_before_dir_change = 30; //milliseconds
#endif
//-----------------------------------------------------------------------
diff --git a/Sprinter/Sd2Card.cpp b/Sprinter/Sd2Card.cpp
index 8222cfd..05832e7 100644
--- a/Sprinter/Sd2Card.cpp
+++ b/Sprinter/Sd2Card.cpp
@@ -17,7 +17,11 @@
* along with the Arduino Sd2Card Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+#if defined(ARDUINO) && ARDUINO >= 100
+#include <Arduino.h>
+#else
#include <WProgram.h>
+#endif
#include "Sd2Card.h"
//------------------------------------------------------------------------------
#ifndef SOFTWARE_SPI
diff --git a/Sprinter/SdFatUtil.h b/Sprinter/SdFatUtil.h
index de3fee3..361a5a2 100644
--- a/Sprinter/SdFatUtil.h
+++ b/Sprinter/SdFatUtil.h
@@ -23,7 +23,11 @@
* \file
* Useful utility functions.
*/
+#if defined(ARDUINO) && ARDUINO >= 100
+#include <Arduino.h>
+#else
#include <WProgram.h>
+#endif
#include <avr/pgmspace.h>
/** Store and print a string in flash memory.*/
#define PgmPrint(x) SerialPrint_P(PSTR(x))
diff --git a/Sprinter/SdFile.cpp b/Sprinter/SdFile.cpp
index 13f4c6a..c847e01 100644
--- a/Sprinter/SdFile.cpp
+++ b/Sprinter/SdFile.cpp
@@ -19,7 +19,11 @@
*/
#include "SdFat.h"
#include <avr/pgmspace.h>
+#if defined(ARDUINO) && ARDUINO >= 100
+#include <Arduino.h>
+#else
#include <WProgram.h>
+#endif
//------------------------------------------------------------------------------
// callback function for date/time
void (*SdFile::dateTime_)(uint16_t* date, uint16_t* time) = NULL;
diff --git a/Sprinter/heater.cpp b/Sprinter/heater.cpp
index 69e9e86..7682516 100644
--- a/Sprinter/heater.cpp
+++ b/Sprinter/heater.cpp
@@ -661,12 +661,21 @@ void PID_autotune(int PIDAT_test_temp)
heater_duty = constrain(heater_duty, 0, HEATER_CURRENT);
#ifdef PID_SOFT_PWM
- g_heater_pwm_val = (unsigned char)heater_duty;
+ if(target_raw != 0)
+ g_heater_pwm_val = (unsigned char)heater_duty;
+ else
+ g_heater_pwm_val = 0;
#else
- analogWrite(HEATER_0_PIN, heater_duty);
+ if(target_raw != 0)
+ analogWrite(HEATER_0_PIN, heater_duty);
+ else
+ analogWrite(HEATER_0_PIN, 0);
#if LED_PIN>-1
- analogWrite(LED_PIN, constrain(LED_PWM_FOR_BRIGHTNESS(heater_duty),0,255));
+ if(target_raw != 0)
+ analogWrite(LED_PIN, constrain(LED_PWM_FOR_BRIGHTNESS(heater_duty),0,255));
+ else
+ analogWrite(LED_PIN, 0);
#endif
#endif
@@ -681,10 +690,13 @@ void PID_autotune(int PIDAT_test_temp)
}
else
{
- WRITE(HEATER_0_PIN,HIGH);
- #if LED_PIN > -1
- WRITE(LED_PIN,HIGH);
- #endif
+ if(target_raw != 0)
+ {
+ WRITE(HEATER_0_PIN,HIGH);
+ #if LED_PIN > -1
+ WRITE(LED_PIN,HIGH);
+ #endif
+ }
}
#endif
#endif
diff --git a/Sprinter/thermistortables.h b/Sprinter/thermistortables.h
index eccfe88..8496b6d 100644
--- a/Sprinter/thermistortables.h
+++ b/Sprinter/thermistortables.h
@@ -280,8 +280,8 @@ const short temptable_6[NUMTEMPS_6][2] = {
{49, 220},
{53, 215},
{62, 210},
- {73, 205},
- {72, 200},
+ {71, 205}, //fitted graphically
+ {78, 200}, //fitted graphically
{94, 190},
{102, 185},
{116, 170},