Fix parentheses in macros
This commit is contained in:
parent
13bdd6b8eb
commit
b9857745b1
@ -25,6 +25,7 @@
|
|||||||
#define PUPDR_DELETE(pin) ~(0x3U << ((pin) * 2))
|
#define PUPDR_DELETE(pin) ~(0x3U << ((pin) * 2))
|
||||||
#define OUTPUT(pin) (0x01U << ((pin) * 2))
|
#define OUTPUT(pin) (0x01U << ((pin) * 2))
|
||||||
#define PULLUP(pin) (0x1U << ((pin)* 2))
|
#define PULLUP(pin) (0x1U << ((pin)* 2))
|
||||||
|
#define PULLDOWN(pin) (0x2U << ((pin)* 2))
|
||||||
#define ALTFUNC(pin) ((0x2) << ((pin) * 2))
|
#define ALTFUNC(pin) ((0x2) << ((pin) * 2))
|
||||||
#define PINMASK(pin) ((0x3) << ((pin) * 2))
|
#define PINMASK(pin) ((0x3) << ((pin) * 2))
|
||||||
#define SETAF(PORT,PIN,AF) PORT->AFR[((PIN) < 8 ? 0 : 1)] |= (AF) << (((PIN) < 8 ? (PIN) : ((PIN) - 8)) * 4)
|
#define SETAF(PORT,PIN,AF) PORT->AFR[((PIN) < 8 ? 0 : 1)] |= (AF) << (((PIN) < 8 ? (PIN) : ((PIN) - 8)) * 4)
|
||||||
|
Loading…
Reference in New Issue
Block a user