瀏覽代碼

[2.0.x] Add endstop noise filter (#10796)

Scott Lahteine 6 年之前
父節點
當前提交
4b2f6e3b2b
No account linked to committer's email address
共有 73 個文件被更改,包括 1379 次插入132 次删除
  1. 17
    0
      Marlin/Configuration.h
  2. 17
    0
      Marlin/src/config/default/Configuration.h
  3. 17
    0
      Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h
  4. 17
    0
      Marlin/src/config/examples/AliExpress/CL-260/Configuration.h
  5. 17
    0
      Marlin/src/config/examples/Anet/A6/Configuration.h
  6. 17
    0
      Marlin/src/config/examples/Anet/A8/Configuration.h
  7. 17
    0
      Marlin/src/config/examples/Azteeg/X5GT/Configuration.h
  8. 17
    0
      Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h
  9. 17
    0
      Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h
  10. 17
    0
      Marlin/src/config/examples/BQ/Hephestos/Configuration.h
  11. 17
    0
      Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h
  12. 17
    0
      Marlin/src/config/examples/BQ/WITBOX/Configuration.h
  13. 17
    0
      Marlin/src/config/examples/Cartesio/Configuration.h
  14. 17
    0
      Marlin/src/config/examples/Creality/CR-10/Configuration.h
  15. 17
    0
      Marlin/src/config/examples/Creality/CR-10S/Configuration.h
  16. 17
    0
      Marlin/src/config/examples/Creality/CR-10mini/Configuration.h
  17. 17
    0
      Marlin/src/config/examples/Creality/CR-8/Configuration.h
  18. 17
    0
      Marlin/src/config/examples/Creality/Ender-2/Configuration.h
  19. 17
    0
      Marlin/src/config/examples/Creality/Ender-3/Configuration.h
  20. 17
    0
      Marlin/src/config/examples/Creality/Ender-4/Configuration.h
  21. 17
    0
      Marlin/src/config/examples/Felix/Configuration.h
  22. 17
    0
      Marlin/src/config/examples/Felix/DUAL/Configuration.h
  23. 17
    0
      Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h
  24. 17
    0
      Marlin/src/config/examples/Geeetech/GT2560/Configuration.h
  25. 17
    0
      Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h
  26. 17
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h
  27. 17
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h
  28. 17
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h
  29. 17
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h
  30. 17
    0
      Marlin/src/config/examples/Infitary/i3-M508/Configuration.h
  31. 17
    0
      Marlin/src/config/examples/JGAurora/A5/Configuration.h
  32. 17
    0
      Marlin/src/config/examples/MakerParts/Configuration.h
  33. 17
    0
      Marlin/src/config/examples/Malyan/M150/Configuration.h
  34. 17
    0
      Marlin/src/config/examples/Malyan/M200/Configuration.h
  35. 17
    0
      Marlin/src/config/examples/Micromake/C1/basic/Configuration.h
  36. 17
    0
      Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h
  37. 17
    0
      Marlin/src/config/examples/Mks/Sbase/Configuration.h
  38. 17
    0
      Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h
  39. 17
    0
      Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h
  40. 17
    0
      Marlin/src/config/examples/RigidBot/Configuration.h
  41. 17
    0
      Marlin/src/config/examples/SCARA/Configuration.h
  42. 17
    0
      Marlin/src/config/examples/STM32F10/Configuration.h
  43. 17
    0
      Marlin/src/config/examples/STM32F4/Configuration.h
  44. 17
    0
      Marlin/src/config/examples/Sanguinololu/Configuration.h
  45. 17
    0
      Marlin/src/config/examples/TheBorg/Configuration.h
  46. 17
    0
      Marlin/src/config/examples/TinyBoy2/Configuration.h
  47. 17
    0
      Marlin/src/config/examples/Tronxy/X1/Configuration.h
  48. 17
    0
      Marlin/src/config/examples/Tronxy/X5S/Configuration.h
  49. 17
    0
      Marlin/src/config/examples/Tronxy/XY100/Configuration.h
  50. 17
    0
      Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h
  51. 17
    0
      Marlin/src/config/examples/Velleman/K8200/Configuration.h
  52. 17
    0
      Marlin/src/config/examples/Velleman/K8400/Configuration.h
  53. 17
    0
      Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h
  54. 17
    0
      Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h
  55. 17
    0
      Marlin/src/config/examples/adafruit/ST7565/Configuration.h
  56. 17
    0
      Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h
  57. 17
    0
      Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h
  58. 17
    0
      Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h
  59. 17
    0
      Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h
  60. 17
    0
      Marlin/src/config/examples/delta/generic/Configuration.h
  61. 17
    0
      Marlin/src/config/examples/delta/kossel_mini/Configuration.h
  62. 17
    0
      Marlin/src/config/examples/delta/kossel_pro/Configuration.h
  63. 17
    0
      Marlin/src/config/examples/delta/kossel_xl/Configuration.h
  64. 17
    0
      Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h
  65. 17
    0
      Marlin/src/config/examples/makibox/Configuration.h
  66. 17
    0
      Marlin/src/config/examples/stm32f103ret6/Configuration.h
  67. 17
    0
      Marlin/src/config/examples/tvrrug/Round2/Configuration.h
  68. 17
    0
      Marlin/src/config/examples/wt150/Configuration.h
  69. 1
    1
      Marlin/src/module/delta.cpp
  70. 197
    111
      Marlin/src/module/endstops.cpp
  71. 20
    15
      Marlin/src/module/endstops.h
  72. 1
    1
      Marlin/src/module/probe.cpp
  73. 4
    4
      Marlin/src/module/stepper.cpp

+ 17
- 0
Marlin/Configuration.h 查看文件

@@ -554,6 +554,23 @@
554 554
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
555 555
 //#define ENDSTOP_INTERRUPTS_FEATURE
556 556
 
557
+/**
558
+ * Endstop Noise Filter
559
+ *
560
+ * Enable this option if endstops falsely trigger due to noise.
561
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
562
+ * will end up at a slightly different position on each G28. This will also
563
+ * reduce accuracy of some bed probes.
564
+ * For mechanical switches, the better approach to reduce noise is to install
565
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
566
+ * essentially noise-proof without sacrificing accuracy.
567
+ * This option also increases MCU load when endstops or the probe are enabled.
568
+ * So this is not recommended. USE AT YOUR OWN RISK.
569
+ * (This feature is not required for common micro-switches mounted on PCBs
570
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
571
+ */
572
+//#define ENDSTOP_NOISE_FILTER
573
+
557 574
 //=============================================================================
558 575
 //============================== Movement Settings ============================
559 576
 //=============================================================================

+ 17
- 0
Marlin/src/config/default/Configuration.h 查看文件

@@ -554,6 +554,23 @@
554 554
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
555 555
 //#define ENDSTOP_INTERRUPTS_FEATURE
556 556
 
557
+/**
558
+ * Endstop Noise Filter
559
+ *
560
+ * Enable this option if endstops falsely trigger due to noise.
561
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
562
+ * will end up at a slightly different position on each G28. This will also
563
+ * reduce accuracy of some bed probes.
564
+ * For mechanical switches, the better approach to reduce noise is to install
565
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
566
+ * essentially noise-proof without sacrificing accuracy.
567
+ * This option also increases MCU load when endstops or the probe are enabled.
568
+ * So this is not recommended. USE AT YOUR OWN RISK.
569
+ * (This feature is not required for common micro-switches mounted on PCBs
570
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
571
+ */
572
+//#define ENDSTOP_NOISE_FILTER
573
+
557 574
 //=============================================================================
558 575
 //============================== Movement Settings ============================
559 576
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h 查看文件

@@ -573,6 +573,23 @@
573 573
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
574 574
 //#define ENDSTOP_INTERRUPTS_FEATURE
575 575
 
576
+/**
577
+ * Endstop Noise Filter
578
+ *
579
+ * Enable this option if endstops falsely trigger due to noise.
580
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
581
+ * will end up at a slightly different position on each G28. This will also
582
+ * reduce accuracy of some bed probes.
583
+ * For mechanical switches, the better approach to reduce noise is to install
584
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
585
+ * essentially noise-proof without sacrificing accuracy.
586
+ * This option also increases MCU load when endstops or the probe are enabled.
587
+ * So this is not recommended. USE AT YOUR OWN RISK.
588
+ * (This feature is not required for common micro-switches mounted on PCBs
589
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
590
+ */
591
+//#define ENDSTOP_NOISE_FILTER
592
+
576 593
 //=============================================================================
577 594
 //============================== Movement Settings ============================
578 595
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/AliExpress/CL-260/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Anet/A6/Configuration.h 查看文件

@@ -573,6 +573,23 @@
573 573
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
574 574
 #define ENDSTOP_INTERRUPTS_FEATURE
575 575
 
576
+/**
577
+ * Endstop Noise Filter
578
+ *
579
+ * Enable this option if endstops falsely trigger due to noise.
580
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
581
+ * will end up at a slightly different position on each G28. This will also
582
+ * reduce accuracy of some bed probes.
583
+ * For mechanical switches, the better approach to reduce noise is to install
584
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
585
+ * essentially noise-proof without sacrificing accuracy.
586
+ * This option also increases MCU load when endstops or the probe are enabled.
587
+ * So this is not recommended. USE AT YOUR OWN RISK.
588
+ * (This feature is not required for common micro-switches mounted on PCBs
589
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
590
+ */
591
+//#define ENDSTOP_NOISE_FILTER
592
+
576 593
 //=============================================================================
577 594
 //============================== Movement Settings ============================
578 595
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Anet/A8/Configuration.h 查看文件

@@ -560,6 +560,23 @@
560 560
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
561 561
 #define ENDSTOP_INTERRUPTS_FEATURE
562 562
 
563
+/**
564
+ * Endstop Noise Filter
565
+ *
566
+ * Enable this option if endstops falsely trigger due to noise.
567
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
568
+ * will end up at a slightly different position on each G28. This will also
569
+ * reduce accuracy of some bed probes.
570
+ * For mechanical switches, the better approach to reduce noise is to install
571
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
572
+ * essentially noise-proof without sacrificing accuracy.
573
+ * This option also increases MCU load when endstops or the probe are enabled.
574
+ * So this is not recommended. USE AT YOUR OWN RISK.
575
+ * (This feature is not required for common micro-switches mounted on PCBs
576
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
577
+ */
578
+//#define ENDSTOP_NOISE_FILTER
579
+
563 580
 //=============================================================================
564 581
 //============================== Movement Settings ============================
565 582
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Azteeg/X5GT/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/BQ/Hephestos/Configuration.h 查看文件

@@ -541,6 +541,23 @@
541 541
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
542 542
 //#define ENDSTOP_INTERRUPTS_FEATURE
543 543
 
544
+/**
545
+ * Endstop Noise Filter
546
+ *
547
+ * Enable this option if endstops falsely trigger due to noise.
548
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
549
+ * will end up at a slightly different position on each G28. This will also
550
+ * reduce accuracy of some bed probes.
551
+ * For mechanical switches, the better approach to reduce noise is to install
552
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
553
+ * essentially noise-proof without sacrificing accuracy.
554
+ * This option also increases MCU load when endstops or the probe are enabled.
555
+ * So this is not recommended. USE AT YOUR OWN RISK.
556
+ * (This feature is not required for common micro-switches mounted on PCBs
557
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
558
+ */
559
+//#define ENDSTOP_NOISE_FILTER
560
+
544 561
 //=============================================================================
545 562
 //============================== Movement Settings ============================
546 563
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h 查看文件

@@ -554,6 +554,23 @@
554 554
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
555 555
 #define ENDSTOP_INTERRUPTS_FEATURE
556 556
 
557
+/**
558
+ * Endstop Noise Filter
559
+ *
560
+ * Enable this option if endstops falsely trigger due to noise.
561
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
562
+ * will end up at a slightly different position on each G28. This will also
563
+ * reduce accuracy of some bed probes.
564
+ * For mechanical switches, the better approach to reduce noise is to install
565
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
566
+ * essentially noise-proof without sacrificing accuracy.
567
+ * This option also increases MCU load when endstops or the probe are enabled.
568
+ * So this is not recommended. USE AT YOUR OWN RISK.
569
+ * (This feature is not required for common micro-switches mounted on PCBs
570
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
571
+ */
572
+//#define ENDSTOP_NOISE_FILTER
573
+
557 574
 //=============================================================================
558 575
 //============================== Movement Settings ============================
559 576
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/BQ/WITBOX/Configuration.h 查看文件

@@ -541,6 +541,23 @@
541 541
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
542 542
 //#define ENDSTOP_INTERRUPTS_FEATURE
543 543
 
544
+/**
545
+ * Endstop Noise Filter
546
+ *
547
+ * Enable this option if endstops falsely trigger due to noise.
548
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
549
+ * will end up at a slightly different position on each G28. This will also
550
+ * reduce accuracy of some bed probes.
551
+ * For mechanical switches, the better approach to reduce noise is to install
552
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
553
+ * essentially noise-proof without sacrificing accuracy.
554
+ * This option also increases MCU load when endstops or the probe are enabled.
555
+ * So this is not recommended. USE AT YOUR OWN RISK.
556
+ * (This feature is not required for common micro-switches mounted on PCBs
557
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
558
+ */
559
+//#define ENDSTOP_NOISE_FILTER
560
+
544 561
 //=============================================================================
545 562
 //============================== Movement Settings ============================
546 563
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Cartesio/Configuration.h 查看文件

@@ -552,6 +552,23 @@
552 552
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
553 553
 //#define ENDSTOP_INTERRUPTS_FEATURE
554 554
 
555
+/**
556
+ * Endstop Noise Filter
557
+ *
558
+ * Enable this option if endstops falsely trigger due to noise.
559
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
560
+ * will end up at a slightly different position on each G28. This will also
561
+ * reduce accuracy of some bed probes.
562
+ * For mechanical switches, the better approach to reduce noise is to install
563
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
564
+ * essentially noise-proof without sacrificing accuracy.
565
+ * This option also increases MCU load when endstops or the probe are enabled.
566
+ * So this is not recommended. USE AT YOUR OWN RISK.
567
+ * (This feature is not required for common micro-switches mounted on PCBs
568
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
569
+ */
570
+//#define ENDSTOP_NOISE_FILTER
571
+
555 572
 //=============================================================================
556 573
 //============================== Movement Settings ============================
557 574
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Creality/CR-10/Configuration.h 查看文件

@@ -563,6 +563,23 @@
563 563
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
564 564
 //#define ENDSTOP_INTERRUPTS_FEATURE
565 565
 
566
+/**
567
+ * Endstop Noise Filter
568
+ *
569
+ * Enable this option if endstops falsely trigger due to noise.
570
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
571
+ * will end up at a slightly different position on each G28. This will also
572
+ * reduce accuracy of some bed probes.
573
+ * For mechanical switches, the better approach to reduce noise is to install
574
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
575
+ * essentially noise-proof without sacrificing accuracy.
576
+ * This option also increases MCU load when endstops or the probe are enabled.
577
+ * So this is not recommended. USE AT YOUR OWN RISK.
578
+ * (This feature is not required for common micro-switches mounted on PCBs
579
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
580
+ */
581
+//#define ENDSTOP_NOISE_FILTER
582
+
566 583
 //=============================================================================
567 584
 //============================== Movement Settings ============================
568 585
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Creality/CR-10S/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Creality/CR-10mini/Configuration.h 查看文件

@@ -572,6 +572,23 @@
572 572
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
573 573
 //#define ENDSTOP_INTERRUPTS_FEATURE
574 574
 
575
+/**
576
+ * Endstop Noise Filter
577
+ *
578
+ * Enable this option if endstops falsely trigger due to noise.
579
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
580
+ * will end up at a slightly different position on each G28. This will also
581
+ * reduce accuracy of some bed probes.
582
+ * For mechanical switches, the better approach to reduce noise is to install
583
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
584
+ * essentially noise-proof without sacrificing accuracy.
585
+ * This option also increases MCU load when endstops or the probe are enabled.
586
+ * So this is not recommended. USE AT YOUR OWN RISK.
587
+ * (This feature is not required for common micro-switches mounted on PCBs
588
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
589
+ */
590
+//#define ENDSTOP_NOISE_FILTER
591
+
575 592
 //=============================================================================
576 593
 //============================== Movement Settings ============================
577 594
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Creality/CR-8/Configuration.h 查看文件

@@ -563,6 +563,23 @@
563 563
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
564 564
 //#define ENDSTOP_INTERRUPTS_FEATURE
565 565
 
566
+/**
567
+ * Endstop Noise Filter
568
+ *
569
+ * Enable this option if endstops falsely trigger due to noise.
570
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
571
+ * will end up at a slightly different position on each G28. This will also
572
+ * reduce accuracy of some bed probes.
573
+ * For mechanical switches, the better approach to reduce noise is to install
574
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
575
+ * essentially noise-proof without sacrificing accuracy.
576
+ * This option also increases MCU load when endstops or the probe are enabled.
577
+ * So this is not recommended. USE AT YOUR OWN RISK.
578
+ * (This feature is not required for common micro-switches mounted on PCBs
579
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
580
+ */
581
+//#define ENDSTOP_NOISE_FILTER
582
+
566 583
 //=============================================================================
567 584
 //============================== Movement Settings ============================
568 585
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Creality/Ender-2/Configuration.h 查看文件

@@ -557,6 +557,23 @@
557 557
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
558 558
 //#define ENDSTOP_INTERRUPTS_FEATURE
559 559
 
560
+/**
561
+ * Endstop Noise Filter
562
+ *
563
+ * Enable this option if endstops falsely trigger due to noise.
564
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
565
+ * will end up at a slightly different position on each G28. This will also
566
+ * reduce accuracy of some bed probes.
567
+ * For mechanical switches, the better approach to reduce noise is to install
568
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
569
+ * essentially noise-proof without sacrificing accuracy.
570
+ * This option also increases MCU load when endstops or the probe are enabled.
571
+ * So this is not recommended. USE AT YOUR OWN RISK.
572
+ * (This feature is not required for common micro-switches mounted on PCBs
573
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
574
+ */
575
+//#define ENDSTOP_NOISE_FILTER
576
+
560 577
 //=============================================================================
561 578
 //============================== Movement Settings ============================
562 579
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Creality/Ender-3/Configuration.h 查看文件

@@ -557,6 +557,23 @@
557 557
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
558 558
 //#define ENDSTOP_INTERRUPTS_FEATURE
559 559
 
560
+/**
561
+ * Endstop Noise Filter
562
+ *
563
+ * Enable this option if endstops falsely trigger due to noise.
564
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
565
+ * will end up at a slightly different position on each G28. This will also
566
+ * reduce accuracy of some bed probes.
567
+ * For mechanical switches, the better approach to reduce noise is to install
568
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
569
+ * essentially noise-proof without sacrificing accuracy.
570
+ * This option also increases MCU load when endstops or the probe are enabled.
571
+ * So this is not recommended. USE AT YOUR OWN RISK.
572
+ * (This feature is not required for common micro-switches mounted on PCBs
573
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
574
+ */
575
+//#define ENDSTOP_NOISE_FILTER
576
+
560 577
 //=============================================================================
561 578
 //============================== Movement Settings ============================
562 579
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Creality/Ender-4/Configuration.h 查看文件

@@ -563,6 +563,23 @@
563 563
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
564 564
 //#define ENDSTOP_INTERRUPTS_FEATURE
565 565
 
566
+/**
567
+ * Endstop Noise Filter
568
+ *
569
+ * Enable this option if endstops falsely trigger due to noise.
570
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
571
+ * will end up at a slightly different position on each G28. This will also
572
+ * reduce accuracy of some bed probes.
573
+ * For mechanical switches, the better approach to reduce noise is to install
574
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
575
+ * essentially noise-proof without sacrificing accuracy.
576
+ * This option also increases MCU load when endstops or the probe are enabled.
577
+ * So this is not recommended. USE AT YOUR OWN RISK.
578
+ * (This feature is not required for common micro-switches mounted on PCBs
579
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
580
+ */
581
+//#define ENDSTOP_NOISE_FILTER
582
+
566 583
 //=============================================================================
567 584
 //============================== Movement Settings ============================
568 585
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Felix/Configuration.h 查看文件

@@ -534,6 +534,23 @@
534 534
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
535 535
 //#define ENDSTOP_INTERRUPTS_FEATURE
536 536
 
537
+/**
538
+ * Endstop Noise Filter
539
+ *
540
+ * Enable this option if endstops falsely trigger due to noise.
541
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
542
+ * will end up at a slightly different position on each G28. This will also
543
+ * reduce accuracy of some bed probes.
544
+ * For mechanical switches, the better approach to reduce noise is to install
545
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
546
+ * essentially noise-proof without sacrificing accuracy.
547
+ * This option also increases MCU load when endstops or the probe are enabled.
548
+ * So this is not recommended. USE AT YOUR OWN RISK.
549
+ * (This feature is not required for common micro-switches mounted on PCBs
550
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
551
+ */
552
+//#define ENDSTOP_NOISE_FILTER
553
+
537 554
 //=============================================================================
538 555
 //============================== Movement Settings ============================
539 556
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Felix/DUAL/Configuration.h 查看文件

@@ -534,6 +534,23 @@
534 534
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
535 535
 //#define ENDSTOP_INTERRUPTS_FEATURE
536 536
 
537
+/**
538
+ * Endstop Noise Filter
539
+ *
540
+ * Enable this option if endstops falsely trigger due to noise.
541
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
542
+ * will end up at a slightly different position on each G28. This will also
543
+ * reduce accuracy of some bed probes.
544
+ * For mechanical switches, the better approach to reduce noise is to install
545
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
546
+ * essentially noise-proof without sacrificing accuracy.
547
+ * This option also increases MCU load when endstops or the probe are enabled.
548
+ * So this is not recommended. USE AT YOUR OWN RISK.
549
+ * (This feature is not required for common micro-switches mounted on PCBs
550
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
551
+ */
552
+//#define ENDSTOP_NOISE_FILTER
553
+
537 554
 //=============================================================================
538 555
 //============================== Movement Settings ============================
539 556
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h 查看文件

@@ -558,6 +558,23 @@
558 558
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
559 559
 //#define ENDSTOP_INTERRUPTS_FEATURE
560 560
 
561
+/**
562
+ * Endstop Noise Filter
563
+ *
564
+ * Enable this option if endstops falsely trigger due to noise.
565
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
566
+ * will end up at a slightly different position on each G28. This will also
567
+ * reduce accuracy of some bed probes.
568
+ * For mechanical switches, the better approach to reduce noise is to install
569
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
570
+ * essentially noise-proof without sacrificing accuracy.
571
+ * This option also increases MCU load when endstops or the probe are enabled.
572
+ * So this is not recommended. USE AT YOUR OWN RISK.
573
+ * (This feature is not required for common micro-switches mounted on PCBs
574
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
575
+ */
576
+//#define ENDSTOP_NOISE_FILTER
577
+
561 578
 //=============================================================================
562 579
 //============================== Movement Settings ============================
563 580
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Geeetech/GT2560/Configuration.h 查看文件

@@ -568,6 +568,23 @@
568 568
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
569 569
 //#define ENDSTOP_INTERRUPTS_FEATURE
570 570
 
571
+/**
572
+ * Endstop Noise Filter
573
+ *
574
+ * Enable this option if endstops falsely trigger due to noise.
575
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
576
+ * will end up at a slightly different position on each G28. This will also
577
+ * reduce accuracy of some bed probes.
578
+ * For mechanical switches, the better approach to reduce noise is to install
579
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
580
+ * essentially noise-proof without sacrificing accuracy.
581
+ * This option also increases MCU load when endstops or the probe are enabled.
582
+ * So this is not recommended. USE AT YOUR OWN RISK.
583
+ * (This feature is not required for common micro-switches mounted on PCBs
584
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
585
+ */
586
+//#define ENDSTOP_NOISE_FILTER
587
+
571 588
 //=============================================================================
572 589
 //============================== Movement Settings ============================
573 590
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h 查看文件

@@ -568,6 +568,23 @@
568 568
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
569 569
 //#define ENDSTOP_INTERRUPTS_FEATURE
570 570
 
571
+/**
572
+ * Endstop Noise Filter
573
+ *
574
+ * Enable this option if endstops falsely trigger due to noise.
575
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
576
+ * will end up at a slightly different position on each G28. This will also
577
+ * reduce accuracy of some bed probes.
578
+ * For mechanical switches, the better approach to reduce noise is to install
579
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
580
+ * essentially noise-proof without sacrificing accuracy.
581
+ * This option also increases MCU load when endstops or the probe are enabled.
582
+ * So this is not recommended. USE AT YOUR OWN RISK.
583
+ * (This feature is not required for common micro-switches mounted on PCBs
584
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
585
+ */
586
+//#define ENDSTOP_NOISE_FILTER
587
+
571 588
 //=============================================================================
572 589
 //============================== Movement Settings ============================
573 590
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h 查看文件

@@ -568,6 +568,23 @@
568 568
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
569 569
 //#define ENDSTOP_INTERRUPTS_FEATURE
570 570
 
571
+/**
572
+ * Endstop Noise Filter
573
+ *
574
+ * Enable this option if endstops falsely trigger due to noise.
575
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
576
+ * will end up at a slightly different position on each G28. This will also
577
+ * reduce accuracy of some bed probes.
578
+ * For mechanical switches, the better approach to reduce noise is to install
579
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
580
+ * essentially noise-proof without sacrificing accuracy.
581
+ * This option also increases MCU load when endstops or the probe are enabled.
582
+ * So this is not recommended. USE AT YOUR OWN RISK.
583
+ * (This feature is not required for common micro-switches mounted on PCBs
584
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
585
+ */
586
+//#define ENDSTOP_NOISE_FILTER
587
+
571 588
 //=============================================================================
572 589
 //============================== Movement Settings ============================
573 590
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Infitary/i3-M508/Configuration.h 查看文件

@@ -557,6 +557,23 @@
557 557
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
558 558
 //#define ENDSTOP_INTERRUPTS_FEATURE
559 559
 
560
+/**
561
+ * Endstop Noise Filter
562
+ *
563
+ * Enable this option if endstops falsely trigger due to noise.
564
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
565
+ * will end up at a slightly different position on each G28. This will also
566
+ * reduce accuracy of some bed probes.
567
+ * For mechanical switches, the better approach to reduce noise is to install
568
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
569
+ * essentially noise-proof without sacrificing accuracy.
570
+ * This option also increases MCU load when endstops or the probe are enabled.
571
+ * So this is not recommended. USE AT YOUR OWN RISK.
572
+ * (This feature is not required for common micro-switches mounted on PCBs
573
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
574
+ */
575
+//#define ENDSTOP_NOISE_FILTER
576
+
560 577
 //=============================================================================
561 578
 //============================== Movement Settings ============================
562 579
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/JGAurora/A5/Configuration.h 查看文件

@@ -565,6 +565,23 @@
565 565
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
566 566
 //#define ENDSTOP_INTERRUPTS_FEATURE
567 567
 
568
+/**
569
+ * Endstop Noise Filter
570
+ *
571
+ * Enable this option if endstops falsely trigger due to noise.
572
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
573
+ * will end up at a slightly different position on each G28. This will also
574
+ * reduce accuracy of some bed probes.
575
+ * For mechanical switches, the better approach to reduce noise is to install
576
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
577
+ * essentially noise-proof without sacrificing accuracy.
578
+ * This option also increases MCU load when endstops or the probe are enabled.
579
+ * So this is not recommended. USE AT YOUR OWN RISK.
580
+ * (This feature is not required for common micro-switches mounted on PCBs
581
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
582
+ */
583
+//#define ENDSTOP_NOISE_FILTER
584
+
568 585
 //=============================================================================
569 586
 //============================== Movement Settings ============================
570 587
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/MakerParts/Configuration.h 查看文件

@@ -573,6 +573,23 @@
573 573
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
574 574
 //#define ENDSTOP_INTERRUPTS_FEATURE
575 575
 
576
+/**
577
+ * Endstop Noise Filter
578
+ *
579
+ * Enable this option if endstops falsely trigger due to noise.
580
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
581
+ * will end up at a slightly different position on each G28. This will also
582
+ * reduce accuracy of some bed probes.
583
+ * For mechanical switches, the better approach to reduce noise is to install
584
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
585
+ * essentially noise-proof without sacrificing accuracy.
586
+ * This option also increases MCU load when endstops or the probe are enabled.
587
+ * So this is not recommended. USE AT YOUR OWN RISK.
588
+ * (This feature is not required for common micro-switches mounted on PCBs
589
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
590
+ */
591
+//#define ENDSTOP_NOISE_FILTER
592
+
576 593
 //=============================================================================
577 594
 //============================== Movement Settings ============================
578 595
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Malyan/M150/Configuration.h 查看文件

@@ -562,6 +562,23 @@
562 562
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
563 563
 //#define ENDSTOP_INTERRUPTS_FEATURE
564 564
 
565
+/**
566
+ * Endstop Noise Filter
567
+ *
568
+ * Enable this option if endstops falsely trigger due to noise.
569
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
570
+ * will end up at a slightly different position on each G28. This will also
571
+ * reduce accuracy of some bed probes.
572
+ * For mechanical switches, the better approach to reduce noise is to install
573
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
574
+ * essentially noise-proof without sacrificing accuracy.
575
+ * This option also increases MCU load when endstops or the probe are enabled.
576
+ * So this is not recommended. USE AT YOUR OWN RISK.
577
+ * (This feature is not required for common micro-switches mounted on PCBs
578
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
579
+ */
580
+//#define ENDSTOP_NOISE_FILTER
581
+
565 582
 //=============================================================================
566 583
 //============================== Movement Settings ============================
567 584
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Malyan/M200/Configuration.h 查看文件

@@ -552,6 +552,23 @@
552 552
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
553 553
 //#define ENDSTOP_INTERRUPTS_FEATURE
554 554
 
555
+/**
556
+ * Endstop Noise Filter
557
+ *
558
+ * Enable this option if endstops falsely trigger due to noise.
559
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
560
+ * will end up at a slightly different position on each G28. This will also
561
+ * reduce accuracy of some bed probes.
562
+ * For mechanical switches, the better approach to reduce noise is to install
563
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
564
+ * essentially noise-proof without sacrificing accuracy.
565
+ * This option also increases MCU load when endstops or the probe are enabled.
566
+ * So this is not recommended. USE AT YOUR OWN RISK.
567
+ * (This feature is not required for common micro-switches mounted on PCBs
568
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
569
+ */
570
+//#define ENDSTOP_NOISE_FILTER
571
+
555 572
 //=============================================================================
556 573
 //============================== Movement Settings ============================
557 574
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Micromake/C1/basic/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Mks/Sbase/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/RigidBot/Configuration.h 查看文件

@@ -549,6 +549,23 @@
549 549
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
550 550
 //#define ENDSTOP_INTERRUPTS_FEATURE
551 551
 
552
+/**
553
+ * Endstop Noise Filter
554
+ *
555
+ * Enable this option if endstops falsely trigger due to noise.
556
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
557
+ * will end up at a slightly different position on each G28. This will also
558
+ * reduce accuracy of some bed probes.
559
+ * For mechanical switches, the better approach to reduce noise is to install
560
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
561
+ * essentially noise-proof without sacrificing accuracy.
562
+ * This option also increases MCU load when endstops or the probe are enabled.
563
+ * So this is not recommended. USE AT YOUR OWN RISK.
564
+ * (This feature is not required for common micro-switches mounted on PCBs
565
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
566
+ */
567
+//#define ENDSTOP_NOISE_FILTER
568
+
552 569
 //=============================================================================
553 570
 //============================== Movement Settings ============================
554 571
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/SCARA/Configuration.h 查看文件

@@ -566,6 +566,23 @@
566 566
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
567 567
 //#define ENDSTOP_INTERRUPTS_FEATURE
568 568
 
569
+/**
570
+ * Endstop Noise Filter
571
+ *
572
+ * Enable this option if endstops falsely trigger due to noise.
573
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
574
+ * will end up at a slightly different position on each G28. This will also
575
+ * reduce accuracy of some bed probes.
576
+ * For mechanical switches, the better approach to reduce noise is to install
577
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
578
+ * essentially noise-proof without sacrificing accuracy.
579
+ * This option also increases MCU load when endstops or the probe are enabled.
580
+ * So this is not recommended. USE AT YOUR OWN RISK.
581
+ * (This feature is not required for common micro-switches mounted on PCBs
582
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
583
+ */
584
+//#define ENDSTOP_NOISE_FILTER
585
+
569 586
 //=============================================================================
570 587
 //============================== Movement Settings ============================
571 588
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/STM32F10/Configuration.h 查看文件

@@ -555,6 +555,23 @@
555 555
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
556 556
 //#define ENDSTOP_INTERRUPTS_FEATURE
557 557
 
558
+/**
559
+ * Endstop Noise Filter
560
+ *
561
+ * Enable this option if endstops falsely trigger due to noise.
562
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
563
+ * will end up at a slightly different position on each G28. This will also
564
+ * reduce accuracy of some bed probes.
565
+ * For mechanical switches, the better approach to reduce noise is to install
566
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
567
+ * essentially noise-proof without sacrificing accuracy.
568
+ * This option also increases MCU load when endstops or the probe are enabled.
569
+ * So this is not recommended. USE AT YOUR OWN RISK.
570
+ * (This feature is not required for common micro-switches mounted on PCBs
571
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
572
+ */
573
+//#define ENDSTOP_NOISE_FILTER
574
+
558 575
 //=============================================================================
559 576
 //============================== Movement Settings ============================
560 577
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/STM32F4/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Sanguinololu/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/TheBorg/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/TinyBoy2/Configuration.h 查看文件

@@ -604,6 +604,23 @@
604 604
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
605 605
 #define ENDSTOP_INTERRUPTS_FEATURE
606 606
 
607
+/**
608
+ * Endstop Noise Filter
609
+ *
610
+ * Enable this option if endstops falsely trigger due to noise.
611
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
612
+ * will end up at a slightly different position on each G28. This will also
613
+ * reduce accuracy of some bed probes.
614
+ * For mechanical switches, the better approach to reduce noise is to install
615
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
616
+ * essentially noise-proof without sacrificing accuracy.
617
+ * This option also increases MCU load when endstops or the probe are enabled.
618
+ * So this is not recommended. USE AT YOUR OWN RISK.
619
+ * (This feature is not required for common micro-switches mounted on PCBs
620
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
621
+ */
622
+//#define ENDSTOP_NOISE_FILTER
623
+
607 624
 //=============================================================================
608 625
 //============================== Movement Settings ============================
609 626
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Tronxy/X1/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Tronxy/X5S/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Tronxy/XY100/Configuration.h 查看文件

@@ -564,6 +564,23 @@
564 564
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
565 565
 //#define ENDSTOP_INTERRUPTS_FEATURE
566 566
 
567
+/**
568
+ * Endstop Noise Filter
569
+ *
570
+ * Enable this option if endstops falsely trigger due to noise.
571
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
572
+ * will end up at a slightly different position on each G28. This will also
573
+ * reduce accuracy of some bed probes.
574
+ * For mechanical switches, the better approach to reduce noise is to install
575
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
576
+ * essentially noise-proof without sacrificing accuracy.
577
+ * This option also increases MCU load when endstops or the probe are enabled.
578
+ * So this is not recommended. USE AT YOUR OWN RISK.
579
+ * (This feature is not required for common micro-switches mounted on PCBs
580
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
581
+ */
582
+//#define ENDSTOP_NOISE_FILTER
583
+
567 584
 //=============================================================================
568 585
 //============================== Movement Settings ============================
569 586
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Velleman/K8200/Configuration.h 查看文件

@@ -583,6 +583,23 @@
583 583
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
584 584
 //#define ENDSTOP_INTERRUPTS_FEATURE
585 585
 
586
+/**
587
+ * Endstop Noise Filter
588
+ *
589
+ * Enable this option if endstops falsely trigger due to noise.
590
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
591
+ * will end up at a slightly different position on each G28. This will also
592
+ * reduce accuracy of some bed probes.
593
+ * For mechanical switches, the better approach to reduce noise is to install
594
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
595
+ * essentially noise-proof without sacrificing accuracy.
596
+ * This option also increases MCU load when endstops or the probe are enabled.
597
+ * So this is not recommended. USE AT YOUR OWN RISK.
598
+ * (This feature is not required for common micro-switches mounted on PCBs
599
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
600
+ */
601
+//#define ENDSTOP_NOISE_FILTER
602
+
586 603
 //=============================================================================
587 604
 //============================== Movement Settings ============================
588 605
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Velleman/K8400/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h 查看文件

@@ -563,6 +563,23 @@
563 563
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
564 564
 //#define ENDSTOP_INTERRUPTS_FEATURE
565 565
 
566
+/**
567
+ * Endstop Noise Filter
568
+ *
569
+ * Enable this option if endstops falsely trigger due to noise.
570
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
571
+ * will end up at a slightly different position on each G28. This will also
572
+ * reduce accuracy of some bed probes.
573
+ * For mechanical switches, the better approach to reduce noise is to install
574
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
575
+ * essentially noise-proof without sacrificing accuracy.
576
+ * This option also increases MCU load when endstops or the probe are enabled.
577
+ * So this is not recommended. USE AT YOUR OWN RISK.
578
+ * (This feature is not required for common micro-switches mounted on PCBs
579
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
580
+ */
581
+//#define ENDSTOP_NOISE_FILTER
582
+
566 583
 //=============================================================================
567 584
 //============================== Movement Settings ============================
568 585
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/adafruit/ST7565/Configuration.h 查看文件

@@ -553,6 +553,23 @@
553 553
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
554 554
 //#define ENDSTOP_INTERRUPTS_FEATURE
555 555
 
556
+/**
557
+ * Endstop Noise Filter
558
+ *
559
+ * Enable this option if endstops falsely trigger due to noise.
560
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
561
+ * will end up at a slightly different position on each G28. This will also
562
+ * reduce accuracy of some bed probes.
563
+ * For mechanical switches, the better approach to reduce noise is to install
564
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
565
+ * essentially noise-proof without sacrificing accuracy.
566
+ * This option also increases MCU load when endstops or the probe are enabled.
567
+ * So this is not recommended. USE AT YOUR OWN RISK.
568
+ * (This feature is not required for common micro-switches mounted on PCBs
569
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
570
+ */
571
+//#define ENDSTOP_NOISE_FILTER
572
+
556 573
 //=============================================================================
557 574
 //============================== Movement Settings ============================
558 575
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h 查看文件

@@ -626,6 +626,23 @@
626 626
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
627 627
 //#define ENDSTOP_INTERRUPTS_FEATURE
628 628
 
629
+/**
630
+ * Endstop Noise Filter
631
+ *
632
+ * Enable this option if endstops falsely trigger due to noise.
633
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
634
+ * will end up at a slightly different position on each G28. This will also
635
+ * reduce accuracy of some bed probes.
636
+ * For mechanical switches, the better approach to reduce noise is to install
637
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
638
+ * essentially noise-proof without sacrificing accuracy.
639
+ * This option also increases MCU load when endstops or the probe are enabled.
640
+ * So this is not recommended. USE AT YOUR OWN RISK.
641
+ * (This feature is not required for common micro-switches mounted on PCBs
642
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
643
+ */
644
+//#define ENDSTOP_NOISE_FILTER
645
+
629 646
 //=============================================================================
630 647
 //============================== Movement Settings ============================
631 648
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h 查看文件

@@ -626,6 +626,23 @@
626 626
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
627 627
 //#define ENDSTOP_INTERRUPTS_FEATURE
628 628
 
629
+/**
630
+ * Endstop Noise Filter
631
+ *
632
+ * Enable this option if endstops falsely trigger due to noise.
633
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
634
+ * will end up at a slightly different position on each G28. This will also
635
+ * reduce accuracy of some bed probes.
636
+ * For mechanical switches, the better approach to reduce noise is to install
637
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
638
+ * essentially noise-proof without sacrificing accuracy.
639
+ * This option also increases MCU load when endstops or the probe are enabled.
640
+ * So this is not recommended. USE AT YOUR OWN RISK.
641
+ * (This feature is not required for common micro-switches mounted on PCBs
642
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
643
+ */
644
+//#define ENDSTOP_NOISE_FILTER
645
+
629 646
 //=============================================================================
630 647
 //============================== Movement Settings ============================
631 648
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h 查看文件

@@ -626,6 +626,23 @@
626 626
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
627 627
 //#define ENDSTOP_INTERRUPTS_FEATURE
628 628
 
629
+/**
630
+ * Endstop Noise Filter
631
+ *
632
+ * Enable this option if endstops falsely trigger due to noise.
633
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
634
+ * will end up at a slightly different position on each G28. This will also
635
+ * reduce accuracy of some bed probes.
636
+ * For mechanical switches, the better approach to reduce noise is to install
637
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
638
+ * essentially noise-proof without sacrificing accuracy.
639
+ * This option also increases MCU load when endstops or the probe are enabled.
640
+ * So this is not recommended. USE AT YOUR OWN RISK.
641
+ * (This feature is not required for common micro-switches mounted on PCBs
642
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
643
+ */
644
+//#define ENDSTOP_NOISE_FILTER
645
+
629 646
 //=============================================================================
630 647
 //============================== Movement Settings ============================
631 648
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h 查看文件

@@ -631,6 +631,23 @@
631 631
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
632 632
 //#define ENDSTOP_INTERRUPTS_FEATURE
633 633
 
634
+/**
635
+ * Endstop Noise Filter
636
+ *
637
+ * Enable this option if endstops falsely trigger due to noise.
638
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
639
+ * will end up at a slightly different position on each G28. This will also
640
+ * reduce accuracy of some bed probes.
641
+ * For mechanical switches, the better approach to reduce noise is to install
642
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
643
+ * essentially noise-proof without sacrificing accuracy.
644
+ * This option also increases MCU load when endstops or the probe are enabled.
645
+ * So this is not recommended. USE AT YOUR OWN RISK.
646
+ * (This feature is not required for common micro-switches mounted on PCBs
647
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
648
+ */
649
+//#define ENDSTOP_NOISE_FILTER
650
+
634 651
 //=============================================================================
635 652
 //============================== Movement Settings ============================
636 653
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/delta/generic/Configuration.h 查看文件

@@ -616,6 +616,23 @@
616 616
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
617 617
 //#define ENDSTOP_INTERRUPTS_FEATURE
618 618
 
619
+/**
620
+ * Endstop Noise Filter
621
+ *
622
+ * Enable this option if endstops falsely trigger due to noise.
623
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
624
+ * will end up at a slightly different position on each G28. This will also
625
+ * reduce accuracy of some bed probes.
626
+ * For mechanical switches, the better approach to reduce noise is to install
627
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
628
+ * essentially noise-proof without sacrificing accuracy.
629
+ * This option also increases MCU load when endstops or the probe are enabled.
630
+ * So this is not recommended. USE AT YOUR OWN RISK.
631
+ * (This feature is not required for common micro-switches mounted on PCBs
632
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
633
+ */
634
+//#define ENDSTOP_NOISE_FILTER
635
+
619 636
 //=============================================================================
620 637
 //============================== Movement Settings ============================
621 638
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/delta/kossel_mini/Configuration.h 查看文件

@@ -616,6 +616,23 @@
616 616
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
617 617
 //#define ENDSTOP_INTERRUPTS_FEATURE
618 618
 
619
+/**
620
+ * Endstop Noise Filter
621
+ *
622
+ * Enable this option if endstops falsely trigger due to noise.
623
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
624
+ * will end up at a slightly different position on each G28. This will also
625
+ * reduce accuracy of some bed probes.
626
+ * For mechanical switches, the better approach to reduce noise is to install
627
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
628
+ * essentially noise-proof without sacrificing accuracy.
629
+ * This option also increases MCU load when endstops or the probe are enabled.
630
+ * So this is not recommended. USE AT YOUR OWN RISK.
631
+ * (This feature is not required for common micro-switches mounted on PCBs
632
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
633
+ */
634
+//#define ENDSTOP_NOISE_FILTER
635
+
619 636
 //=============================================================================
620 637
 //============================== Movement Settings ============================
621 638
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/delta/kossel_pro/Configuration.h 查看文件

@@ -602,6 +602,23 @@
602 602
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
603 603
 //#define ENDSTOP_INTERRUPTS_FEATURE
604 604
 
605
+/**
606
+ * Endstop Noise Filter
607
+ *
608
+ * Enable this option if endstops falsely trigger due to noise.
609
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
610
+ * will end up at a slightly different position on each G28. This will also
611
+ * reduce accuracy of some bed probes.
612
+ * For mechanical switches, the better approach to reduce noise is to install
613
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
614
+ * essentially noise-proof without sacrificing accuracy.
615
+ * This option also increases MCU load when endstops or the probe are enabled.
616
+ * So this is not recommended. USE AT YOUR OWN RISK.
617
+ * (This feature is not required for common micro-switches mounted on PCBs
618
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
619
+ */
620
+//#define ENDSTOP_NOISE_FILTER
621
+
605 622
 //=============================================================================
606 623
 //============================== Movement Settings ============================
607 624
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/delta/kossel_xl/Configuration.h 查看文件

@@ -620,6 +620,23 @@
620 620
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
621 621
 //#define ENDSTOP_INTERRUPTS_FEATURE
622 622
 
623
+/**
624
+ * Endstop Noise Filter
625
+ *
626
+ * Enable this option if endstops falsely trigger due to noise.
627
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
628
+ * will end up at a slightly different position on each G28. This will also
629
+ * reduce accuracy of some bed probes.
630
+ * For mechanical switches, the better approach to reduce noise is to install
631
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
632
+ * essentially noise-proof without sacrificing accuracy.
633
+ * This option also increases MCU load when endstops or the probe are enabled.
634
+ * So this is not recommended. USE AT YOUR OWN RISK.
635
+ * (This feature is not required for common micro-switches mounted on PCBs
636
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
637
+ */
638
+//#define ENDSTOP_NOISE_FILTER
639
+
623 640
 //=============================================================================
624 641
 //============================== Movement Settings ============================
625 642
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h 查看文件

@@ -566,6 +566,23 @@
566 566
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
567 567
 #define ENDSTOP_INTERRUPTS_FEATURE
568 568
 
569
+/**
570
+ * Endstop Noise Filter
571
+ *
572
+ * Enable this option if endstops falsely trigger due to noise.
573
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
574
+ * will end up at a slightly different position on each G28. This will also
575
+ * reduce accuracy of some bed probes.
576
+ * For mechanical switches, the better approach to reduce noise is to install
577
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
578
+ * essentially noise-proof without sacrificing accuracy.
579
+ * This option also increases MCU load when endstops or the probe are enabled.
580
+ * So this is not recommended. USE AT YOUR OWN RISK.
581
+ * (This feature is not required for common micro-switches mounted on PCBs
582
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
583
+ */
584
+//#define ENDSTOP_NOISE_FILTER
585
+
569 586
 //=============================================================================
570 587
 //============================== Movement Settings ============================
571 588
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/makibox/Configuration.h 查看文件

@@ -556,6 +556,23 @@
556 556
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
557 557
 //#define ENDSTOP_INTERRUPTS_FEATURE
558 558
 
559
+/**
560
+ * Endstop Noise Filter
561
+ *
562
+ * Enable this option if endstops falsely trigger due to noise.
563
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
564
+ * will end up at a slightly different position on each G28. This will also
565
+ * reduce accuracy of some bed probes.
566
+ * For mechanical switches, the better approach to reduce noise is to install
567
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
568
+ * essentially noise-proof without sacrificing accuracy.
569
+ * This option also increases MCU load when endstops or the probe are enabled.
570
+ * So this is not recommended. USE AT YOUR OWN RISK.
571
+ * (This feature is not required for common micro-switches mounted on PCBs
572
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
573
+ */
574
+//#define ENDSTOP_NOISE_FILTER
575
+
559 576
 //=============================================================================
560 577
 //============================== Movement Settings ============================
561 578
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/stm32f103ret6/Configuration.h 查看文件

@@ -555,6 +555,23 @@
555 555
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
556 556
 //#define ENDSTOP_INTERRUPTS_FEATURE
557 557
 
558
+/**
559
+ * Endstop Noise Filter
560
+ *
561
+ * Enable this option if endstops falsely trigger due to noise.
562
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
563
+ * will end up at a slightly different position on each G28. This will also
564
+ * reduce accuracy of some bed probes.
565
+ * For mechanical switches, the better approach to reduce noise is to install
566
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
567
+ * essentially noise-proof without sacrificing accuracy.
568
+ * This option also increases MCU load when endstops or the probe are enabled.
569
+ * So this is not recommended. USE AT YOUR OWN RISK.
570
+ * (This feature is not required for common micro-switches mounted on PCBs
571
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
572
+ */
573
+//#define ENDSTOP_NOISE_FILTER
574
+
558 575
 //=============================================================================
559 576
 //============================== Movement Settings ============================
560 577
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/tvrrug/Round2/Configuration.h 查看文件

@@ -542,6 +542,23 @@
542 542
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
543 543
 //#define ENDSTOP_INTERRUPTS_FEATURE
544 544
 
545
+/**
546
+ * Endstop Noise Filter
547
+ *
548
+ * Enable this option if endstops falsely trigger due to noise.
549
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
550
+ * will end up at a slightly different position on each G28. This will also
551
+ * reduce accuracy of some bed probes.
552
+ * For mechanical switches, the better approach to reduce noise is to install
553
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
554
+ * essentially noise-proof without sacrificing accuracy.
555
+ * This option also increases MCU load when endstops or the probe are enabled.
556
+ * So this is not recommended. USE AT YOUR OWN RISK.
557
+ * (This feature is not required for common micro-switches mounted on PCBs
558
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
559
+ */
560
+//#define ENDSTOP_NOISE_FILTER
561
+
545 562
 //=============================================================================
546 563
 //============================== Movement Settings ============================
547 564
 //=============================================================================

+ 17
- 0
Marlin/src/config/examples/wt150/Configuration.h 查看文件

@@ -558,6 +558,23 @@
558 558
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
559 559
 //#define ENDSTOP_INTERRUPTS_FEATURE
560 560
 
561
+/**
562
+ * Endstop Noise Filter
563
+ *
564
+ * Enable this option if endstops falsely trigger due to noise.
565
+ * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing
566
+ * will end up at a slightly different position on each G28. This will also
567
+ * reduce accuracy of some bed probes.
568
+ * For mechanical switches, the better approach to reduce noise is to install
569
+ * a 100 nanofarads ceramic capacitor in parallel with the switch, making it
570
+ * essentially noise-proof without sacrificing accuracy.
571
+ * This option also increases MCU load when endstops or the probe are enabled.
572
+ * So this is not recommended. USE AT YOUR OWN RISK.
573
+ * (This feature is not required for common micro-switches mounted on PCBs
574
+ * based on the Makerbot design, since they already include the 100nF capacitor.)
575
+ */
576
+//#define ENDSTOP_NOISE_FILTER
577
+
561 578
 //=============================================================================
562 579
 //============================== Movement Settings ============================
563 580
 //=============================================================================

+ 1
- 1
Marlin/src/module/delta.cpp 查看文件

@@ -267,7 +267,7 @@ bool home_delta() {
267 267
 
268 268
   // If an endstop was not hit, then damage can occur if homing is continued.
269 269
   // This can occur if the delta height not set correctly.
270
-  if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) {
270
+  if (!(endstops.trigger_state() & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) {
271 271
     LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED);
272 272
     SERIAL_ERROR_START();
273 273
     SERIAL_ERRORLNPGM(MSG_ERR_HOMING_FAILED);

+ 197
- 111
Marlin/src/module/endstops.cpp 查看文件

@@ -36,9 +36,6 @@
36 36
   #include HAL_PATH(../HAL, endstop_interrupts.h)
37 37
 #endif
38 38
 
39
-// TEST_ENDSTOP: test the current status of an endstop
40
-#define TEST_ENDSTOP(ENDSTOP) (TEST(current_endstop_bits, ENDSTOP))
41
-
42 39
 #if HAS_BED_PROBE
43 40
   #define ENDSTOPS_ENABLED  (endstops.enabled || endstops.z_probe_enabled)
44 41
 #else
@@ -50,9 +47,14 @@ Endstops endstops;
50 47
 // public:
51 48
 
52 49
 bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load()
53
-volatile uint8_t Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
50
+volatile uint8_t Endstops::hit_state;
54 51
 
55
-Endstops::esbits_t Endstops::current_endstop_bits = 0;
52
+Endstops::esbits_t Endstops::live_state = 0;
53
+#if ENABLED(ENDSTOP_NOISE_FILTER)
54
+  Endstops::esbits_t Endstops::old_live_state,
55
+                     Endstops::validated_live_state;
56
+  uint8_t Endstops::endstop_poll_count;
57
+#endif
56 58
 
57 59
 #if HAS_BED_PROBE
58 60
   volatile bool Endstops::z_probe_enabled = false;
@@ -230,7 +232,7 @@ void Endstops::poll() {
230 232
     endstops.run_monitor();  // report changes in endstop status
231 233
   #endif
232 234
 
233
-  #if DISABLED(ENDSTOP_INTERRUPTS_FEATURE)
235
+  #if DISABLED(ENDSTOP_INTERRUPTS_FEATURE) || ENABLED(ENDSTOP_NOISE_FILTER)
234 236
     if (ENDSTOPS_ENABLED) endstops.update();
235 237
   #endif
236 238
 }
@@ -264,7 +266,7 @@ void Endstops::not_homing() {
264 266
 
265 267
 // Clear endstops (i.e., they were hit intentionally) to suppress the report
266 268
 void Endstops::hit_on_purpose() {
267
-  endstop_hit_bits = 0;
269
+  hit_state = 0;
268 270
 
269 271
   #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
270 272
     if (enabled) endstops.update(); // If enabling, update state now
@@ -293,7 +295,7 @@ void Endstops::hit_on_purpose() {
293 295
 #endif
294 296
 
295 297
 void Endstops::report_state() {
296
-  if (endstop_hit_bits) {
298
+  if (hit_state) {
297 299
     #if ENABLED(ULTRA_LCD)
298 300
       char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' ';
299 301
       #define _SET_STOP_CHAR(A,C) (chr## A = C)
@@ -306,7 +308,7 @@ void Endstops::report_state() {
306 308
       _SET_STOP_CHAR(A,C); }while(0)
307 309
 
308 310
     #define _ENDSTOP_HIT_TEST(A,C) \
309
-      if (TEST(endstop_hit_bits, A ##_MIN) || TEST(endstop_hit_bits, A ##_MAX)) \
311
+      if (TEST(hit_state, A ##_MIN) || TEST(hit_state, A ##_MAX)) \
310 312
         _ENDSTOP_HIT_ECHO(A,C)
311 313
 
312 314
     #define ENDSTOP_HIT_TEST_X() _ENDSTOP_HIT_TEST(X,'X')
@@ -321,7 +323,7 @@ void Endstops::report_state() {
321 323
 
322 324
     #if ENABLED(Z_MIN_PROBE_ENDSTOP)
323 325
       #define P_AXIS Z_AXIS
324
-      if (TEST(endstop_hit_bits, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P');
326
+      if (TEST(hit_state, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P');
325 327
     #endif
326 328
     SERIAL_EOL();
327 329
 
@@ -397,69 +399,23 @@ void Endstops::M119() {
397 399
 // The following routines are called from an ISR context. It could be the temperature ISR, the
398 400
 // endstop ISR or the Stepper ISR.
399 401
 
400
-#if ENABLED(X_DUAL_ENDSTOPS)
401
-  void Endstops::test_dual_x_endstops(const EndstopEnum es1, const EndstopEnum es2) {
402
-    const byte x_test = TEST_ENDSTOP(es1) | (TEST_ENDSTOP(es2) << 1); // bit 0 for X, bit 1 for X2
403
-    if (x_test && stepper.movement_non_null(X_AXIS)) {
404
-      SBI(endstop_hit_bits, X_MIN);
405
-      if (!stepper.performing_homing || (x_test == 0x3))  //if not performing home or if both endstops were trigged during homing...
406
-        stepper.quick_stop();
407
-    }
408
-  }
409
-#endif
410
-#if ENABLED(Y_DUAL_ENDSTOPS)
411
-  void Endstops::test_dual_y_endstops(const EndstopEnum es1, const EndstopEnum es2) {
412
-    const byte y_test = TEST_ENDSTOP(es1) | (TEST_ENDSTOP(es2) << 1); // bit 0 for Y, bit 1 for Y2
413
-    if (y_test && stepper.movement_non_null(Y_AXIS)) {
414
-      SBI(endstop_hit_bits, Y_MIN);
415
-      if (!stepper.performing_homing || (y_test == 0x3))  //if not performing home or if both endstops were trigged during homing...
416
-        stepper.quick_stop();
417
-    }
418
-  }
419
-#endif
420
-#if ENABLED(Z_DUAL_ENDSTOPS)
421
-  void Endstops::test_dual_z_endstops(const EndstopEnum es1, const EndstopEnum es2) {
422
-    const byte z_test = TEST_ENDSTOP(es1) | (TEST_ENDSTOP(es2) << 1); // bit 0 for Z, bit 1 for Z2
423
-    if (z_test && stepper.movement_non_null(Z_AXIS)) {
424
-      SBI(endstop_hit_bits, Z_MIN);
425
-      if (!stepper.performing_homing || (z_test == 0x3))  //if not performing home or if both endstops were trigged during homing...
426
-        stepper.quick_stop();
427
-    }
428
-  }
429
-#endif
402
+#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
403
+#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
404
+#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
430 405
 
431 406
 // Check endstops - Could be called from ISR!
432 407
 void Endstops::update() {
433 408
 
434
-  #define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
435
-  #define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
436
-  #define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
437
-  #define _ENDSTOP_HIT(AXIS, MINMAX) SBI(endstop_hit_bits, _ENDSTOP(AXIS, MINMAX))
438
-
439 409
   #define SET_BIT(N,B,TF) do{ if (TF) SBI(N,B); else CBI(N,B); }while(0)
440 410
   // UPDATE_ENDSTOP_BIT: set the current endstop bits for an endstop to its status
441
-  #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
411
+  #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(live_state, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
442 412
   // COPY_BIT: copy the value of SRC_BIT to DST_BIT in DST
443 413
   #define COPY_BIT(DST, SRC_BIT, DST_BIT) SET_BIT(DST, DST_BIT, TEST(DST, SRC_BIT))
444 414
 
445
-  #define UPDATE_ENDSTOP(AXIS,MINMAX) do { \
446
-      UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \
447
-      if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX))) { \
448
-        _ENDSTOP_HIT(AXIS, MINMAX); \
449
-        planner.endstop_triggered(_AXIS(AXIS)); \
450
-      } \
451
-    }while(0)
452
-
453 415
   #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ)
454 416
     // If G38 command is active check Z_MIN_PROBE for ALL movement
455 417
     if (G38_move) {
456 418
       UPDATE_ENDSTOP_BIT(Z, MIN_PROBE);
457
-      if (TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE))) {
458
-        if      (stepper.movement_non_null(_AXIS(X))) { _ENDSTOP_HIT(X, MIN); planner.endstop_triggered(_AXIS(X)); }
459
-        else if (stepper.movement_non_null(_AXIS(Y))) { _ENDSTOP_HIT(Y, MIN); planner.endstop_triggered(_AXIS(Y)); }
460
-        else if (stepper.movement_non_null(_AXIS(Z))) { _ENDSTOP_HIT(Z, MIN); planner.endstop_triggered(_AXIS(Z)); }
461
-        G38_endstop_hit = true;
462
-      }
463 419
     }
464 420
   #endif
465 421
 
@@ -553,11 +509,10 @@ void Endstops::update() {
553 509
           #if HAS_X2_MIN
554 510
             UPDATE_ENDSTOP_BIT(X2, MIN);
555 511
           #else
556
-            COPY_BIT(current_endstop_bits, X_MIN, X2_MIN);
512
+            COPY_BIT(live_state, X_MIN, X2_MIN);
557 513
           #endif
558
-          test_dual_x_endstops(X_MIN, X2_MIN);
559 514
         #else
560
-          if (X_MIN_TEST) UPDATE_ENDSTOP(X, MIN);
515
+          if (X_MIN_TEST) UPDATE_ENDSTOP_BIT(X, MIN);
561 516
         #endif
562 517
       #endif
563 518
     }
@@ -568,11 +523,10 @@ void Endstops::update() {
568 523
           #if HAS_X2_MAX
569 524
             UPDATE_ENDSTOP_BIT(X2, MAX);
570 525
           #else
571
-            COPY_BIT(current_endstop_bits, X_MAX, X2_MAX);
526
+            COPY_BIT(live_state, X_MAX, X2_MAX);
572 527
           #endif
573
-          test_dual_x_endstops(X_MAX, X2_MAX);
574 528
         #else
575
-          if (X_MAX_TEST) UPDATE_ENDSTOP(X, MAX);
529
+          if (X_MAX_TEST) UPDATE_ENDSTOP_BIT(X, MAX);
576 530
         #endif
577 531
       #endif
578 532
     }
@@ -586,11 +540,10 @@ void Endstops::update() {
586 540
           #if HAS_Y2_MIN
587 541
             UPDATE_ENDSTOP_BIT(Y2, MIN);
588 542
           #else
589
-            COPY_BIT(current_endstop_bits, Y_MIN, Y2_MIN);
543
+            COPY_BIT(live_state, Y_MIN, Y2_MIN);
590 544
           #endif
591
-          test_dual_y_endstops(Y_MIN, Y2_MIN);
592 545
         #else
593
-          UPDATE_ENDSTOP(Y, MIN);
546
+          UPDATE_ENDSTOP_BIT(Y, MIN);
594 547
         #endif
595 548
       #endif
596 549
     }
@@ -601,11 +554,10 @@ void Endstops::update() {
601 554
           #if HAS_Y2_MAX
602 555
             UPDATE_ENDSTOP_BIT(Y2, MAX);
603 556
           #else
604
-            COPY_BIT(current_endstop_bits, Y_MAX, Y2_MAX);
557
+            COPY_BIT(live_state, Y_MAX, Y2_MAX);
605 558
           #endif
606
-          test_dual_y_endstops(Y_MAX, Y2_MAX);
607 559
         #else
608
-          UPDATE_ENDSTOP(Y, MAX);
560
+          UPDATE_ENDSTOP_BIT(Y, MAX);
609 561
         #endif
610 562
       #endif
611 563
     }
@@ -619,14 +571,13 @@ void Endstops::update() {
619 571
           #if HAS_Z2_MIN
620 572
             UPDATE_ENDSTOP_BIT(Z2, MIN);
621 573
           #else
622
-            COPY_BIT(current_endstop_bits, Z_MIN, Z2_MIN);
574
+            COPY_BIT(live_state, Z_MIN, Z2_MIN);
623 575
           #endif
624
-          test_dual_z_endstops(Z_MIN, Z2_MIN);
625 576
         #else
626 577
           #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
627
-            if (z_probe_enabled) UPDATE_ENDSTOP(Z, MIN);
578
+            if (z_probe_enabled) UPDATE_ENDSTOP_BIT(Z, MIN);
628 579
           #else
629
-            UPDATE_ENDSTOP(Z, MIN);
580
+            UPDATE_ENDSTOP_BIT(Z, MIN);
630 581
           #endif
631 582
         #endif
632 583
       #endif
@@ -634,8 +585,7 @@ void Endstops::update() {
634 585
       // When closing the gap check the enabled probe
635 586
       #if ENABLED(Z_MIN_PROBE_ENDSTOP)
636 587
         if (z_probe_enabled) {
637
-          UPDATE_ENDSTOP(Z, MIN_PROBE);
638
-          if (TEST_ENDSTOP(Z_MIN_PROBE)) SBI(endstop_hit_bits, Z_MIN_PROBE);
588
+          UPDATE_ENDSTOP_BIT(Z, MIN_PROBE);
639 589
         }
640 590
       #endif
641 591
     }
@@ -647,13 +597,149 @@ void Endstops::update() {
647 597
           #if HAS_Z2_MAX
648 598
             UPDATE_ENDSTOP_BIT(Z2, MAX);
649 599
           #else
650
-            COPY_BIT(current_endstop_bits, Z_MAX, Z2_MAX);
600
+            COPY_BIT(live_state, Z_MAX, Z2_MAX);
651 601
           #endif
652
-          test_dual_z_endstops(Z_MAX, Z2_MAX);
653 602
         // If this pin is not hijacked for the bed probe
654 603
         // then it belongs to the Z endstop
655 604
         #elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN
656
-          UPDATE_ENDSTOP(Z, MAX);
605
+          UPDATE_ENDSTOP_BIT(Z, MAX);
606
+        #endif
607
+      #endif
608
+    }
609
+  }
610
+
611
+  // All endstops were updated.
612
+  #if ENABLED(ENDSTOP_NOISE_FILTER)
613
+    if (old_live_state != live_state) { // We detected a change. Reinit the timeout
614
+      /**
615
+       * Filtering out noise on endstops requires a delayed decision. Let's assume, due to noise,
616
+       * that 50% of endstop signal samples are good and 50% are bad (assuming normal distribution
617
+       * of random noise). Then the first sample has a 50% chance to be good or bad. The 2nd sample
618
+       * also has a 50% chance to be good or bad. The chances of 2 samples both being bad becomes
619
+       * 50% of 50%, or 25%. That was the previous implementation of Marlin endstop handling. It
620
+       * reduces chances of bad readings in half, at the cost of 1 extra sample period, but chances
621
+       * still exist. The only way to reduce them further is to increase the number of samples.
622
+       * To reduce the chance to 1% (1/128th) requires 7 samples (adding 7ms of delay).
623
+       */
624
+      endstop_poll_count = 7;
625
+      old_live_state = live_state;
626
+    }
627
+    else if (endstop_poll_count && !--endstop_poll_count)
628
+      validated_live_state = live_state;
629
+
630
+  #else
631
+
632
+    // Lets accept the new endstop values as valid - We assume hardware filtering of lines
633
+    esbits_t validated_live_state = live_state;
634
+
635
+  #endif
636
+
637
+  // Endstop readings are validated in validated_live_state
638
+
639
+  // Test the current status of an endstop
640
+  #define TEST_ENDSTOP(ENDSTOP) (TEST(validated_live_state, ENDSTOP))
641
+
642
+  // Record endstop was hit
643
+  #define _ENDSTOP_HIT(AXIS, MINMAX) SBI(hit_state, _ENDSTOP(AXIS, MINMAX))
644
+
645
+  // Call the endstop triggered routine for single endstops
646
+  #define PROCESS_ENDSTOP(AXIS,MINMAX) do { \
647
+      if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX))) { \
648
+        _ENDSTOP_HIT(AXIS, MINMAX); \
649
+        planner.endstop_triggered(_AXIS(AXIS)); \
650
+      } \
651
+    }while(0)
652
+
653
+  // Call the endstop triggered routine for single endstops
654
+  #define PROCESS_DUAL_ENDSTOP(AXIS1, AXIS2, MINMAX) do { \
655
+      if (TEST_ENDSTOP(_ENDSTOP(AXIS1, MINMAX)) || TEST_ENDSTOP(_ENDSTOP(AXIS2, MINMAX))) { \
656
+        _ENDSTOP_HIT(AXIS1, MINMAX); \
657
+        planner.endstop_triggered(_AXIS(AXIS1)); \
658
+      } \
659
+    }while(0)
660
+
661
+  #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ)
662
+    // If G38 command is active check Z_MIN_PROBE for ALL movement
663
+    if (G38_move) {
664
+      if (TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE))) {
665
+        if      (stepper.movement_non_null(_AXIS(X))) { _ENDSTOP_HIT(X, MIN); planner.endstop_triggered(_AXIS(X)); }
666
+        else if (stepper.movement_non_null(_AXIS(Y))) { _ENDSTOP_HIT(Y, MIN); planner.endstop_triggered(_AXIS(Y)); }
667
+        else if (stepper.movement_non_null(_AXIS(Z))) { _ENDSTOP_HIT(Z, MIN); planner.endstop_triggered(_AXIS(Z)); }
668
+        G38_endstop_hit = true;
669
+      }
670
+    }
671
+  #endif
672
+
673
+  // Now, we must signal, after validation, if an endstop limit is pressed or not
674
+  if (X_MOVE_TEST) {
675
+    if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction
676
+      #if HAS_X_MIN
677
+        #if ENABLED(X_DUAL_ENDSTOPS)
678
+          PROCESS_DUAL_ENDSTOP(X, X2, MIN);
679
+        #else
680
+          if (X_MIN_TEST) PROCESS_ENDSTOP(X, MIN);
681
+        #endif
682
+      #endif
683
+    }
684
+    else { // +direction
685
+      #if HAS_X_MAX
686
+        #if ENABLED(X_DUAL_ENDSTOPS)
687
+          PROCESS_DUAL_ENDSTOP(X, X2, MAX);
688
+        #else
689
+          if (X_MAX_TEST) PROCESS_ENDSTOP(X, MAX);
690
+        #endif
691
+      #endif
692
+    }
693
+  }
694
+
695
+  if (Y_MOVE_TEST) {
696
+    if (stepper.motor_direction(Y_AXIS_HEAD)) { // -direction
697
+      #if HAS_Y_MIN
698
+        #if ENABLED(Y_DUAL_ENDSTOPS)
699
+          PROCESS_DUAL_ENDSTOP(Y, Y2, MIN);
700
+        #else
701
+          PROCESS_ENDSTOP(Y, MIN);
702
+        #endif
703
+      #endif
704
+    }
705
+    else { // +direction
706
+      #if HAS_Y_MAX
707
+        #if ENABLED(Y_DUAL_ENDSTOPS)
708
+          PROCESS_DUAL_ENDSTOP(Y, Y2, MAX);
709
+        #else
710
+          PROCESS_ENDSTOP(Y, MAX);
711
+        #endif
712
+      #endif
713
+    }
714
+  }
715
+
716
+  if (Z_MOVE_TEST) {
717
+    if (stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up.
718
+      #if HAS_Z_MIN
719
+        #if ENABLED(Z_DUAL_ENDSTOPS)
720
+          PROCESS_DUAL_ENDSTOP(Z, Z2, MIN);
721
+        #else
722
+          #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
723
+            if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN);
724
+          #else
725
+            PROCESS_ENDSTOP(Z, MIN);
726
+          #endif
727
+        #endif
728
+      #endif
729
+
730
+      // When closing the gap check the enabled probe
731
+      #if ENABLED(Z_MIN_PROBE_ENDSTOP)
732
+        if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN_PROBE);
733
+      #endif
734
+    }
735
+    else { // Z +direction. Gantry up, bed down.
736
+      #if HAS_Z_MAX
737
+        #if ENABLED(Z_DUAL_ENDSTOPS)
738
+          PROCESS_DUAL_ENDSTOP(Z, Z2, MAX);
739
+        #elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN
740
+          // If this pin is not hijacked for the bed probe
741
+          // then it belongs to the Z endstop
742
+          PROCESS_ENDSTOP(Z, MAX);
657 743
         #endif
658 744
       #endif
659 745
     }
@@ -676,96 +762,96 @@ void Endstops::update() {
676 762
    */
677 763
   void Endstops::monitor() {
678 764
 
679
-    static uint16_t old_endstop_bits_local = 0;
765
+    static uint16_t old_live_state_local = 0;
680 766
     static uint8_t local_LED_status = 0;
681
-    uint16_t current_endstop_bits_local = 0;
767
+    uint16_t live_state_local = 0;
682 768
 
683 769
     #if HAS_X_MIN
684
-      if (READ(X_MIN_PIN)) SBI(current_endstop_bits_local, X_MIN);
770
+      if (READ(X_MIN_PIN)) SBI(live_state_local, X_MIN);
685 771
     #endif
686 772
     #if HAS_X_MAX
687
-      if (READ(X_MAX_PIN)) SBI(current_endstop_bits_local, X_MAX);
773
+      if (READ(X_MAX_PIN)) SBI(live_state_local, X_MAX);
688 774
     #endif
689 775
     #if HAS_Y_MIN
690
-      if (READ(Y_MIN_PIN)) SBI(current_endstop_bits_local, Y_MIN);
776
+      if (READ(Y_MIN_PIN)) SBI(live_state_local, Y_MIN);
691 777
     #endif
692 778
     #if HAS_Y_MAX
693
-      if (READ(Y_MAX_PIN)) SBI(current_endstop_bits_local, Y_MAX);
779
+      if (READ(Y_MAX_PIN)) SBI(live_state_local, Y_MAX);
694 780
     #endif
695 781
     #if HAS_Z_MIN
696
-      if (READ(Z_MIN_PIN)) SBI(current_endstop_bits_local, Z_MIN);
782
+      if (READ(Z_MIN_PIN)) SBI(live_state_local, Z_MIN);
697 783
     #endif
698 784
     #if HAS_Z_MAX
699
-      if (READ(Z_MAX_PIN)) SBI(current_endstop_bits_local, Z_MAX);
785
+      if (READ(Z_MAX_PIN)) SBI(live_state_local, Z_MAX);
700 786
     #endif
701 787
     #if HAS_Z_MIN_PROBE_PIN
702
-      if (READ(Z_MIN_PROBE_PIN)) SBI(current_endstop_bits_local, Z_MIN_PROBE);
788
+      if (READ(Z_MIN_PROBE_PIN)) SBI(live_state_local, Z_MIN_PROBE);
703 789
     #endif
704 790
     #if HAS_X2_MIN
705
-      if (READ(X2_MIN_PIN)) SBI(current_endstop_bits_local, X2_MIN);
791
+      if (READ(X2_MIN_PIN)) SBI(live_state_local, X2_MIN);
706 792
     #endif
707 793
     #if HAS_X2_MAX
708
-      if (READ(X2_MAX_PIN)) SBI(current_endstop_bits_local, X2_MAX);
794
+      if (READ(X2_MAX_PIN)) SBI(live_state_local, X2_MAX);
709 795
     #endif
710 796
     #if HAS_Y2_MIN
711
-      if (READ(Y2_MIN_PIN)) SBI(current_endstop_bits_local, Y2_MIN);
797
+      if (READ(Y2_MIN_PIN)) SBI(live_state_local, Y2_MIN);
712 798
     #endif
713 799
     #if HAS_Y2_MAX
714
-      if (READ(Y2_MAX_PIN)) SBI(current_endstop_bits_local, Y2_MAX);
800
+      if (READ(Y2_MAX_PIN)) SBI(live_state_local, Y2_MAX);
715 801
     #endif
716 802
     #if HAS_Z2_MIN
717
-      if (READ(Z2_MIN_PIN)) SBI(current_endstop_bits_local, Z2_MIN);
803
+      if (READ(Z2_MIN_PIN)) SBI(live_state_local, Z2_MIN);
718 804
     #endif
719 805
     #if HAS_Z2_MAX
720
-      if (READ(Z2_MAX_PIN)) SBI(current_endstop_bits_local, Z2_MAX);
806
+      if (READ(Z2_MAX_PIN)) SBI(live_state_local, Z2_MAX);
721 807
     #endif
722 808
 
723
-    uint16_t endstop_change = current_endstop_bits_local ^ old_endstop_bits_local;
809
+    uint16_t endstop_change = live_state_local ^ old_live_state_local;
724 810
 
725 811
     if (endstop_change) {
726 812
       #if HAS_X_MIN
727
-        if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR("  X_MIN:", TEST(current_endstop_bits_local, X_MIN));
813
+        if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR("  X_MIN:", TEST(live_state_local, X_MIN));
728 814
       #endif
729 815
       #if HAS_X_MAX
730
-        if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR("  X_MAX:", TEST(current_endstop_bits_local, X_MAX));
816
+        if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR("  X_MAX:", TEST(live_state_local, X_MAX));
731 817
       #endif
732 818
       #if HAS_Y_MIN
733
-        if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR("  Y_MIN:", TEST(current_endstop_bits_local, Y_MIN));
819
+        if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR("  Y_MIN:", TEST(live_state_local, Y_MIN));
734 820
       #endif
735 821
       #if HAS_Y_MAX
736
-        if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR("  Y_MAX:", TEST(current_endstop_bits_local, Y_MAX));
822
+        if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR("  Y_MAX:", TEST(live_state_local, Y_MAX));
737 823
       #endif
738 824
       #if HAS_Z_MIN
739
-        if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR("  Z_MIN:", TEST(current_endstop_bits_local, Z_MIN));
825
+        if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR("  Z_MIN:", TEST(live_state_local, Z_MIN));
740 826
       #endif
741 827
       #if HAS_Z_MAX
742
-        if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR("  Z_MAX:", TEST(current_endstop_bits_local, Z_MAX));
828
+        if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR("  Z_MAX:", TEST(live_state_local, Z_MAX));
743 829
       #endif
744 830
       #if HAS_Z_MIN_PROBE_PIN
745
-        if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR("  PROBE:", TEST(current_endstop_bits_local, Z_MIN_PROBE));
831
+        if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR("  PROBE:", TEST(live_state_local, Z_MIN_PROBE));
746 832
       #endif
747 833
       #if HAS_X2_MIN
748
-        if (TEST(endstop_change, X2_MIN)) SERIAL_PROTOCOLPAIR("  X2_MIN:", TEST(current_endstop_bits_local, X2_MIN));
834
+        if (TEST(endstop_change, X2_MIN)) SERIAL_PROTOCOLPAIR("  X2_MIN:", TEST(live_state_local, X2_MIN));
749 835
       #endif
750 836
       #if HAS_X2_MAX
751
-        if (TEST(endstop_change, X2_MAX)) SERIAL_PROTOCOLPAIR("  X2_MAX:", TEST(current_endstop_bits_local, X2_MAX));
837
+        if (TEST(endstop_change, X2_MAX)) SERIAL_PROTOCOLPAIR("  X2_MAX:", TEST(live_state_local, X2_MAX));
752 838
       #endif
753 839
       #if HAS_Y2_MIN
754
-        if (TEST(endstop_change, Y2_MIN)) SERIAL_PROTOCOLPAIR("  Y2_MIN:", TEST(current_endstop_bits_local, Y2_MIN));
840
+        if (TEST(endstop_change, Y2_MIN)) SERIAL_PROTOCOLPAIR("  Y2_MIN:", TEST(live_state_local, Y2_MIN));
755 841
       #endif
756 842
       #if HAS_Y2_MAX
757
-        if (TEST(endstop_change, Y2_MAX)) SERIAL_PROTOCOLPAIR("  Y2_MAX:", TEST(current_endstop_bits_local, Y2_MAX));
843
+        if (TEST(endstop_change, Y2_MAX)) SERIAL_PROTOCOLPAIR("  Y2_MAX:", TEST(live_state_local, Y2_MAX));
758 844
       #endif
759 845
       #if HAS_Z2_MIN
760
-        if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR("  Z2_MIN:", TEST(current_endstop_bits_local, Z2_MIN));
846
+        if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR("  Z2_MIN:", TEST(live_state_local, Z2_MIN));
761 847
       #endif
762 848
       #if HAS_Z2_MAX
763
-        if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR("  Z2_MAX:", TEST(current_endstop_bits_local, Z2_MAX));
849
+        if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR("  Z2_MAX:", TEST(live_state_local, Z2_MAX));
764 850
       #endif
765 851
       SERIAL_PROTOCOLPGM("\n\n");
766 852
       analogWrite(LED_PIN, local_LED_status);
767 853
       local_LED_status ^= 255;
768
-      old_endstop_bits_local = current_endstop_bits_local;
854
+      old_live_state_local = live_state_local;
769 855
     }
770 856
   }
771 857
 

+ 20
- 15
Marlin/src/module/endstops.h 查看文件

@@ -51,7 +51,6 @@ class Endstops {
51 51
   public:
52 52
 
53 53
     static bool enabled, enabled_globally;
54
-    static volatile uint8_t endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value
55 54
 
56 55
     #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
57 56
       typedef uint16_t esbits_t;
@@ -65,11 +64,19 @@ class Endstops {
65 64
         static float z_endstop_adj;
66 65
       #endif
67 66
     #else
68
-      typedef byte esbits_t;
67
+      typedef uint8_t esbits_t;
69 68
     #endif
70 69
 
71
-    static esbits_t current_endstop_bits;
70
+  private:
71
+    static esbits_t live_state;
72
+    static volatile uint8_t hit_state;      // Use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT index
73
+    #if ENABLED(ENDSTOP_NOISE_FILTER)
74
+      static esbits_t old_live_state,       // Old endstop value for debouncing and denoising
75
+                      validated_live_state; // The validated (accepted as true) endstop bits
76
+      static uint8_t endstop_poll_count;    // Countdown from threshold for polling
77
+    #endif
72 78
 
79
+  public:
73 80
     Endstops() {};
74 81
 
75 82
     /**
@@ -94,6 +101,16 @@ class Endstops {
94 101
     static void update();
95 102
 
96 103
     /**
104
+     * Get Endstop hit state.
105
+     */
106
+    FORCE_INLINE static uint8_t trigger_state() { return hit_state; }
107
+
108
+    /**
109
+     * Get current endstops state
110
+     */
111
+    FORCE_INLINE static esbits_t state() { return live_state; }
112
+
113
+    /**
97 114
      * Print an error message reporting the position when the endstops were last hit.
98 115
      */
99 116
     static void report_state(); //call from somewhere to create an serial error message with the locations the endstops where hit, in case they were triggered
@@ -127,18 +144,6 @@ class Endstops {
127 144
       static void monitor();
128 145
       static void run_monitor();
129 146
     #endif
130
-
131
-  private:
132
-
133
-    #if ENABLED(X_DUAL_ENDSTOPS)
134
-      static void test_dual_x_endstops(const EndstopEnum es1, const EndstopEnum es2);
135
-    #endif
136
-    #if ENABLED(Y_DUAL_ENDSTOPS)
137
-      static void test_dual_y_endstops(const EndstopEnum es1, const EndstopEnum es2);
138
-    #endif
139
-    #if ENABLED(Z_DUAL_ENDSTOPS)
140
-      static void test_dual_z_endstops(const EndstopEnum es1, const EndstopEnum es2);
141
-    #endif
142 147
 };
143 148
 
144 149
 extern Endstops endstops;

+ 1
- 1
Marlin/src/module/probe.cpp 查看文件

@@ -515,7 +515,7 @@ static bool do_probe_move(const float z, const float fr_mm_s) {
515 515
   do_blocking_move_to_z(z, fr_mm_s);
516 516
 
517 517
   // Check to see if the probe was triggered
518
-  const bool probe_triggered = TEST(Endstops::endstop_hit_bits,
518
+  const bool probe_triggered = TEST(endstops.trigger_state(),
519 519
     #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
520 520
       Z_MIN
521 521
     #else

+ 4
- 4
Marlin/src/module/stepper.cpp 查看文件

@@ -184,12 +184,12 @@ volatile int32_t Stepper::endstops_trigsteps[XYZ];
184 184
   #define DUAL_ENDSTOP_APPLY_STEP(A,V)                                                                                                      \
185 185
     if (performing_homing) {                                                                                                                \
186 186
       if (A##_HOME_DIR < 0) {                                                                                                               \
187
-        if (!(TEST(endstops.current_endstop_bits, A##_MIN) && count_direction[_AXIS(A)] < 0) && !LOCKED_##A##_MOTOR) A##_STEP_WRITE(V);     \
188
-        if (!(TEST(endstops.current_endstop_bits, A##2_MIN) && count_direction[_AXIS(A)] < 0) && !LOCKED_##A##2_MOTOR) A##2_STEP_WRITE(V);  \
187
+        if (!(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !LOCKED_##A##_MOTOR) A##_STEP_WRITE(V);     \
188
+        if (!(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !LOCKED_##A##2_MOTOR) A##2_STEP_WRITE(V);  \
189 189
       }                                                                                                                                     \
190 190
       else {                                                                                                                                \
191
-        if (!(TEST(endstops.current_endstop_bits, A##_MAX) && count_direction[_AXIS(A)] > 0) && !LOCKED_##A##_MOTOR) A##_STEP_WRITE(V);     \
192
-        if (!(TEST(endstops.current_endstop_bits, A##2_MAX) && count_direction[_AXIS(A)] > 0) && !LOCKED_##A##2_MOTOR) A##2_STEP_WRITE(V);  \
191
+        if (!(TEST(endstops.state(), A##_MAX) && count_direction[_AXIS(A)] > 0) && !LOCKED_##A##_MOTOR) A##_STEP_WRITE(V);     \
192
+        if (!(TEST(endstops.state(), A##2_MAX) && count_direction[_AXIS(A)] > 0) && !LOCKED_##A##2_MOTOR) A##2_STEP_WRITE(V);  \
193 193
       }                                                                                                                                     \
194 194
     }                                                                                                                                       \
195 195
     else {                                                                                                                                  \

Loading…
取消
儲存