Bläddra i källkod

Fix blocking delay in Photo G-code M240 (#15728)

Raúl Lázaro Sánchez 5 år sedan
förälder
incheckning
7c60853219
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. 3
    2
      Marlin/src/gcode/feature/camera/M240.cpp

+ 3
- 2
Marlin/src/gcode/feature/camera/M240.cpp Visa fil

148
   #if PIN_EXISTS(CHDK)
148
   #if PIN_EXISTS(CHDK)
149
 
149
 
150
     OUT_WRITE(CHDK_PIN, HIGH);
150
     OUT_WRITE(CHDK_PIN, HIGH);
151
-    chdk_timeout = millis() + PHOTO_SWITCH_MS;
151
+    chdk_timeout = millis() + parser.intval('D', PHOTO_SWITCH_MS);
152
 
152
 
153
   #elif HAS_PHOTOGRAPH
153
   #elif HAS_PHOTOGRAPH
154
 
154
 
160
 
160
 
161
   #ifdef PHOTO_POSITION
161
   #ifdef PHOTO_POSITION
162
     #if PHOTO_DELAY_MS > 0
162
     #if PHOTO_DELAY_MS > 0
163
-      safe_delay(parser.intval('P', PHOTO_DELAY_MS));
163
+      const millis_t timeout = millis() + parser.intval('P', PHOTO_DELAY_MS);
164
+      while (PENDING(millis(), timeout)) idle();
164
     #endif
165
     #endif
165
     do_blocking_move_to(old_pos, fr_mm_s);
166
     do_blocking_move_to(old_pos, fr_mm_s);
166
     #ifdef PHOTO_RETRACT_MM
167
     #ifdef PHOTO_RETRACT_MM

Laddar…
Avbryt
Spara