Kaynağa Gözat

Clean Endstops::event_handler

Scott Lahteine 5 yıl önce
ebeveyn
işleme
c5713b5e98
1 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  1. 3
    2
      Marlin/src/module/endstops.cpp

+ 3
- 2
Marlin/src/module/endstops.cpp Dosyayı Görüntüle

@@ -340,7 +340,9 @@ void Endstops::resync() {
340 340
 
341 341
 void Endstops::event_handler() {
342 342
   static uint8_t prev_hit_state; // = 0
343
-  if (hit_state && hit_state != prev_hit_state) {
343
+  if (hit_state == prev_hit_state) return;
344
+  prev_hit_state = hit_state;
345
+  if (hit_state) {
344 346
     #if HAS_SPI_LCD
345 347
       char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' ';
346 348
       #define _SET_STOP_CHAR(A,C) (chr## A = C)
@@ -385,7 +387,6 @@ void Endstops::event_handler() {
385 387
       }
386 388
     #endif
387 389
   }
388
-  prev_hit_state = hit_state;
389 390
 }
390 391
 
391 392
 static void print_es_state(const bool is_hit, PGM_P const label=nullptr) {

Loading…
İptal
Kaydet