From 35191306d78072ab37989bb77255e0e07d3b0df6 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Tue, 2 Feb 2016 20:07:21 +0100 Subject: [PATCH] pinio.c/.h: rename PULLUP_OFF() to PULL_OFF(). Before too long we'll support pulldown resistors, so the name becomes ambiguous (PULLDOWN_OFF() would also turn off a pullup). --- pinio.c | 14 +++++++------- pinio.h | 24 ++++++++++++------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pinio.c b/pinio.c index db4f72a..87c71d5 100644 --- a/pinio.c +++ b/pinio.c @@ -16,11 +16,11 @@ void pinio_init(void) { SET_OUTPUT(X_DIR_PIN); WRITE(X_DIR_PIN, 0); #ifdef X_MIN_PIN SET_INPUT(X_MIN_PIN); - PULLUP_OFF(X_MIN_PIN); + PULL_OFF(X_MIN_PIN); #endif #ifdef X_MAX_PIN SET_INPUT(X_MAX_PIN); - PULLUP_OFF(X_MAX_PIN); + PULL_OFF(X_MAX_PIN); #endif /// Y Stepper. @@ -28,11 +28,11 @@ void pinio_init(void) { SET_OUTPUT(Y_DIR_PIN); WRITE(Y_DIR_PIN, 0); #ifdef Y_MIN_PIN SET_INPUT(Y_MIN_PIN); - PULLUP_OFF(Y_MIN_PIN); + PULL_OFF(Y_MIN_PIN); #endif #ifdef Y_MAX_PIN SET_INPUT(Y_MAX_PIN); - PULLUP_OFF(Y_MAX_PIN); + PULL_OFF(Y_MAX_PIN); #endif /// Z Stepper. @@ -42,11 +42,11 @@ void pinio_init(void) { #endif #ifdef Z_MIN_PIN SET_INPUT(Z_MIN_PIN); - PULLUP_OFF(Z_MIN_PIN); + PULL_OFF(Z_MIN_PIN); #endif #ifdef Z_MAX_PIN SET_INPUT(Z_MAX_PIN); - PULLUP_OFF(Z_MAX_PIN); + PULL_OFF(Z_MAX_PIN); #endif #if defined E_STEP_PIN && defined E_DIR_PIN @@ -146,7 +146,7 @@ void power_off() { #ifdef PS_ON_PIN SET_INPUT(PS_ON_PIN); - PULLUP_OFF(PS_ON_PIN); + PULL_OFF(PS_ON_PIN); #endif #ifdef PS_MOSFET_PIN diff --git a/pinio.h b/pinio.h index cd3e531..d5d4d96 100644 --- a/pinio.h +++ b/pinio.h @@ -52,7 +52,7 @@ /// Enable pullup resistor. #define _PULLUP_ON(IO) _WRITE(IO, 1) /// Disable pullup resistor. - #define _PULLUP_OFF(IO) _WRITE(IO, 0) + #define _PULL_OFF(IO) _WRITE(IO, 0) #elif defined __ARMEL__ @@ -94,8 +94,8 @@ do { \ LPC_IOCON->IO ## _CMSIS = (IO ## _OUTPUT | IO_MODEMASK_PULLUP); \ } while (0) - /// Disable pullup resistor. - #define _PULLUP_OFF(IO) \ + /// Disable pull resistor. + #define _PULL_OFF(IO) \ do { \ LPC_IOCON->IO ## _CMSIS = (IO ## _OUTPUT | IO_MODEMASK_INACTIVE); \ } while (0) @@ -109,7 +109,7 @@ void _SET_OUTPUT(pin_t pin); void _SET_INPUT(pin_t pin); #define _PULLUP_ON(IO) _WRITE(IO, 1) - #define _PULLUP_OFF(IO) _WRITE(IO, 0) + #define _PULL_OFF(IO) _WRITE(IO, 0) #endif /* __AVR__, __ARMEL__, SIMULATOR */ @@ -129,8 +129,8 @@ /// Enable pullup resistor. #define PULLUP_ON(IO) _PULLUP_ON(IO) -/// Disable pullup resistor. -#define PULLUP_OFF(IO) _PULLUP_OFF(IO) +/// Disable pull resistor. +#define PULL_OFF(IO) _PULL_OFF(IO) /* Power @@ -377,22 +377,22 @@ static void endstops_off(void) __attribute__ ((always_inline)); inline void endstops_off(void) { #ifdef USE_INTERNAL_PULLUPS #ifdef X_MIN_PIN - PULLUP_OFF(X_MIN_PIN); + PULL_OFF(X_MIN_PIN); #endif #ifdef X_MAX_PIN - PULLUP_OFF(X_MAX_PIN); + PULL_OFF(X_MAX_PIN); #endif #ifdef Y_MIN_PIN - PULLUP_OFF(Y_MIN_PIN); + PULL_OFF(Y_MIN_PIN); #endif #ifdef Y_MAX_PIN - PULLUP_OFF(Y_MAX_PIN); + PULL_OFF(Y_MAX_PIN); #endif #ifdef Z_MIN_PIN - PULLUP_OFF(Z_MIN_PIN); + PULL_OFF(Z_MIN_PIN); #endif #ifdef Z_MAX_PIN - PULLUP_OFF(Z_MAX_PIN); + PULL_OFF(Z_MAX_PIN); #endif #endif }