Save 32B of FLASH, fix compiler warning: sketch/tmc2130.cpp:238:6: warning: unused parameter 'last_step_mask' [-Wunused-parameter].
This commit is contained in:
parent
5af4897360
commit
9271d12bf7
3 changed files with 3 additions and 16 deletions
|
@ -104,8 +104,6 @@ static bool z_endstop_invert = false;
|
||||||
volatile long count_position[NUM_AXIS] = { 0, 0, 0, 0};
|
volatile long count_position[NUM_AXIS] = { 0, 0, 0, 0};
|
||||||
volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1};
|
volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1};
|
||||||
|
|
||||||
uint8_t LastStepMask = 0;
|
|
||||||
|
|
||||||
#ifdef LIN_ADVANCE
|
#ifdef LIN_ADVANCE
|
||||||
|
|
||||||
static uint16_t nextMainISR = 0;
|
static uint16_t nextMainISR = 0;
|
||||||
|
@ -714,7 +712,6 @@ FORCE_INLINE void stepper_tick_lowres()
|
||||||
counter_x.lo += current_block->steps_x.lo;
|
counter_x.lo += current_block->steps_x.lo;
|
||||||
if (counter_x.lo > 0) {
|
if (counter_x.lo > 0) {
|
||||||
WRITE_NC(X_STEP_PIN, !INVERT_X_STEP_PIN);
|
WRITE_NC(X_STEP_PIN, !INVERT_X_STEP_PIN);
|
||||||
LastStepMask |= X_AXIS_MASK;
|
|
||||||
#ifdef DEBUG_XSTEP_DUP_PIN
|
#ifdef DEBUG_XSTEP_DUP_PIN
|
||||||
WRITE_NC(DEBUG_XSTEP_DUP_PIN,!INVERT_X_STEP_PIN);
|
WRITE_NC(DEBUG_XSTEP_DUP_PIN,!INVERT_X_STEP_PIN);
|
||||||
#endif //DEBUG_XSTEP_DUP_PIN
|
#endif //DEBUG_XSTEP_DUP_PIN
|
||||||
|
@ -729,7 +726,6 @@ FORCE_INLINE void stepper_tick_lowres()
|
||||||
counter_y.lo += current_block->steps_y.lo;
|
counter_y.lo += current_block->steps_y.lo;
|
||||||
if (counter_y.lo > 0) {
|
if (counter_y.lo > 0) {
|
||||||
WRITE_NC(Y_STEP_PIN, !INVERT_Y_STEP_PIN);
|
WRITE_NC(Y_STEP_PIN, !INVERT_Y_STEP_PIN);
|
||||||
LastStepMask |= Y_AXIS_MASK;
|
|
||||||
#ifdef DEBUG_YSTEP_DUP_PIN
|
#ifdef DEBUG_YSTEP_DUP_PIN
|
||||||
WRITE_NC(DEBUG_YSTEP_DUP_PIN,!INVERT_Y_STEP_PIN);
|
WRITE_NC(DEBUG_YSTEP_DUP_PIN,!INVERT_Y_STEP_PIN);
|
||||||
#endif //DEBUG_YSTEP_DUP_PIN
|
#endif //DEBUG_YSTEP_DUP_PIN
|
||||||
|
@ -744,7 +740,6 @@ FORCE_INLINE void stepper_tick_lowres()
|
||||||
counter_z.lo += current_block->steps_z.lo;
|
counter_z.lo += current_block->steps_z.lo;
|
||||||
if (counter_z.lo > 0) {
|
if (counter_z.lo > 0) {
|
||||||
WRITE_NC(Z_STEP_PIN, !INVERT_Z_STEP_PIN);
|
WRITE_NC(Z_STEP_PIN, !INVERT_Z_STEP_PIN);
|
||||||
LastStepMask |= Z_AXIS_MASK;
|
|
||||||
counter_z.lo -= current_block->step_event_count.lo;
|
counter_z.lo -= current_block->step_event_count.lo;
|
||||||
count_position[Z_AXIS]+=count_direction[Z_AXIS];
|
count_position[Z_AXIS]+=count_direction[Z_AXIS];
|
||||||
WRITE_NC(Z_STEP_PIN, INVERT_Z_STEP_PIN);
|
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;
|
counter_x.wide += current_block->steps_x.wide;
|
||||||
if (counter_x.wide > 0) {
|
if (counter_x.wide > 0) {
|
||||||
WRITE_NC(X_STEP_PIN, !INVERT_X_STEP_PIN);
|
WRITE_NC(X_STEP_PIN, !INVERT_X_STEP_PIN);
|
||||||
LastStepMask |= X_AXIS_MASK;
|
|
||||||
#ifdef DEBUG_XSTEP_DUP_PIN
|
#ifdef DEBUG_XSTEP_DUP_PIN
|
||||||
WRITE_NC(DEBUG_XSTEP_DUP_PIN,!INVERT_X_STEP_PIN);
|
WRITE_NC(DEBUG_XSTEP_DUP_PIN,!INVERT_X_STEP_PIN);
|
||||||
#endif //DEBUG_XSTEP_DUP_PIN
|
#endif //DEBUG_XSTEP_DUP_PIN
|
||||||
|
@ -794,7 +788,6 @@ FORCE_INLINE void stepper_tick_highres()
|
||||||
counter_y.wide += current_block->steps_y.wide;
|
counter_y.wide += current_block->steps_y.wide;
|
||||||
if (counter_y.wide > 0) {
|
if (counter_y.wide > 0) {
|
||||||
WRITE_NC(Y_STEP_PIN, !INVERT_Y_STEP_PIN);
|
WRITE_NC(Y_STEP_PIN, !INVERT_Y_STEP_PIN);
|
||||||
LastStepMask |= Y_AXIS_MASK;
|
|
||||||
#ifdef DEBUG_YSTEP_DUP_PIN
|
#ifdef DEBUG_YSTEP_DUP_PIN
|
||||||
WRITE_NC(DEBUG_YSTEP_DUP_PIN,!INVERT_Y_STEP_PIN);
|
WRITE_NC(DEBUG_YSTEP_DUP_PIN,!INVERT_Y_STEP_PIN);
|
||||||
#endif //DEBUG_YSTEP_DUP_PIN
|
#endif //DEBUG_YSTEP_DUP_PIN
|
||||||
|
@ -809,7 +802,6 @@ FORCE_INLINE void stepper_tick_highres()
|
||||||
counter_z.wide += current_block->steps_z.wide;
|
counter_z.wide += current_block->steps_z.wide;
|
||||||
if (counter_z.wide > 0) {
|
if (counter_z.wide > 0) {
|
||||||
WRITE_NC(Z_STEP_PIN, !INVERT_Z_STEP_PIN);
|
WRITE_NC(Z_STEP_PIN, !INVERT_Z_STEP_PIN);
|
||||||
LastStepMask |= Z_AXIS_MASK;
|
|
||||||
counter_z.wide -= current_block->step_event_count.wide;
|
counter_z.wide -= current_block->step_event_count.wide;
|
||||||
count_position[Z_AXIS]+=count_direction[Z_AXIS];
|
count_position[Z_AXIS]+=count_direction[Z_AXIS];
|
||||||
WRITE_NC(Z_STEP_PIN, INVERT_Z_STEP_PIN);
|
WRITE_NC(Z_STEP_PIN, INVERT_Z_STEP_PIN);
|
||||||
|
@ -847,8 +839,6 @@ FORCE_INLINE void isr() {
|
||||||
if (current_block == NULL)
|
if (current_block == NULL)
|
||||||
stepper_next_block();
|
stepper_next_block();
|
||||||
|
|
||||||
LastStepMask = 0;
|
|
||||||
|
|
||||||
if (current_block != NULL)
|
if (current_block != NULL)
|
||||||
{
|
{
|
||||||
stepper_check_endstops();
|
stepper_check_endstops();
|
||||||
|
@ -1066,7 +1056,7 @@ FORCE_INLINE void isr() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TMC2130
|
#ifdef TMC2130
|
||||||
tmc2130_st_isr(LastStepMask);
|
tmc2130_st_isr();
|
||||||
#endif //TMC2130
|
#endif //TMC2130
|
||||||
|
|
||||||
//WRITE_NC(LOGIC_ANALYZER_CH0, false);
|
//WRITE_NC(LOGIC_ANALYZER_CH0, false);
|
||||||
|
@ -1421,7 +1411,6 @@ void babystep(const uint8_t axis,const bool direction)
|
||||||
|
|
||||||
//perform step
|
//perform step
|
||||||
WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
|
WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
|
||||||
LastStepMask |= X_AXIS_MASK;
|
|
||||||
#ifdef DEBUG_XSTEP_DUP_PIN
|
#ifdef DEBUG_XSTEP_DUP_PIN
|
||||||
WRITE(DEBUG_XSTEP_DUP_PIN,!INVERT_X_STEP_PIN);
|
WRITE(DEBUG_XSTEP_DUP_PIN,!INVERT_X_STEP_PIN);
|
||||||
#endif //DEBUG_XSTEP_DUP_PIN
|
#endif //DEBUG_XSTEP_DUP_PIN
|
||||||
|
@ -1445,7 +1434,6 @@ void babystep(const uint8_t axis,const bool direction)
|
||||||
|
|
||||||
//perform step
|
//perform step
|
||||||
WRITE(Y_STEP_PIN, !INVERT_Y_STEP_PIN);
|
WRITE(Y_STEP_PIN, !INVERT_Y_STEP_PIN);
|
||||||
LastStepMask |= Y_AXIS_MASK;
|
|
||||||
#ifdef DEBUG_YSTEP_DUP_PIN
|
#ifdef DEBUG_YSTEP_DUP_PIN
|
||||||
WRITE(DEBUG_YSTEP_DUP_PIN,!INVERT_Y_STEP_PIN);
|
WRITE(DEBUG_YSTEP_DUP_PIN,!INVERT_Y_STEP_PIN);
|
||||||
#endif //DEBUG_YSTEP_DUP_PIN
|
#endif //DEBUG_YSTEP_DUP_PIN
|
||||||
|
@ -1472,7 +1460,6 @@ void babystep(const uint8_t axis,const bool direction)
|
||||||
#endif
|
#endif
|
||||||
//perform step
|
//perform step
|
||||||
WRITE(Z_STEP_PIN, !INVERT_Z_STEP_PIN);
|
WRITE(Z_STEP_PIN, !INVERT_Z_STEP_PIN);
|
||||||
LastStepMask |= Z_AXIS_MASK;
|
|
||||||
#ifdef Z_DUAL_STEPPER_DRIVERS
|
#ifdef Z_DUAL_STEPPER_DRIVERS
|
||||||
WRITE(Z2_STEP_PIN, !INVERT_Z_STEP_PIN);
|
WRITE(Z2_STEP_PIN, !INVERT_Z_STEP_PIN);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -235,7 +235,7 @@ uint8_t tmc2130_sample_diag()
|
||||||
|
|
||||||
extern bool is_usb_printing;
|
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;
|
if (tmc2130_mode == TMC2130_MODE_SILENT || tmc2130_sg_stop_on_crash == false) return;
|
||||||
uint8_t crash = 0;
|
uint8_t crash = 0;
|
||||||
|
|
|
@ -53,7 +53,7 @@ extern tmc2130_chopper_config_t tmc2130_chopper_config[4];
|
||||||
//initialize tmc2130
|
//initialize tmc2130
|
||||||
extern void tmc2130_init();
|
extern void tmc2130_init();
|
||||||
//check diag pins (called from stepper isr)
|
//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)
|
//update stall guard (called from st_synchronize inside the loop)
|
||||||
extern bool tmc2130_update_sg();
|
extern bool tmc2130_update_sg();
|
||||||
//temperature watching (called from )
|
//temperature watching (called from )
|
||||||
|
|
Loading…
Reference in a new issue