From 5cd0177389c5f0dc93da3b70dd404582e3022f4a Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sun, 2 Jun 2019 15:01:56 +0200 Subject: [PATCH] Cleanup fsensor_st_block_begin --- Firmware/fsensor.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Firmware/fsensor.cpp b/Firmware/fsensor.cpp index 471518b22..563d37d65 100644 --- a/Firmware/fsensor.cpp +++ b/Firmware/fsensor.cpp @@ -489,15 +489,13 @@ void fsensor_setup_interrupt(void) #endif //PAT9125 -void fsensor_st_block_begin(bool rev) +void fsensor_st_block_begin(bool rev __attribute__((unused))) { - if (!fsensor_enabled) return; - if (fsensor_st_cnt && ((fsensor_st_cnt > 0) ^ rev)) - { -// !!! bit toggling (PINxn <- 1) (for PinChangeInterrupt) does not work for some MCU pins - if (PIN_GET(FSENSOR_INT_PIN)) {PIN_VAL(FSENSOR_INT_PIN, LOW);} - else {PIN_VAL(FSENSOR_INT_PIN, HIGH);} - } + // There's really nothing to do here: the stepper ISR likely has called us + // already at the end of the last block, making this integration redundant. + // LA1.5 might not always do that during a coasting move, so attempt to drain + // fsensor_st_cnt anyway at the beginning of the new block. + fsensor_st_block_chunk(0); } void fsensor_st_block_chunk(int cnt)