Fix parentheses in macros

This commit is contained in:
Mario Hüttel 2020-05-11 21:52:11 +02:00
parent 13bdd6b8eb
commit b9857745b1

View File

@ -25,6 +25,7 @@
#define PUPDR_DELETE(pin) ~(0x3U << ((pin) * 2))
#define OUTPUT(pin) (0x01U << ((pin) * 2))
#define PULLUP(pin) (0x1U << ((pin)* 2))
#define PULLDOWN(pin) (0x2U << ((pin)* 2))
#define ALTFUNC(pin) ((0x2) << ((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)