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).
This commit is contained in:
Markus Hitter 2016-02-02 20:07:21 +01:00
parent bed5dcb210
commit 35191306d7
2 changed files with 19 additions and 19 deletions

14
pinio.c
View File

@ -16,11 +16,11 @@ void pinio_init(void) {
SET_OUTPUT(X_DIR_PIN); WRITE(X_DIR_PIN, 0); SET_OUTPUT(X_DIR_PIN); WRITE(X_DIR_PIN, 0);
#ifdef X_MIN_PIN #ifdef X_MIN_PIN
SET_INPUT(X_MIN_PIN); SET_INPUT(X_MIN_PIN);
PULLUP_OFF(X_MIN_PIN); PULL_OFF(X_MIN_PIN);
#endif #endif
#ifdef X_MAX_PIN #ifdef X_MAX_PIN
SET_INPUT(X_MAX_PIN); SET_INPUT(X_MAX_PIN);
PULLUP_OFF(X_MAX_PIN); PULL_OFF(X_MAX_PIN);
#endif #endif
/// Y Stepper. /// Y Stepper.
@ -28,11 +28,11 @@ void pinio_init(void) {
SET_OUTPUT(Y_DIR_PIN); WRITE(Y_DIR_PIN, 0); SET_OUTPUT(Y_DIR_PIN); WRITE(Y_DIR_PIN, 0);
#ifdef Y_MIN_PIN #ifdef Y_MIN_PIN
SET_INPUT(Y_MIN_PIN); SET_INPUT(Y_MIN_PIN);
PULLUP_OFF(Y_MIN_PIN); PULL_OFF(Y_MIN_PIN);
#endif #endif
#ifdef Y_MAX_PIN #ifdef Y_MAX_PIN
SET_INPUT(Y_MAX_PIN); SET_INPUT(Y_MAX_PIN);
PULLUP_OFF(Y_MAX_PIN); PULL_OFF(Y_MAX_PIN);
#endif #endif
/// Z Stepper. /// Z Stepper.
@ -42,11 +42,11 @@ void pinio_init(void) {
#endif #endif
#ifdef Z_MIN_PIN #ifdef Z_MIN_PIN
SET_INPUT(Z_MIN_PIN); SET_INPUT(Z_MIN_PIN);
PULLUP_OFF(Z_MIN_PIN); PULL_OFF(Z_MIN_PIN);
#endif #endif
#ifdef Z_MAX_PIN #ifdef Z_MAX_PIN
SET_INPUT(Z_MAX_PIN); SET_INPUT(Z_MAX_PIN);
PULLUP_OFF(Z_MAX_PIN); PULL_OFF(Z_MAX_PIN);
#endif #endif
#if defined E_STEP_PIN && defined E_DIR_PIN #if defined E_STEP_PIN && defined E_DIR_PIN
@ -146,7 +146,7 @@ void power_off() {
#ifdef PS_ON_PIN #ifdef PS_ON_PIN
SET_INPUT(PS_ON_PIN); SET_INPUT(PS_ON_PIN);
PULLUP_OFF(PS_ON_PIN); PULL_OFF(PS_ON_PIN);
#endif #endif
#ifdef PS_MOSFET_PIN #ifdef PS_MOSFET_PIN

24
pinio.h
View File

@ -52,7 +52,7 @@
/// Enable pullup resistor. /// Enable pullup resistor.
#define _PULLUP_ON(IO) _WRITE(IO, 1) #define _PULLUP_ON(IO) _WRITE(IO, 1)
/// Disable pullup resistor. /// Disable pullup resistor.
#define _PULLUP_OFF(IO) _WRITE(IO, 0) #define _PULL_OFF(IO) _WRITE(IO, 0)
#elif defined __ARMEL__ #elif defined __ARMEL__
@ -94,8 +94,8 @@
do { \ do { \
LPC_IOCON->IO ## _CMSIS = (IO ## _OUTPUT | IO_MODEMASK_PULLUP); \ LPC_IOCON->IO ## _CMSIS = (IO ## _OUTPUT | IO_MODEMASK_PULLUP); \
} while (0) } while (0)
/// Disable pullup resistor. /// Disable pull resistor.
#define _PULLUP_OFF(IO) \ #define _PULL_OFF(IO) \
do { \ do { \
LPC_IOCON->IO ## _CMSIS = (IO ## _OUTPUT | IO_MODEMASK_INACTIVE); \ LPC_IOCON->IO ## _CMSIS = (IO ## _OUTPUT | IO_MODEMASK_INACTIVE); \
} while (0) } while (0)
@ -109,7 +109,7 @@
void _SET_OUTPUT(pin_t pin); void _SET_OUTPUT(pin_t pin);
void _SET_INPUT(pin_t pin); void _SET_INPUT(pin_t pin);
#define _PULLUP_ON(IO) _WRITE(IO, 1) #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 */ #endif /* __AVR__, __ARMEL__, SIMULATOR */
@ -129,8 +129,8 @@
/// Enable pullup resistor. /// Enable pullup resistor.
#define PULLUP_ON(IO) _PULLUP_ON(IO) #define PULLUP_ON(IO) _PULLUP_ON(IO)
/// Disable pullup resistor. /// Disable pull resistor.
#define PULLUP_OFF(IO) _PULLUP_OFF(IO) #define PULL_OFF(IO) _PULL_OFF(IO)
/* /*
Power Power
@ -377,22 +377,22 @@ static void endstops_off(void) __attribute__ ((always_inline));
inline void endstops_off(void) { inline void endstops_off(void) {
#ifdef USE_INTERNAL_PULLUPS #ifdef USE_INTERNAL_PULLUPS
#ifdef X_MIN_PIN #ifdef X_MIN_PIN
PULLUP_OFF(X_MIN_PIN); PULL_OFF(X_MIN_PIN);
#endif #endif
#ifdef X_MAX_PIN #ifdef X_MAX_PIN
PULLUP_OFF(X_MAX_PIN); PULL_OFF(X_MAX_PIN);
#endif #endif
#ifdef Y_MIN_PIN #ifdef Y_MIN_PIN
PULLUP_OFF(Y_MIN_PIN); PULL_OFF(Y_MIN_PIN);
#endif #endif
#ifdef Y_MAX_PIN #ifdef Y_MAX_PIN
PULLUP_OFF(Y_MAX_PIN); PULL_OFF(Y_MAX_PIN);
#endif #endif
#ifdef Z_MIN_PIN #ifdef Z_MIN_PIN
PULLUP_OFF(Z_MIN_PIN); PULL_OFF(Z_MIN_PIN);
#endif #endif
#ifdef Z_MAX_PIN #ifdef Z_MAX_PIN
PULLUP_OFF(Z_MAX_PIN); PULL_OFF(Z_MAX_PIN);
#endif #endif
#endif #endif
} }