diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 8c488f6..7a5b278 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1526,6 +1526,13 @@ // //#define STARTUP_CHIME +// +// ENDSTOP BEEP +// +// Short 2KHz beep when endstops are hit +// +//#define ENDSTOP_BEEP + // // The duration and frequency for the UI feedback sound. // Set these to 0 to disable audio feedback in the LCD menus. diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6611bc9..1192126 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -14815,6 +14815,25 @@ void disable_all_steppers() { disable_e_steppers(); } +#ifdef ENDSTOP_BEEP + void EndstopBeep() { + static char last_status=((READ(X_MIN_PIN)<<2)|(READ(Y_MIN_PIN)<<1)|READ(X_MAX_PIN)); + static unsigned char now_status; + + now_status=((READ(X_MIN_PIN)<<2)|(READ(Y_MIN_PIN)<<1)|READ(X_MAX_PIN))&0xff; + + if(now_status