ソースを参照

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

Raúl Lázaro Sánchez 5年前
コミット
7c60853219
1個のファイルの変更3行の追加2行の削除
  1. 3
    2
      Marlin/src/gcode/feature/camera/M240.cpp

+ 3
- 2
Marlin/src/gcode/feature/camera/M240.cpp ファイルの表示

@@ -148,7 +148,7 @@ void GcodeSuite::M240() {
148 148
   #if PIN_EXISTS(CHDK)
149 149
 
150 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 153
   #elif HAS_PHOTOGRAPH
154 154
 
@@ -160,7 +160,8 @@ void GcodeSuite::M240() {
160 160
 
161 161
   #ifdef PHOTO_POSITION
162 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 165
     #endif
165 166
     do_blocking_move_to(old_pos, fr_mm_s);
166 167
     #ifdef PHOTO_RETRACT_MM

読み込み中…
キャンセル
保存