Merge pull request #360 from njprossi/Marlin_v1

Power signal control definitions for other power supplies
This commit is contained in:
daid 2013-01-08 02:58:02 -08:00
commit 27843388c6
3 changed files with 27 additions and 2 deletions

View File

@ -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 ============================

View File

@ -243,6 +243,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 ============================
//===========================================================================

View File

@ -295,6 +295,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()
@ -1137,7 +1141,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
@ -1148,7 +1152,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;