diff --git a/mendel.c b/mendel.c index 36fba3b..8b11734 100644 --- a/mendel.c +++ b/mendel.c @@ -102,8 +102,10 @@ void io_init(void) { WRITE(Z_ENABLE_PIN, 1); SET_OUTPUT(Z_ENABLE_PIN); #endif - WRITE(E_STEP_PIN, 0); SET_OUTPUT(E_STEP_PIN); - WRITE(E_DIR_PIN, 0); SET_OUTPUT(E_DIR_PIN); + #if defined E_STEP_PIN && defined E_DIR_PIN + WRITE(E_STEP_PIN, 0); SET_OUTPUT(E_STEP_PIN); + WRITE(E_DIR_PIN, 0); SET_OUTPUT(E_DIR_PIN); + #endif #ifdef E_ENABLE_PIN WRITE(E_ENABLE_PIN, 1); SET_OUTPUT(E_ENABLE_PIN); #endif diff --git a/pinio.h b/pinio.h index c5ebaf6..3f0691e 100644 --- a/pinio.h +++ b/pinio.h @@ -131,12 +131,18 @@ Z Stepper Extruder */ -#define _e_step(st) WRITE(E_STEP_PIN, st) -#define e_step() _e_step(1); -#ifndef E_INVERT_DIR - #define e_direction(dir) WRITE(E_DIR_PIN, dir) +#if defined E_STEP_PIN && defined E_DIR_PIN + #define _e_step(st) WRITE(E_STEP_PIN, st) + #define e_step() _e_step(1); + #ifndef E_INVERT_DIR + #define e_direction(dir) WRITE(E_DIR_PIN, dir) + #else + #define e_direction(dir) WRITE(E_DIR_PIN, dir^1) + #endif #else - #define e_direction(dir) WRITE(E_DIR_PIN, dir^1) + #define _e_step(st) do { } while (0) + #define e_step() do { } while (0) + #define e_direction(dir) do { } while (0) #endif /*