Browse Source

Merge pull request #360 from njprossi/Marlin_v1

Power signal control definitions for other power supplies
daid 11 years ago
parent
commit
27843388c6
3 changed files with 27 additions and 2 deletions
  1. 4
    0
      Marlin/Configuration.h
  2. 17
    0
      Marlin/Configuration_adv.h
  3. 6
    2
      Marlin/Marlin_main.cpp

+ 4
- 0
Marlin/Configuration.h View File

@@ -49,7 +49,11 @@
49 49
 #define MOTHERBOARD 7
50 50
 #endif
51 51
 
52
+//// The following define selects which power supply you have. Please choose the one that matches your setup
53
+// 1 = ATX
54
+// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
52 55
 
56
+#define POWER_SUPPLY 1
53 57
 
54 58
 //===========================================================================
55 59
 //=============================Thermal Settings  ============================

+ 17
- 0
Marlin/Configuration_adv.h View File

@@ -243,6 +243,23 @@ const unsigned int dropsegments=5; //everything with less than this number of st
243 243
 #ifdef ULTIPANEL
244 244
  #undef SDCARDDETECTINVERTED
245 245
 #endif
246
+
247
+// Power Signal Control Definitions
248
+// By default use ATX definition
249
+#ifndef POWER_SUPPLY
250
+  #define POWER_SUPPLY 1
251
+#endif
252
+// 1 = ATX
253
+#if (POWER_SUPPLY == 1) 
254
+  #define PS_ON_AWAKE  LOW
255
+  #define PS_ON_ASLEEP HIGH
256
+#endif
257
+// 2 = X-Box 360 203W
258
+#if (POWER_SUPPLY == 2) 
259
+  #define PS_ON_AWAKE  HIGH
260
+  #define PS_ON_ASLEEP LOW
261
+#endif
262
+
246 263
 //===========================================================================
247 264
 //=============================Buffers           ============================
248 265
 //===========================================================================

+ 6
- 2
Marlin/Marlin_main.cpp View File

@@ -295,6 +295,10 @@ void setup_powerhold()
295 295
       WRITE(SUICIDE_PIN, HIGH);
296 296
    #endif
297 297
  #endif
298
+ #if (PS_ON_PIN > -1)
299
+   SET_OUTPUT(PS_ON_PIN);
300
+   WRITE(PS_ON_PIN, PS_ON_AWAKE);
301
+ #endif
298 302
 }
299 303
 
300 304
 void suicide()
@@ -1137,7 +1141,7 @@ void process_commands()
1137 1141
     #if (PS_ON_PIN > -1)
1138 1142
       case 80: // M80 - ATX Power On
1139 1143
         SET_OUTPUT(PS_ON_PIN); //GND
1140
-        WRITE(PS_ON_PIN, LOW);
1144
+        WRITE(PS_ON_PIN, PS_ON_AWAKE);
1141 1145
         break;
1142 1146
       #endif
1143 1147
       
@@ -1148,7 +1152,7 @@ void process_commands()
1148 1152
         suicide();
1149 1153
       #elif (PS_ON_PIN > -1)
1150 1154
         SET_OUTPUT(PS_ON_PIN); 
1151
-        WRITE(PS_ON_PIN, HIGH);
1155
+        WRITE(PS_ON_PIN, PS_ON_ASLEEP);
1152 1156
       #endif
1153 1157
 		break;
1154 1158
         

Loading…
Cancel
Save