Surround all macro parameters with ()
All the macro arguments that are user supplied, or potentially, wrap properly in () as good practice. Probably missed one or two, and a lot of them are possibly unnecessary, but it's straightforward to just do it always. Fixes github issue #321
This commit is contained in:
@@ -85,7 +85,7 @@ LGPL License Terms @ref lgpl_license
|
||||
/* --- GPIO registers ------------------------------------------------------ */
|
||||
|
||||
/* GPIO data direction register (GPIOn_DIR) */
|
||||
#define GPIO_DIR(port) MMIO32(port + 0x00)
|
||||
#define GPIO_DIR(port) MMIO32((port) + 0x00)
|
||||
#define GPIO0_DIR GPIO_DIR(GPIO0)
|
||||
#define GPIO1_DIR GPIO_DIR(GPIO1)
|
||||
#define GPIO2_DIR GPIO_DIR(GPIO2)
|
||||
@@ -93,7 +93,7 @@ LGPL License Terms @ref lgpl_license
|
||||
#define GPIO4_DIR GPIO_DIR(GPIO4)
|
||||
|
||||
/* GPIO fast mask register (GPIOn_DIR) */
|
||||
#define GPIO_MASK(port) MMIO32(port + 0x10)
|
||||
#define GPIO_MASK(port) MMIO32((port) + 0x10)
|
||||
#define GPIO0_MASK GPIO_MASK(GPIO0)
|
||||
#define GPIO1_MASK GPIO_MASK(GPIO1)
|
||||
#define GPIO2_MASK GPIO_MASK(GPIO2)
|
||||
@@ -101,7 +101,7 @@ LGPL License Terms @ref lgpl_license
|
||||
#define GPIO4_MASK GPIO_MASK(GPIO4)
|
||||
|
||||
/* GPIO port pin value register (GPIOn_PIN) */
|
||||
#define GPIO_PIN(port) MMIO32(port + 0x14)
|
||||
#define GPIO_PIN(port) MMIO32((port) + 0x14)
|
||||
#define GPIO0_PIN GPIO_PIN(GPIO0)
|
||||
#define GPIO1_PIN GPIO_PIN(GPIO1)
|
||||
#define GPIO2_PIN GPIO_PIN(GPIO2)
|
||||
@@ -109,7 +109,7 @@ LGPL License Terms @ref lgpl_license
|
||||
#define GPIO4_PIN GPIO_PIN(GPIO4)
|
||||
|
||||
/* GPIO port output set register (GPIOn_SET) */
|
||||
#define GPIO_SET(port) MMIO32(port + 0x18)
|
||||
#define GPIO_SET(port) MMIO32((port) + 0x18)
|
||||
#define GPIO0_SET GPIO_SET(GPIO0)
|
||||
#define GPIO1_SET GPIO_SET(GPIO1)
|
||||
#define GPIO2_SET GPIO_SET(GPIO2)
|
||||
@@ -117,7 +117,7 @@ LGPL License Terms @ref lgpl_license
|
||||
#define GPIO4_SET GPIO_SET(GPIO4)
|
||||
|
||||
/* GPIO port output clear register (GPIOn_CLR) */
|
||||
#define GPIO_CLR(port) MMIO32(port + 0x1C)
|
||||
#define GPIO_CLR(port) MMIO32((port) + 0x1C)
|
||||
#define GPIO0_CLR GPIO_CLR(GPIO0)
|
||||
#define GPIO1_CLR GPIO_CLR(GPIO1)
|
||||
#define GPIO2_CLR GPIO_CLR(GPIO2)
|
||||
|
||||
Reference in New Issue
Block a user