Browse Source

Return from loop() on non-AVR boards (#16390)

Lino Barreca 5 years ago
parent
commit
ac32ed74b4
1 changed files with 8 additions and 4 deletions
  1. 8
    4
      Marlin/src/Marlin.cpp

+ 8
- 4
Marlin/src/Marlin.cpp View File

@@ -1128,10 +1128,9 @@ void setup() {
1128 1128
  *  - Call inactivity manager
1129 1129
  */
1130 1130
 void loop() {
1131
+  do {
1131 1132
 
1132
-  for (;;) {
1133
-
1134
-    idle(); // Do an idle first so boot is slightly faster
1133
+    idle();
1135 1134
 
1136 1135
     #if ENABLED(SDSUPPORT)
1137 1136
       card.checkautostart();
@@ -1141,5 +1140,10 @@ void loop() {
1141 1140
     queue.advance();
1142 1141
 
1143 1142
     endstops.event_handler();
1144
-  }
1143
+
1144
+  } while (false        // Return to caller for best compatibility
1145
+    #ifdef __AVR__
1146
+      || true           // Loop forever on slower (AVR) boards
1147
+    #endif
1148
+  );
1145 1149
 }

Loading…
Cancel
Save