|
@@ -161,7 +161,7 @@ static bool fromsd[BUFSIZE];
|
161
|
161
|
static int bufindr = 0;
|
162
|
162
|
static int bufindw = 0;
|
163
|
163
|
static int buflen = 0;
|
164
|
|
-static int i = 0;
|
|
164
|
+//static int i = 0;
|
165
|
165
|
static char serial_char;
|
166
|
166
|
static int serial_count = 0;
|
167
|
167
|
static boolean comment_mode = false;
|
|
@@ -233,8 +233,30 @@ void setup_photpin()
|
233
|
233
|
#endif
|
234
|
234
|
#endif
|
235
|
235
|
}
|
|
236
|
+
|
|
237
|
+void setup_powerhold()
|
|
238
|
+{
|
|
239
|
+ #ifdef SUICIDE_PIN
|
|
240
|
+ #if (SUICIDE_PIN> -1)
|
|
241
|
+ SET_OUTPUT(SUICIDE_PIN);
|
|
242
|
+ WRITE(SUICIDE_PIN, HIGH);
|
|
243
|
+ #endif
|
|
244
|
+ #endif
|
|
245
|
+}
|
|
246
|
+
|
|
247
|
+void suicide()
|
|
248
|
+{
|
|
249
|
+ #ifdef SUICIDE_PIN
|
|
250
|
+ #if (SUICIDE_PIN> -1)
|
|
251
|
+ SET_OUTPUT(SUICIDE_PIN);
|
|
252
|
+ WRITE(SUICIDE_PIN, LOW);
|
|
253
|
+ #endif
|
|
254
|
+ #endif
|
|
255
|
+}
|
|
256
|
+
|
236
|
257
|
void setup()
|
237
|
258
|
{
|
|
259
|
+ setup_powerhold();
|
238
|
260
|
MSerial.begin(BAUDRATE);
|
239
|
261
|
SERIAL_ECHO_START;
|
240
|
262
|
SERIAL_ECHOLNPGM(VERSION_STRING);
|
|
@@ -912,10 +934,17 @@ FORCE_INLINE void process_commands()
|
912
|
934
|
case 80: // M80 - ATX Power On
|
913
|
935
|
SET_OUTPUT(PS_ON_PIN); //GND
|
914
|
936
|
break;
|
|
937
|
+ #endif
|
|
938
|
+
|
915
|
939
|
case 81: // M81 - ATX Power Off
|
916
|
|
- SET_INPUT(PS_ON_PIN); //Floating
|
917
|
|
- break;
|
918
|
|
- #endif
|
|
940
|
+ #if (SUICIDE_PIN >-1)
|
|
941
|
+ suicide();
|
|
942
|
+ #else
|
|
943
|
+ #if (PS_ON_PIN > -1)
|
|
944
|
+ SET_INPUT(PS_ON_PIN); //Floating
|
|
945
|
+ #endif
|
|
946
|
+ #endif
|
|
947
|
+
|
919
|
948
|
case 82:
|
920
|
949
|
axis_relative_modes[3] = false;
|
921
|
950
|
break;
|
|
@@ -1314,6 +1343,7 @@ void kill()
|
1314
|
1343
|
SERIAL_ERROR_START;
|
1315
|
1344
|
SERIAL_ERRORLNPGM("Printer halted. kill() called !!");
|
1316
|
1345
|
LCD_MESSAGEPGM("KILLED. ");
|
|
1346
|
+ suicide();
|
1317
|
1347
|
while(1); // Wait for reset
|
1318
|
1348
|
}
|
1319
|
1349
|
|