From 9271d12bf7ad316dfae40465db5876ef1580f022 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 7 Aug 2018 16:32:32 +0200 Subject: [PATCH] Save 32B of FLASH, fix compiler warning: sketch/tmc2130.cpp:238:6: warning: unused parameter 'last_step_mask' [-Wunused-parameter]. --- Firmware/stepper.cpp | 15 +-------------- Firmware/tmc2130.cpp | 2 +- Firmware/tmc2130.h | 2 +- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Firmware/stepper.cpp b/Firmware/stepper.cpp index cb4e680f..76a110f5 100644 --- a/Firmware/stepper.cpp +++ b/Firmware/stepper.cpp @@ -104,8 +104,6 @@ static bool z_endstop_invert = false; volatile long count_position[NUM_AXIS] = { 0, 0, 0, 0}; volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1}; -uint8_t LastStepMask = 0; - #ifdef LIN_ADVANCE static uint16_t nextMainISR = 0; @@ -714,7 +712,6 @@ FORCE_INLINE void stepper_tick_lowres() counter_x.lo += current_block->steps_x.lo; if (counter_x.lo > 0) { WRITE_NC(X_STEP_PIN, !INVERT_X_STEP_PIN); - LastStepMask |= X_AXIS_MASK; #ifdef DEBUG_XSTEP_DUP_PIN WRITE_NC(DEBUG_XSTEP_DUP_PIN,!INVERT_X_STEP_PIN); #endif //DEBUG_XSTEP_DUP_PIN @@ -729,7 +726,6 @@ FORCE_INLINE void stepper_tick_lowres() counter_y.lo += current_block->steps_y.lo; if (counter_y.lo > 0) { WRITE_NC(Y_STEP_PIN, !INVERT_Y_STEP_PIN); - LastStepMask |= Y_AXIS_MASK; #ifdef DEBUG_YSTEP_DUP_PIN WRITE_NC(DEBUG_YSTEP_DUP_PIN,!INVERT_Y_STEP_PIN); #endif //DEBUG_YSTEP_DUP_PIN @@ -744,7 +740,6 @@ FORCE_INLINE void stepper_tick_lowres() counter_z.lo += current_block->steps_z.lo; if (counter_z.lo > 0) { WRITE_NC(Z_STEP_PIN, !INVERT_Z_STEP_PIN); - LastStepMask |= Z_AXIS_MASK; counter_z.lo -= current_block->step_event_count.lo; count_position[Z_AXIS]+=count_direction[Z_AXIS]; WRITE_NC(Z_STEP_PIN, INVERT_Z_STEP_PIN); @@ -779,7 +774,6 @@ FORCE_INLINE void stepper_tick_highres() counter_x.wide += current_block->steps_x.wide; if (counter_x.wide > 0) { WRITE_NC(X_STEP_PIN, !INVERT_X_STEP_PIN); - LastStepMask |= X_AXIS_MASK; #ifdef DEBUG_XSTEP_DUP_PIN WRITE_NC(DEBUG_XSTEP_DUP_PIN,!INVERT_X_STEP_PIN); #endif //DEBUG_XSTEP_DUP_PIN @@ -794,7 +788,6 @@ FORCE_INLINE void stepper_tick_highres() counter_y.wide += current_block->steps_y.wide; if (counter_y.wide > 0) { WRITE_NC(Y_STEP_PIN, !INVERT_Y_STEP_PIN); - LastStepMask |= Y_AXIS_MASK; #ifdef DEBUG_YSTEP_DUP_PIN WRITE_NC(DEBUG_YSTEP_DUP_PIN,!INVERT_Y_STEP_PIN); #endif //DEBUG_YSTEP_DUP_PIN @@ -809,7 +802,6 @@ FORCE_INLINE void stepper_tick_highres() counter_z.wide += current_block->steps_z.wide; if (counter_z.wide > 0) { WRITE_NC(Z_STEP_PIN, !INVERT_Z_STEP_PIN); - LastStepMask |= Z_AXIS_MASK; counter_z.wide -= current_block->step_event_count.wide; count_position[Z_AXIS]+=count_direction[Z_AXIS]; WRITE_NC(Z_STEP_PIN, INVERT_Z_STEP_PIN); @@ -847,8 +839,6 @@ FORCE_INLINE void isr() { if (current_block == NULL) stepper_next_block(); - LastStepMask = 0; - if (current_block != NULL) { stepper_check_endstops(); @@ -1066,7 +1056,7 @@ FORCE_INLINE void isr() { } #ifdef TMC2130 - tmc2130_st_isr(LastStepMask); + tmc2130_st_isr(); #endif //TMC2130 //WRITE_NC(LOGIC_ANALYZER_CH0, false); @@ -1421,7 +1411,6 @@ void babystep(const uint8_t axis,const bool direction) //perform step WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN); - LastStepMask |= X_AXIS_MASK; #ifdef DEBUG_XSTEP_DUP_PIN WRITE(DEBUG_XSTEP_DUP_PIN,!INVERT_X_STEP_PIN); #endif //DEBUG_XSTEP_DUP_PIN @@ -1445,7 +1434,6 @@ void babystep(const uint8_t axis,const bool direction) //perform step WRITE(Y_STEP_PIN, !INVERT_Y_STEP_PIN); - LastStepMask |= Y_AXIS_MASK; #ifdef DEBUG_YSTEP_DUP_PIN WRITE(DEBUG_YSTEP_DUP_PIN,!INVERT_Y_STEP_PIN); #endif //DEBUG_YSTEP_DUP_PIN @@ -1472,7 +1460,6 @@ void babystep(const uint8_t axis,const bool direction) #endif //perform step WRITE(Z_STEP_PIN, !INVERT_Z_STEP_PIN); - LastStepMask |= Z_AXIS_MASK; #ifdef Z_DUAL_STEPPER_DRIVERS WRITE(Z2_STEP_PIN, !INVERT_Z_STEP_PIN); #endif diff --git a/Firmware/tmc2130.cpp b/Firmware/tmc2130.cpp index 27600e92..ddef5dd8 100644 --- a/Firmware/tmc2130.cpp +++ b/Firmware/tmc2130.cpp @@ -235,7 +235,7 @@ uint8_t tmc2130_sample_diag() extern bool is_usb_printing; -void tmc2130_st_isr(uint8_t last_step_mask) +void tmc2130_st_isr() { if (tmc2130_mode == TMC2130_MODE_SILENT || tmc2130_sg_stop_on_crash == false) return; uint8_t crash = 0; diff --git a/Firmware/tmc2130.h b/Firmware/tmc2130.h index 28ecb7be..66c2b92b 100644 --- a/Firmware/tmc2130.h +++ b/Firmware/tmc2130.h @@ -53,7 +53,7 @@ extern tmc2130_chopper_config_t tmc2130_chopper_config[4]; //initialize tmc2130 extern void tmc2130_init(); //check diag pins (called from stepper isr) -extern void tmc2130_st_isr(uint8_t last_step_mask); +extern void tmc2130_st_isr(); //update stall guard (called from st_synchronize inside the loop) extern bool tmc2130_update_sg(); //temperature watching (called from )