Clean Endstops::event_handler

This commit is contained in:
Scott Lahteine 2019-10-29 15:58:00 -05:00
parent be498d6280
commit c5713b5e98

View file

@ -340,7 +340,9 @@ void Endstops::resync() {
void Endstops::event_handler() {
static uint8_t prev_hit_state; // = 0
if (hit_state && hit_state != prev_hit_state) {
if (hit_state == prev_hit_state) return;
prev_hit_state = hit_state;
if (hit_state) {
#if HAS_SPI_LCD
char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' ';
#define _SET_STOP_CHAR(A,C) (chr## A = C)
@ -385,7 +387,6 @@ void Endstops::event_handler() {
}
#endif
}
prev_hit_state = hit_state;
}
static void print_es_state(const bool is_hit, PGM_P const label=nullptr) {