From f3c1fc70a90223012571ded15257ce43f34d906c Mon Sep 17 00:00:00 2001 From: Nicolas Rossi Date: Mon, 7 Jan 2013 14:33:30 +0100 Subject: [PATCH 1/2] Power signal control definitions for ATX and others --- Marlin/Configuration.h | 4 ++++ Marlin/Configuration_adv.h | 17 +++++++++++++++++ Marlin/Marlin_main.cpp | 4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d7d35d240..5bad2d583 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -49,7 +49,11 @@ #define MOTHERBOARD 7 #endif +//// The following define selects which power supply you have. Please choose the one that matches your setup +// 1 = ATX +// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) +#define POWER_SUPPLY 1 //=========================================================================== //=============================Thermal Settings ============================ diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index b74f74ad8..f4b6cc184 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -241,6 +241,23 @@ const unsigned int dropsegments=5; //everything with less than this number of st #ifdef ULTIPANEL #undef SDCARDDETECTINVERTED #endif + +// Power Signal Control Definitions +// By default use ATX definition +#ifndef POWER_SUPPLY + #define POWER_SUPPLY 1 +#endif +// 1 = ATX +#if (POWER_SUPPLY == 1) + #define PS_ON_AWAKE LOW + #define PS_ON_ASLEEP HIGH +#endif +// 2 = X-Box 360 203W +#if (POWER_SUPPLY == 2) + #define PS_ON_AWAKE HIGH + #define PS_ON_ASLEEP LOW +#endif + //=========================================================================== //=============================Buffers ============================ //=========================================================================== diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1dc4c2103..7e16b9af3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1136,7 +1136,7 @@ void process_commands() #if (PS_ON_PIN > -1) case 80: // M80 - ATX Power On SET_OUTPUT(PS_ON_PIN); //GND - WRITE(PS_ON_PIN, LOW); + WRITE(PS_ON_PIN, PS_ON_AWAKE); break; #endif @@ -1147,7 +1147,7 @@ void process_commands() suicide(); #elif (PS_ON_PIN > -1) SET_OUTPUT(PS_ON_PIN); - WRITE(PS_ON_PIN, HIGH); + WRITE(PS_ON_PIN, PS_ON_ASLEEP); #endif break; From 437eb3bafcf5132fb97b06ec6c89e6c5e7f32708 Mon Sep 17 00:00:00 2001 From: Nicolas Rossi Date: Mon, 7 Jan 2013 14:57:51 +0100 Subject: [PATCH 2/2] Initialize PS_ON at startup --- Marlin/Marlin_main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7e16b9af3..be0eacb2f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -294,6 +294,10 @@ void setup_powerhold() WRITE(SUICIDE_PIN, HIGH); #endif #endif + #if (PS_ON_PIN > -1) + SET_OUTPUT(PS_ON_PIN); + WRITE(PS_ON_PIN, PS_ON_AWAKE); + #endif } void suicide()