fixed some defines that were spitting errors

This commit is contained in:
Michael Moon 2010-10-10 11:21:16 +11:00
parent 3898626534
commit 9b894de669
1 changed files with 3 additions and 3 deletions

View File

@ -19,10 +19,10 @@
#define _READ(IO) (IO ## _RPORT & MASK(IO ## _PIN)) #define _READ(IO) (IO ## _RPORT & MASK(IO ## _PIN))
#define _WRITE(IO, v) do { if (v) { IO ## _WPORT |= MASK(IO ## _PIN); } else { IO ## _WPORT &= ~MASK(IO ## _PIN); }; } while (0) #define _WRITE(IO, v) do { if (v) { IO ## _WPORT |= MASK(IO ## _PIN); } else { IO ## _WPORT &= ~MASK(IO ## _PIN); }; } while (0)
#define _TOGGLE(IO) do { IO ## _RPORT = MASK(IO ## _PIN) } while (0) #define _TOGGLE(IO) do { IO ## _RPORT = MASK(IO ## _PIN); } while (0)
#define _SET_INPUT(IO) do { IO ## _DDR &= ~MASK(IO ## _PIN) } while (0) #define _SET_INPUT(IO) do { IO ## _DDR &= ~MASK(IO ## _PIN); } while (0)
#define _SET_OUTPUT(IO) do { IO ## _DDR |= MASK(IO ## _PIN) } while (0) #define _SET_OUTPUT(IO) do { IO ## _DDR |= MASK(IO ## _PIN); } while (0)
#define _GET_INPUT(IO) ((IO ## _DDR & MASK(IO ## _PIN)) == 0) #define _GET_INPUT(IO) ((IO ## _DDR & MASK(IO ## _PIN)) == 0)
#define _GET_OUTPUT(IO) ((IO ## _DDR & MASK(IO ## _PIN)) != 0) #define _GET_OUTPUT(IO) ((IO ## _DDR & MASK(IO ## _PIN)) != 0)