Reinstate the nop instruction as delay in non-DEDGE

When TMC2130_MINIMUM_PULSE is 0 a minimum delay is implied.
In this case, use a single "nop" instruction.
This commit is contained in:
Yuri D'Elia 2021-01-26 19:37:14 +01:00
parent d3734b02cc
commit a9625747db
2 changed files with 5 additions and 2 deletions

View File

@ -83,7 +83,8 @@ uint16_t SP_min = 0x21FF;
#endif
#ifdef TMC2130_DEDGE_STEPPING
static_assert(TMC2130_MINIMUM_PULSE == 0, "DEDGE requires/implies TMC2130_MINIMUM_PULSE == 0");
static_assert(TMC2130_MINIMUM_DELAY 1, // this will fail to compile when non-empty
"DEDGE implies/requires an empty TMC2130_MINIMUM_DELAY");
#define STEP_NC_HI(axis) TOGGLE(_STEP_PIN_##axis)
#define STEP_NC_LO(axis) //NOP
#else

View File

@ -33,8 +33,10 @@ extern uint8_t tmc2130_sg_homing_axes_mask;
#define TMC2130_SET_DIR_DELAY 20 // minimum delay after setting direction in uS
#define TMC2130_SET_PWR_DELAY 0 // minimum delay after changing pwr mode in uS
#if TMC2130_MINIMUM_PULSE == 0
#ifdef TMC2130_DEDGE_STEPPING
#define TMC2130_MINIMUM_DELAY //NOP
#elif TMC2130_MINIMUM_PULSE == 0
#define TMC2130_MINIMUM_DELAY asm("nop")
#else
#define TMC2130_MINIMUM_DELAY delayMicroseconds(TMC2130_MINIMUM_PULSE)
#endif