From 61e09e6be222900f71c8b5d1bcc4b41fd8bfb098 Mon Sep 17 00:00:00 2001 From: Erik van der Zalm Date: Thu, 8 Mar 2012 22:09:49 +0100 Subject: [PATCH] Added FAN_PIN -1 checks --- Marlin/planner.cpp | 8 ++++++-- Marlin/ultralcd.pde | 12 ++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index fdc4a1f009..c06c07395c 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -437,13 +437,17 @@ void check_axes_activity() { } } else { - if (FanSpeed != 0) analogWrite(FAN_PIN,FanSpeed); // If buffer is empty use current fan speed + #if FAN_PIN > -1 + if (FanSpeed != 0) analogWrite(FAN_PIN,FanSpeed); // If buffer is empty use current fan speed + #endif } if((DISABLE_X) && (x_active == 0)) disable_x(); if((DISABLE_Y) && (y_active == 0)) disable_y(); if((DISABLE_Z) && (z_active == 0)) disable_z(); if((DISABLE_E) && (e_active == 0)) { disable_e0();disable_e1();disable_e2(); } - if((FanSpeed == 0) && (fan_speed ==0)) analogWrite(FAN_PIN, 0); + #if FAN_PIN > -1 + if((FanSpeed == 0) && (fan_speed ==0)) analogWrite(FAN_PIN, 0); + #endif if (FanSpeed != 0 && tail_fan_speed !=0) { analogWrite(FAN_PIN,tail_fan_speed); } diff --git a/Marlin/ultralcd.pde b/Marlin/ultralcd.pde index 0f4861b131..58950dc170 100644 --- a/Marlin/ultralcd.pde +++ b/Marlin/ultralcd.pde @@ -505,10 +505,18 @@ void MainMenu::showPrepare() MENUITEM( lcdprintPGM(MSG_SET_ORIGIN) , BLOCK;enquecommand("G92 X0 Y0 Z0");beepshort(); ) ; break; case ItemP_preheat_pla: - MENUITEM( lcdprintPGM(MSG_PREHEAT_PLA) , BLOCK;setTargetHotend0(PLA_PREHEAT_HOTEND_TEMP);setTargetBed(PLA_PREHEAT_HPB_TEMP);analogWrite(FAN_PIN, PLA_PREHEAT_FAN_SPEED); beepshort(); ) ; + MENUITEM( lcdprintPGM(MSG_PREHEAT_PLA) , BLOCK;setTargetHotend0(PLA_PREHEAT_HOTEND_TEMP);setTargetBed(PLA_PREHEAT_HPB_TEMP); + #if FAN_PIN > -1 + analogWrite(FAN_PIN, PLA_PREHEAT_FAN_SPEED); + #endif + beepshort(); ); break; case ItemP_preheat_abs: - MENUITEM( lcdprintPGM(MSG_PREHEAT_ABS) , BLOCK;setTargetHotend0(ABS_PREHEAT_HOTEND_TEMP);setTargetBed(ABS_PREHEAT_HPB_TEMP); analogWrite(FAN_PIN, ABS_PREHEAT_FAN_SPEED); beepshort(); ) ; + MENUITEM( lcdprintPGM(MSG_PREHEAT_ABS) , BLOCK;setTargetHotend0(ABS_PREHEAT_HOTEND_TEMP);setTargetBed(ABS_PREHEAT_HPB_TEMP); + #if FAN_PIN > -1 + analogWrite(FAN_PIN, ABS_PREHEAT_FAN_SPEED); + #endif + beepshort(); ); break; case ItemP_cooldown: MENUITEM( lcdprintPGM(MSG_COOLDOWN) , BLOCK;setTargetHotend0(0);setTargetBed(0);beepshort(); ) ;