Cleanup fsensor_st_block_begin

This commit is contained in:
Yuri D'Elia 2019-06-02 15:01:56 +02:00
parent b4bf79297f
commit 5cd0177389
1 changed files with 6 additions and 8 deletions

View File

@ -489,15 +489,13 @@ void fsensor_setup_interrupt(void)
#endif //PAT9125 #endif //PAT9125
void fsensor_st_block_begin(bool rev) void fsensor_st_block_begin(bool rev __attribute__((unused)))
{ {
if (!fsensor_enabled) return; // There's really nothing to do here: the stepper ISR likely has called us
if (fsensor_st_cnt && ((fsensor_st_cnt > 0) ^ rev)) // 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
// !!! bit toggling (PINxn <- 1) (for PinChangeInterrupt) does not work for some MCU pins // fsensor_st_cnt anyway at the beginning of the new block.
if (PIN_GET(FSENSOR_INT_PIN)) {PIN_VAL(FSENSOR_INT_PIN, LOW);} fsensor_st_block_chunk(0);
else {PIN_VAL(FSENSOR_INT_PIN, HIGH);}
}
} }
void fsensor_st_block_chunk(int cnt) void fsensor_st_block_chunk(int cnt)