summaryrefslogtreecommitdiff
path: root/Sprinter
diff options
context:
space:
mode:
authorkliment <kliment.yanev@gmail.com>2011-07-09 19:20:54 +0200
committerkliment <kliment.yanev@gmail.com>2011-07-09 19:20:54 +0200
commit1c1b445268c2befe6d4fcf0ffec1fc2b3417f311 (patch)
treef69f236839cdd1374c206f3ab8afeb64194a25e7 /Sprinter
parent1693fc15f3294691cef18e0066ad8ada182b2fd2 (diff)
Check pins exist before writing to them
Diffstat (limited to 'Sprinter')
-rw-r--r--Sprinter/Sprinter.pde15
1 files changed, 11 insertions, 4 deletions
diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde
index 73ee4c4..31d00df 100644
--- a/Sprinter/Sprinter.pde
+++ b/Sprinter/Sprinter.pde
@@ -1392,7 +1392,9 @@ void manage_heater()
if(watch_raw + 1 >= current_raw){
target_raw = 0;
WRITE(HEATER_0_PIN,LOW);
- WRITE(LED_PIN,LOW);
+ #if LED_PIN>-1
+ WRITE(LED_PIN,LOW);
+ #endif
}else{
watchmillis = 0;
}
@@ -1421,12 +1423,16 @@ void manage_heater()
if(current_raw >= target_raw)
{
WRITE(HEATER_0_PIN,LOW);
- WRITE(LED_PIN,LOW);
+ #if LED_PIN>-1
+ WRITE(LED_PIN,LOW);
+ #endif
}
else
{
WRITE(HEATER_0_PIN,HIGH);
- WRITE(LED_PIN,HIGH);
+ #if LED_PIN > -1
+ WRITE(LED_PIN,HIGH);
+ #endif
}
#endif
#endif
@@ -1439,7 +1445,7 @@ void manage_heater()
#endif
#if TEMP_1_PIN == -1
return;
- #endif
+ #else
#ifdef BED_USES_THERMISTOR
@@ -1466,6 +1472,7 @@ void manage_heater()
{
WRITE(HEATER_1_PIN,HIGH);
}
+ #endif
}