From ea4fdcf26a7163294a82bc8ebdfb5d35cac7dc5c Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Fri, 4 Mar 2011 00:14:19 -0800 Subject: [PATCH] mendel.c, pinio.c: Make Z axes optional. --- mendel.c | 6 ++++-- pinio.h | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mendel.c b/mendel.c index 0f200af..51efcb1 100644 --- a/mendel.c +++ b/mendel.c @@ -80,8 +80,10 @@ void io_init(void) { WRITE(Y_ENABLE_PIN, 1); SET_OUTPUT(Y_ENABLE_PIN); #endif - WRITE(Z_STEP_PIN, 0); SET_OUTPUT(Z_STEP_PIN); - WRITE(Z_DIR_PIN, 0); SET_OUTPUT(Z_DIR_PIN); + #if defined Z_STEP_PIN && defined Z_DIR_PIN + WRITE(Z_STEP_PIN, 0); SET_OUTPUT(Z_STEP_PIN); + WRITE(Z_DIR_PIN, 0); SET_OUTPUT(Z_DIR_PIN); + #endif #ifdef Z_MIN_PIN SET_INPUT(Z_MIN_PIN); #ifdef USE_INTERNAL_PULLUPS diff --git a/pinio.h b/pinio.h index 5598089..0b5e999 100644 --- a/pinio.h +++ b/pinio.h @@ -101,6 +101,7 @@ Y Stepper Z Stepper */ +#if defined Z_STEP_PIN && defined Z_DIR_PIN #define _z_step(st) WRITE(Z_STEP_PIN, st) #define z_step() _z_step(1); #ifndef Z_INVERT_DIR @@ -108,6 +109,11 @@ Z Stepper #else #define z_direction(dir) WRITE(Z_DIR_PIN, dir^1) #endif +#else +#define _z_step(x) +#define z_step() +#define z_direction(x) +#endif #ifdef Z_MIN_PIN #ifndef Z_INVERT_MIN #define z_min() (READ(Z_MIN_PIN)?1:0)