From c66bf0a8de6c6a0672505e411d4a14852d36cdb3 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Wed, 22 Jul 2015 15:09:58 +0200 Subject: [PATCH] pinio.h: remove TOGGLE(), GET_INPUT(), GET_OUTPUT() macros. Nowhere used, which unlikely changes in the forseeable future. --- extruder/arduino.h | 14 -------------- pinio.h | 15 --------------- 2 files changed, 29 deletions(-) diff --git a/extruder/arduino.h b/extruder/arduino.h index d63fb55..b8d7737 100644 --- a/extruder/arduino.h +++ b/extruder/arduino.h @@ -29,38 +29,24 @@ #define _READ(IO) (IO ## _RPORT & MASK(IO ## _PIN)) /// write to a pin #define _WRITE(IO, v) do { if (v) { IO ## _WPORT |= MASK(IO ## _PIN); } else { IO ## _WPORT &= ~MASK(IO ## _PIN); }; } while (0) -/// toggle a pin -#define _TOGGLE(IO) do { IO ## _RPORT = MASK(IO ## _PIN); } while (0) /// set pin as input #define _SET_INPUT(IO) do { IO ## _DDR &= ~MASK(IO ## _PIN); } while (0) /// set pin as output #define _SET_OUTPUT(IO) do { IO ## _DDR |= MASK(IO ## _PIN); } while (0) -/// check if pin is an input -#define _GET_INPUT(IO) ((IO ## _DDR & MASK(IO ## _PIN)) == 0) -/// check if pin is an output -#define _GET_OUTPUT(IO) ((IO ## _DDR & MASK(IO ## _PIN)) != 0) - // why double up on these macros? see http://gcc.gnu.org/onlinedocs/cpp/Stringification.html /// Read a pin wrapper #define READ(IO) _READ(IO) /// Write to a pin wrapper #define WRITE(IO, v) _WRITE(IO, v) -/// toggle a pin wrapper -#define TOGGLE(IO) _TOGGLE(IO) /// set pin as input wrapper #define SET_INPUT(IO) _SET_INPUT(IO) /// set pin as output wrapper #define SET_OUTPUT(IO) _SET_OUTPUT(IO) -/// check if pin is an input wrapper -#define GET_INPUT(IO) _GET_INPUT(IO) -/// check if pin is an output wrapper -#define GET_OUTPUT(IO) _GET_OUTPUT(IO) - /* ports and functions diff --git a/pinio.h b/pinio.h index 34a4393..9f2343c 100644 --- a/pinio.h +++ b/pinio.h @@ -36,19 +36,12 @@ if (v) { IO ## _WPORT |= MASK(IO ## _PIN); } \ else { IO ## _WPORT &= ~MASK(IO ## _PIN); } \ } while (0) - /// Toggle a pin. - #define _TOGGLE(IO) do { IO ## _RPORT = MASK(IO ## _PIN); } while (0) /// Set pin as input. #define _SET_INPUT(IO) do { IO ## _DDR &= ~MASK(IO ## _PIN); } while (0) /// Set pin as output. #define _SET_OUTPUT(IO) do { IO ## _DDR |= MASK(IO ## _PIN); } while (0) - /// Check if pin is an input. - #define _GET_INPUT(IO) ((IO ## _DDR & MASK(IO ## _PIN)) == 0) - /// Check if pin is an output. - #define _GET_OUTPUT(IO) ((IO ## _DDR & MASK(IO ## _PIN)) != 0) - #elif defined __ARMEL__ /** @@ -75,7 +68,6 @@ bool _READ(pin_t pin); void _WRITE(pin_t pin, bool on); - void _TOGGLE(pin_t pin); void _SET_OUTPUT(pin_t pin); void _SET_INPUT(pin_t pin); @@ -89,19 +81,12 @@ #define READ(IO) _READ(IO) /// Write to a pin wrapper. #define WRITE(IO, v) _WRITE(IO, v) -/// Toggle a pin wrapper. -#define TOGGLE(IO) _TOGGLE(IO) /// Set pin as input wrapper. #define SET_INPUT(IO) _SET_INPUT(IO) /// Set pin as output wrapper. #define SET_OUTPUT(IO) _SET_OUTPUT(IO) -/// Check if pin is an input wrapper. -#define GET_INPUT(IO) _GET_INPUT(IO) -/// Check if pin is an output wrapper. -#define GET_OUTPUT(IO) _GET_OUTPUT(IO) - /* Power */