Fixed demo estop
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Sat, 30 Jan 2021 21:13:22 +0000 (13:13 -0800)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Sat, 30 Jan 2021 21:13:22 +0000 (13:13 -0800)
src/avr/src/hardware.c

index d635c3721a416f3afa34e7d665ec2fc9796161d1..3a3f08b5b4c5e507852355f7c09d0615077e7b34 100644 (file)
 #include <stdbool.h>
 #include <stddef.h>
 
+#ifndef __AVR__
+#include <unistd.h>
+#endif
+
 
 typedef struct {
   char id[26];
@@ -137,9 +141,15 @@ void hw_request_hard_reset() {hw.hard_reset = true;}
 
 static void _hard_reset() {
   usart_flush();
+
+#ifdef __AVR__
   cli();
   CCP = CCP_IOREG_gc;
   RST.CTRL = RST_SWRST_bm;
+
+#else // __AVR__
+  exit(0);
+#endif
 }