소스 검색

Add fast binary file transfer to SD card option (#12249)

Chris Pepper 5 년 전
부모
커밋
66d44c72c3
65개의 변경된 파일524개의 추가작업 그리고 21개의 파일을 삭제
  1. 3
    0
      Marlin/Configuration_adv.h
  2. 3
    0
      Marlin/src/config/default/Configuration_adv.h
  3. 3
    0
      Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h
  4. 3
    0
      Marlin/src/config/examples/Anet/A2/Configuration_adv.h
  5. 3
    0
      Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h
  6. 3
    0
      Marlin/src/config/examples/Anet/A6/Configuration_adv.h
  7. 3
    0
      Marlin/src/config/examples/Anet/A8/Configuration_adv.h
  8. 3
    0
      Marlin/src/config/examples/ArmEd/Configuration_adv.h
  9. 3
    0
      Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h
  10. 3
    0
      Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h
  11. 3
    0
      Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h
  12. 3
    0
      Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h
  13. 3
    0
      Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h
  14. 3
    0
      Marlin/src/config/examples/Cartesio/Configuration_adv.h
  15. 3
    0
      Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h
  16. 3
    0
      Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h
  17. 3
    0
      Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h
  18. 3
    0
      Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h
  19. 3
    0
      Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h
  20. 3
    0
      Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h
  21. 3
    0
      Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h
  22. 3
    0
      Marlin/src/config/examples/Einstart-S/Configuration_adv.h
  23. 3
    0
      Marlin/src/config/examples/Felix/Configuration_adv.h
  24. 3
    0
      Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h
  25. 3
    0
      Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h
  26. 3
    0
      Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h
  27. 3
    0
      Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h
  28. 3
    0
      Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h
  29. 3
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h
  30. 3
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h
  31. 3
    0
      Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h
  32. 3
    0
      Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h
  33. 3
    0
      Marlin/src/config/examples/MakerParts/Configuration_adv.h
  34. 3
    0
      Marlin/src/config/examples/Malyan/M150/Configuration_adv.h
  35. 3
    0
      Marlin/src/config/examples/Malyan/M200/Configuration_adv.h
  36. 3
    0
      Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h
  37. 3
    0
      Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h
  38. 3
    0
      Marlin/src/config/examples/RigidBot/Configuration_adv.h
  39. 3
    0
      Marlin/src/config/examples/SCARA/Configuration_adv.h
  40. 3
    0
      Marlin/src/config/examples/Sanguinololu/Configuration_adv.h
  41. 3
    0
      Marlin/src/config/examples/TheBorg/Configuration_adv.h
  42. 3
    0
      Marlin/src/config/examples/TinyBoy2/Configuration_adv.h
  43. 3
    0
      Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h
  44. 3
    0
      Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h
  45. 3
    0
      Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h
  46. 3
    0
      Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h
  47. 3
    0
      Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h
  48. 3
    0
      Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h
  49. 3
    0
      Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h
  50. 3
    0
      Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h
  51. 3
    0
      Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h
  52. 3
    0
      Marlin/src/config/examples/delta/generic/Configuration_adv.h
  53. 3
    0
      Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h
  54. 3
    0
      Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h
  55. 3
    0
      Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h
  56. 3
    0
      Marlin/src/config/examples/makibox/Configuration_adv.h
  57. 3
    0
      Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h
  58. 3
    0
      Marlin/src/config/examples/wt150/Configuration_adv.h
  59. 2
    1
      Marlin/src/feature/emergency_parser.cpp
  60. 10
    8
      Marlin/src/feature/emergency_parser.h
  61. 1
    1
      Marlin/src/feature/fwretract.h
  62. 274
    4
      Marlin/src/gcode/queue.cpp
  63. 39
    1
      Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp
  64. 12
    1
      Marlin/src/sd/cardreader.cpp
  65. 12
    5
      Marlin/src/sd/cardreader.h

+ 3
- 0
Marlin/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/default/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Anet/A2/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Anet/A6/Configuration_adv.h 파일 보기

@@ -740,6 +740,9 @@
740 740
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
741 741
   #endif
742 742
 
743
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
744
+  //#define FAST_FILE_TRANSFER
745
+
743 746
 #endif // SDSUPPORT
744 747
 
745 748
 /**

+ 3
- 0
Marlin/src/config/examples/Anet/A8/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/ArmEd/Configuration_adv.h 파일 보기

@@ -716,6 +716,9 @@
716 716
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
717 717
   #endif
718 718
 
719
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
720
+  //#define FAST_FILE_TRANSFER
721
+
719 722
 #endif // SDSUPPORT
720 723
 
721 724
 /**

+ 3
- 0
Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h 파일 보기

@@ -740,6 +740,9 @@
740 740
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
741 741
   #endif
742 742
 
743
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
744
+  //#define FAST_FILE_TRANSFER
745
+
743 746
 #endif // SDSUPPORT
744 747
 
745 748
 /**

+ 3
- 0
Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h 파일 보기

@@ -749,6 +749,9 @@
749 749
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
750 750
   #endif
751 751
 
752
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
753
+  //#define FAST_FILE_TRANSFER
754
+
752 755
 #endif // SDSUPPORT
753 756
 
754 757
 /**

+ 3
- 0
Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Cartesio/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Einstart-S/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Felix/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h 파일 보기

@@ -745,6 +745,9 @@
745 745
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
746 746
   #endif
747 747
 
748
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
749
+  //#define FAST_FILE_TRANSFER
750
+
748 751
 #endif // SDSUPPORT
749 752
 
750 753
 /**

+ 3
- 0
Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h 파일 보기

@@ -746,6 +746,9 @@
746 746
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
747 747
   #endif
748 748
 
749
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
750
+  //#define FAST_FILE_TRANSFER
751
+
749 752
 #endif // SDSUPPORT
750 753
 
751 754
 /**

+ 3
- 0
Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/MakerParts/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Malyan/M150/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Malyan/M200/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h 파일 보기

@@ -742,6 +742,9 @@
742 742
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
743 743
   #endif
744 744
 
745
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
746
+  //#define FAST_FILE_TRANSFER
747
+
745 748
 #endif // SDSUPPORT
746 749
 
747 750
 /**

+ 3
- 0
Marlin/src/config/examples/RigidBot/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/SCARA/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Sanguinololu/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/TheBorg/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/TinyBoy2/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h 파일 보기

@@ -754,6 +754,9 @@
754 754
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
755 755
   #endif
756 756
 
757
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
758
+  //#define FAST_FILE_TRANSFER
759
+
757 760
 #endif // SDSUPPORT
758 761
 
759 762
 /**

+ 3
- 0
Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h 파일 보기

@@ -743,6 +743,9 @@
743 743
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
744 744
   #endif
745 745
 
746
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
747
+  //#define FAST_FILE_TRANSFER
748
+
746 749
 #endif // SDSUPPORT
747 750
 
748 751
 /**

+ 3
- 0
Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h 파일 보기

@@ -743,6 +743,9 @@
743 743
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
744 744
   #endif
745 745
 
746
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
747
+  //#define FAST_FILE_TRANSFER
748
+
746 749
 #endif // SDSUPPORT
747 750
 
748 751
 /**

+ 3
- 0
Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h 파일 보기

@@ -743,6 +743,9 @@
743 743
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
744 744
   #endif
745 745
 
746
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
747
+  //#define FAST_FILE_TRANSFER
748
+
746 749
 #endif // SDSUPPORT
747 750
 
748 751
 /**

+ 3
- 0
Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h 파일 보기

@@ -743,6 +743,9 @@
743 743
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
744 744
   #endif
745 745
 
746
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
747
+  //#define FAST_FILE_TRANSFER
748
+
746 749
 #endif // SDSUPPORT
747 750
 
748 751
 /**

+ 3
- 0
Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h 파일 보기

@@ -743,6 +743,9 @@
743 743
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
744 744
   #endif
745 745
 
746
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
747
+  //#define FAST_FILE_TRANSFER
748
+
746 749
 #endif // SDSUPPORT
747 750
 
748 751
 /**

+ 3
- 0
Marlin/src/config/examples/delta/generic/Configuration_adv.h 파일 보기

@@ -743,6 +743,9 @@
743 743
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
744 744
   #endif
745 745
 
746
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
747
+  //#define FAST_FILE_TRANSFER
748
+
746 749
 #endif // SDSUPPORT
747 750
 
748 751
 /**

+ 3
- 0
Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h 파일 보기

@@ -743,6 +743,9 @@
743 743
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
744 744
   #endif
745 745
 
746
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
747
+  //#define FAST_FILE_TRANSFER
748
+
746 749
 #endif // SDSUPPORT
747 750
 
748 751
 /**

+ 3
- 0
Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h 파일 보기

@@ -743,6 +743,9 @@
743 743
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
744 744
   #endif
745 745
 
746
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
747
+  //#define FAST_FILE_TRANSFER
748
+
746 749
 #endif // SDSUPPORT
747 750
 
748 751
 /**

+ 3
- 0
Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/makibox/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h 파일 보기

@@ -741,6 +741,9 @@
741 741
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
742 742
   #endif
743 743
 
744
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
745
+  //#define FAST_FILE_TRANSFER
746
+
744 747
 #endif // SDSUPPORT
745 748
 
746 749
 /**

+ 3
- 0
Marlin/src/config/examples/wt150/Configuration_adv.h 파일 보기

@@ -742,6 +742,9 @@
742 742
     #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF
743 743
   #endif
744 744
 
745
+  // Add an optimized binary file transfer mode, initiated with 'M28 B1'
746
+  //#define FAST_FILE_TRANSFER
747
+
745 748
 #endif // SDSUPPORT
746 749
 
747 750
 /**

+ 2
- 1
Marlin/src/feature/emergency_parser.cpp 파일 보기

@@ -31,7 +31,8 @@
31 31
 #include "emergency_parser.h"
32 32
 
33 33
 // Static data members
34
-bool EmergencyParser::killed_by_M112; // = false
34
+bool EmergencyParser::killed_by_M112, // = false
35
+     EmergencyParser::enabled;
35 36
 
36 37
 // Global instance
37 38
 EmergencyParser emergency_parser;

+ 10
- 8
Marlin/src/feature/emergency_parser.h 파일 보기

@@ -19,13 +19,13 @@
19 19
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 20
  *
21 21
  */
22
+#pragma once
22 23
 
23 24
 /**
24 25
  * emergency_parser.h - Intercept special commands directly in the serial stream
25 26
  */
26 27
 
27
-#ifndef _EMERGENCY_PARSER_H_
28
-#define _EMERGENCY_PARSER_H_
28
+#define FORCE_INLINE __attribute__((always_inline)) inline
29 29
 
30 30
 // External references
31 31
 extern volatile bool wait_for_user, wait_for_heatup;
@@ -53,11 +53,13 @@ public:
53 53
 
54 54
   static bool killed_by_M112;
55 55
 
56
-  EmergencyParser() {}
56
+  EmergencyParser() { enable(); }
57 57
 
58
-  __attribute__((always_inline)) inline
59
-  static void update(State &state, const uint8_t c) {
58
+  FORCE_INLINE static void enable()  { enabled = true; }
60 59
 
60
+  FORCE_INLINE static void disable() { enabled = false; }
61
+
62
+  FORCE_INLINE static void update(State &state, const uint8_t c) {
61 63
     switch (state) {
62 64
       case EP_RESET:
63 65
         switch (c) {
@@ -118,7 +120,7 @@ public:
118 120
 
119 121
       default:
120 122
         if (c == '\n') {
121
-          switch (state) {
123
+          if (enabled) switch (state) {
122 124
             case EP_M108:
123 125
               wait_for_user = wait_for_heatup = false;
124 126
               break;
@@ -136,8 +138,8 @@ public:
136 138
     }
137 139
   }
138 140
 
141
+private:
142
+  static bool enabled;
139 143
 };
140 144
 
141 145
 extern EmergencyParser emergency_parser;
142
-
143
-#endif // _EMERGENCY_PARSER_H_

+ 1
- 1
Marlin/src/feature/fwretract.h 파일 보기

@@ -56,7 +56,7 @@ public:
56 56
   #if ENABLED(FWRETRACT_AUTORETRACT)
57 57
     static bool autoretract_enabled;               // M209 S - Autoretract switch
58 58
   #else
59
-    constexpr static bool autoretract_enabled = false;
59
+    static constexpr bool autoretract_enabled = false;
60 60
   #endif
61 61
 
62 62
   static bool retracted[EXTRUDERS];                // Which extruders are currently retracted

+ 274
- 4
Marlin/src/gcode/queue.cpp 파일 보기

@@ -258,14 +258,15 @@ void gcode_line_error(PGM_P err, uint8_t port) {
258 258
 }
259 259
 
260 260
 static bool serial_data_available() {
261
-  return (MYSERIAL0.available() ? true :
261
+  return false
262
+    || MYSERIAL0.available()
262 263
     #if NUM_SERIAL > 1
263
-      MYSERIAL1.available() ? true :
264
+      || MYSERIAL1.available()
264 265
     #endif
265
-    false);
266
+  ;
266 267
 }
267 268
 
268
-static int read_serial(const int index) {
269
+static int read_serial(const uint8_t index) {
269 270
   switch (index) {
270 271
     case 0: return MYSERIAL0.read();
271 272
     #if NUM_SERIAL > 1
@@ -275,6 +276,263 @@ static int read_serial(const int index) {
275 276
   }
276 277
 }
277 278
 
279
+#if ENABLED(FAST_FILE_TRANSFER)
280
+
281
+  #if ENABLED(SDSUPPORT)
282
+    #define CARD_CHAR_P(C)   SERIAL_CHAR_P(card.transfer_port, C)
283
+    #define CARD_ECHO_P(V)   SERIAL_ECHO_P(card.transfer_port, V)
284
+    #define CARD_ECHOLN_P(V) SERIAL_ECHOLN_P(card.transfer_port, V)
285
+  #endif
286
+
287
+  static bool serial_data_available(const uint8_t index) {
288
+    switch (index) {
289
+      case 0: return MYSERIAL0.available();
290
+      #if NUM_SERIAL > 1
291
+        case 1: return MYSERIAL1.available();
292
+      #endif
293
+      default: return false;
294
+    }
295
+  }
296
+
297
+  class BinaryStream {
298
+  public:
299
+    enum class StreamState : uint8_t {
300
+      STREAM_RESET,
301
+      PACKET_RESET,
302
+      STREAM_HEADER,
303
+      PACKET_HEADER,
304
+      PACKET_DATA,
305
+      PACKET_VALIDATE,
306
+      PACKET_RESEND,
307
+      PACKET_FLUSHRX,
308
+      PACKET_TIMEOUT,
309
+      STREAM_COMPLETE,
310
+      STREAM_FAILED,
311
+    };
312
+
313
+    #pragma pack(push, 1)
314
+
315
+      struct StreamHeader {
316
+        uint16_t token;
317
+        uint32_t filesize;
318
+      };
319
+      union {
320
+        uint8_t stream_header_bytes[sizeof(StreamHeader)];
321
+        StreamHeader stream_header;
322
+      };
323
+
324
+      struct Packet {
325
+        struct Header {
326
+          uint32_t id;
327
+          uint16_t size, checksum;
328
+        };
329
+        union {
330
+          uint8_t header_bytes[sizeof(Header)];
331
+          Header header;
332
+        };
333
+        uint32_t bytes_received;
334
+        uint16_t checksum;
335
+        millis_t timeout;
336
+      } packet{};
337
+
338
+    #pragma pack(pop)
339
+
340
+    void packet_reset() {
341
+      packet.header.id = 0;
342
+      packet.header.size = 0;
343
+      packet.header.checksum = 0;
344
+      packet.bytes_received = 0;
345
+      packet.checksum = 0x53A2;
346
+      packet.timeout = millis() + STREAM_MAX_WAIT;
347
+    }
348
+
349
+    void stream_reset() {
350
+      packets_received = 0;
351
+      bytes_received = 0;
352
+      packet_retries = 0;
353
+      buffer_next_index = 0;
354
+      stream_header.token = 0;
355
+      stream_header.filesize = 0;
356
+    }
357
+
358
+    uint32_t checksum(uint32_t seed, uint8_t value) {
359
+      return ((seed ^ value) ^ (seed << 8)) & 0xFFFF;
360
+    }
361
+
362
+    // read the next byte from the data stream keeping track of
363
+    // whether the stream times out from data starvation
364
+    // takes the data variable by reference in order to return status
365
+    bool stream_read(uint8_t& data) {
366
+      if (ELAPSED(millis(), packet.timeout)) {
367
+        stream_state = StreamState::PACKET_TIMEOUT;
368
+        return false;
369
+      }
370
+      if (!serial_data_available(card.transfer_port)) return false;
371
+      data = read_serial(card.transfer_port);
372
+      packet.timeout = millis() + STREAM_MAX_WAIT;
373
+      return true;
374
+    }
375
+
376
+    template<const size_t buffer_size>
377
+    void receive(char (&buffer)[buffer_size]) {
378
+      uint8_t data = 0;
379
+      millis_t tranfer_timeout = millis() + RX_TIMESLICE;
380
+      while (PENDING(millis(), tranfer_timeout)) {
381
+        switch (stream_state) {
382
+          case StreamState::STREAM_RESET:
383
+            stream_reset();
384
+          case StreamState::PACKET_RESET:
385
+            packet_reset();
386
+            stream_state = StreamState::PACKET_HEADER;
387
+            break;
388
+          case StreamState::STREAM_HEADER: // we could also transfer the filename in this packet, rather than handling it in the gcode
389
+            for (size_t i = 0; i < sizeof(stream_header); ++i) {
390
+              stream_header_bytes[i] = buffer[i];
391
+            }
392
+            if (stream_header.token == 0x1234) {
393
+              stream_state = StreamState::PACKET_RESET;
394
+              bytes_received = 0;
395
+              time_stream_start = millis();
396
+              CARD_ECHO_P("echo: Datastream initialized (");
397
+              CARD_ECHO_P(stream_header.filesize);
398
+              CARD_ECHOLN_P("Bytes expected)");
399
+              CARD_ECHO_P("so"); // confirm active stream and the maximum block size supported
400
+              CARD_CHAR_P(static_cast<uint8_t>(buffer_size & 0xFF));
401
+              CARD_CHAR_P(static_cast<uint8_t>((buffer_size >> 8) & 0xFF));
402
+              CARD_CHAR_P('\n');
403
+            }
404
+            else {
405
+              CARD_ECHOLN_P("echo: Datastream initialization error (invalid token)");
406
+              stream_state = StreamState::STREAM_FAILED;
407
+            }
408
+            buffer_next_index = 0;
409
+            break;
410
+          case StreamState::PACKET_HEADER:
411
+            if (!stream_read(data)) break;
412
+
413
+            packet.header_bytes[packet.bytes_received++] = data;
414
+            if (packet.bytes_received == sizeof(Packet::Header)) {
415
+              if (packet.header.id == packets_received) {
416
+                buffer_next_index = 0;
417
+                packet.bytes_received = 0;
418
+                stream_state = StreamState::PACKET_DATA;
419
+              }
420
+              else {
421
+                CARD_ECHO_P("echo: Datastream packet out of order");
422
+                stream_state = StreamState::PACKET_FLUSHRX;
423
+              }
424
+            }
425
+            break;
426
+          case StreamState::PACKET_DATA:
427
+            if (!stream_read(data)) break;
428
+
429
+            if (buffer_next_index < buffer_size) {
430
+              buffer[buffer_next_index] = data;
431
+            }
432
+            else {
433
+              CARD_ECHO_P("echo: Datastream packet data buffer overrun");
434
+              stream_state = StreamState::STREAM_FAILED;
435
+              break;
436
+            }
437
+
438
+            packet.checksum = checksum(packet.checksum, data);
439
+            packet.bytes_received ++;
440
+            buffer_next_index ++;
441
+
442
+            if (packet.bytes_received == packet.header.size) {
443
+              stream_state = StreamState::PACKET_VALIDATE;
444
+            }
445
+            break;
446
+          case StreamState::PACKET_VALIDATE:
447
+            if (packet.header.checksum == packet.checksum) {
448
+              packet_retries = 0;
449
+              packets_received ++;
450
+              bytes_received += packet.header.size;
451
+
452
+              if (packet.header.id == 0) {                 // id 0 is always the stream descriptor
453
+                stream_state = StreamState::STREAM_HEADER; // defer packet confirmation to STREAM_HEADER state
454
+              }
455
+              else {
456
+                if (bytes_received < stream_header.filesize) {
457
+                  stream_state = StreamState::PACKET_RESET;    // reset and receive next packet
458
+                  CARD_ECHOLN_P("ok");   // transmit confirm packet received and valid token
459
+                }
460
+                else  {
461
+                  stream_state = StreamState::STREAM_COMPLETE; // no more data required
462
+                }
463
+                if (card.write(buffer, buffer_next_index) < 0) {
464
+                  stream_state = StreamState::STREAM_FAILED;
465
+                  CARD_ECHO_P("echo: IO ERROR");
466
+                  break;
467
+                };
468
+              }
469
+            }
470
+            else {
471
+              CARD_ECHO_P("echo: Block(");
472
+              CARD_ECHO_P(packet.header.id);
473
+              CARD_ECHOLN_P(") Corrupt");
474
+              stream_state = StreamState::PACKET_FLUSHRX;
475
+            }
476
+            break;
477
+          case StreamState::PACKET_RESEND:
478
+            if (packet_retries < MAX_RETRIES) {
479
+              packet_retries ++;
480
+              stream_state = StreamState::PACKET_RESET;
481
+              CARD_ECHO_P("echo: Resend request ");
482
+              CARD_ECHOLN_P(packet_retries);
483
+              CARD_ECHOLN_P("rs"); // transmit resend packet token
484
+            }
485
+            else {
486
+              stream_state = StreamState::STREAM_FAILED;
487
+            }
488
+            break;
489
+          case StreamState::PACKET_FLUSHRX:
490
+            if (ELAPSED(millis(), packet.timeout)) {
491
+              stream_state = StreamState::PACKET_RESEND;
492
+              break;
493
+            }
494
+            if (!serial_data_available(card.transfer_port)) break;
495
+            read_serial(card.transfer_port); // throw away data
496
+            packet.timeout = millis() + STREAM_MAX_WAIT;
497
+            break;
498
+          case StreamState::PACKET_TIMEOUT:
499
+            CARD_ECHOLN_P("echo: Datastream timeout");
500
+            stream_state = StreamState::PACKET_RESEND;
501
+            break;
502
+          case StreamState::STREAM_COMPLETE:
503
+            stream_state = StreamState::STREAM_RESET;
504
+            card.binary_mode = false;
505
+            card.closefile();
506
+            CARD_ECHO_P("echo: ");
507
+            CARD_ECHO_P(card.filename);
508
+            CARD_ECHO_P(" transfer completed @ ");
509
+            CARD_ECHO_P(((bytes_received / (millis() - time_stream_start) * 1000) / 1024 ));
510
+            CARD_ECHOLN_P("KiB/s");
511
+            CARD_ECHOLN_P("sc"); // transmit stream complete token
512
+            return;
513
+          case StreamState::STREAM_FAILED:
514
+            stream_state = StreamState::STREAM_RESET;
515
+            card.binary_mode = false;
516
+            card.closefile();
517
+            card.removeFile(card.filename);
518
+            CARD_ECHOLN_P("echo: File transfer failed");
519
+            CARD_ECHOLN_P("sf"); // transmit stream failed token
520
+            return;
521
+        }
522
+      }
523
+    }
524
+
525
+    static const uint16_t STREAM_MAX_WAIT = 500, RX_TIMESLICE = 20, MAX_RETRIES = 3;
526
+    uint8_t  packet_retries;
527
+    uint16_t buffer_next_index;
528
+    uint32_t packets_received,  bytes_received;
529
+    millis_t time_stream_start;
530
+    StreamState stream_state = StreamState::STREAM_RESET;
531
+
532
+  } binaryStream{};
533
+
534
+#endif // FAST_FILE_TRANSFER
535
+
278 536
 /**
279 537
  * Get all commands waiting on the serial port and queue them.
280 538
  * Exit when the buffer is full or when no more characters are
@@ -288,6 +546,18 @@ inline void get_serial_commands() {
288 546
               #endif
289 547
             ;
290 548
 
549
+  #if ENABLED(FAST_FILE_TRANSFER)
550
+    if (card.saving && card.binary_mode) {
551
+      /**
552
+       * For binary stream file transfer, use serial_line_buffer as the working
553
+       * receive buffer (which limits the packet size to MAX_CMD_SIZE).
554
+       * The receive buffer also limits the packet size for reliable transmission.
555
+       */
556
+      binaryStream.receive(serial_line_buffer[card.transfer_port]);
557
+      return;
558
+    }
559
+  #endif
560
+
291 561
   // If the command buffer is empty for too long,
292 562
   // send "wait" to indicate Marlin is still waiting.
293 563
   #if NO_TIMEOUTS > 0

+ 39
- 1
Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp 파일 보기

@@ -157,7 +157,45 @@ void GcodeSuite::M27() {
157 157
 /**
158 158
  * M28: Start SD Write
159 159
  */
160
-void GcodeSuite::M28() { card.openFile(parser.string_arg, false); }
160
+void GcodeSuite::M28() {
161
+
162
+  #if ENABLED(FAST_FILE_TRANSFER)
163
+
164
+    const int16_t port =
165
+      #if NUM_SERIAL > 1
166
+        command_queue_port[cmd_queue_index_r]
167
+      #else
168
+        0
169
+      #endif
170
+    ;
171
+
172
+    bool binary_mode = false;
173
+    char *p = parser.string_arg;
174
+    if (p[0] == 'B' && NUMERIC(p[1])) {
175
+      binary_mode = p[1] > '0';
176
+      p += 2;
177
+      while (*p == ' ') ++p;
178
+    }
179
+
180
+    // Binary transfer mode
181
+    if ((card.binary_mode = binary_mode)) {
182
+      SERIAL_ECHO_START_P(port);
183
+      SERIAL_ECHO_P(port, " preparing to receive: ");
184
+      SERIAL_ECHOLN_P(port, p);
185
+      card.openFile(p, false);
186
+      #if NUM_SERIAL > 1
187
+        card.transfer_port = port;
188
+      #endif
189
+    }
190
+    else
191
+      card.openFile(p, false);
192
+
193
+  #else
194
+
195
+    card.openFile(parser.string_arg, false);
196
+
197
+  #endif
198
+}
161 199
 
162 200
 /**
163 201
  * M29: Stop SD Write

+ 12
- 1
Marlin/src/sd/cardreader.cpp 파일 보기

@@ -33,6 +33,10 @@
33 33
 #include "../core/language.h"
34 34
 #include "../gcode/queue.h"
35 35
 
36
+#if ENABLED(EMERGENCY_PARSER)
37
+  #include "../feature/emergency_parser.h"
38
+#endif
39
+
36 40
 #if ENABLED(POWER_LOSS_RECOVERY)
37 41
   #include "../feature/power_loss_recovery.h"
38 42
 #endif
@@ -461,7 +465,11 @@ void CardReader::openFile(char * const path, const bool read, const bool subcall
461 465
     }
462 466
     else {
463 467
       saving = true;
464
-      SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, path);
468
+      getfilename(0, fname);
469
+      #if ENABLED(EMERGENCY_PARSER)
470
+        emergency_parser.disable();
471
+      #endif
472
+      SERIAL_PROTOCOLLNPAIR(MSG_SD_WRITE_TO_FILE, fname);
465 473
       lcd_setstatus(fname);
466 474
     }
467 475
   }
@@ -569,6 +577,9 @@ void CardReader::closefile(const bool store_location) {
569 577
   file.sync();
570 578
   file.close();
571 579
   saving = logging = false;
580
+  #if ENABLED(EMERGENCY_PARSER)
581
+    emergency_parser.enable();
582
+  #endif
572 583
 
573 584
   if (store_location) {
574 585
     //future: store printer state, filename and position for continuing a stopped print

+ 12
- 5
Marlin/src/sd/cardreader.h 파일 보기

@@ -124,11 +124,8 @@ public:
124 124
   FORCE_INLINE uint32_t getIndex() { return sdpos; }
125 125
   FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; }
126 126
   FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; }
127
-
128
-  #if defined(__STM32F1__) && ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION)
129
-    FORCE_INLINE int16_t read(void* buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; }
130
-    FORCE_INLINE int16_t write(void* buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; }
131
-  #endif
127
+  FORCE_INLINE int16_t read(void* buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; }
128
+  FORCE_INLINE int16_t write(void* buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; }
132 129
 
133 130
   Sd2Card& getSd2Card() { return sd2card; }
134 131
 
@@ -154,6 +151,16 @@ public:
154 151
   bool saving, logging, sdprinting, cardOK, filenameIsDir, abort_sd_printing;
155 152
   char filename[FILENAME_LENGTH], longFilename[LONG_FILENAME_LENGTH];
156 153
   int8_t autostart_index;
154
+
155
+  #if ENABLED(FAST_FILE_TRANSFER)
156
+    bool binary_mode;
157
+    #if NUM_SERIAL > 1
158
+      uint8_t transfer_port;
159
+    #else
160
+      constexpr uint8_t transfer_port = 0;
161
+    #endif
162
+  #endif
163
+
157 164
 private:
158 165
   SdFile root, workDir, workDirParents[MAX_DIR_DEPTH];
159 166
   uint8_t workDirDepth;

Loading…
취소
저장