gpio: change to argument struct to const.
I had hoped this would also shrink the memory usage by letting the compiler put the incoming struct into flash, but it's already doing that. Signed-off-by: Michael Hope <mlhx@google.com>
This commit is contained in:
parent
11a4622a46
commit
01276ca47b
3 changed files with 3 additions and 3 deletions
|
@ -113,6 +113,6 @@ static inline void digitalToggle(GPIO_TypeDef *p, uint16_t i) { p->ODR ^= i; }
|
|||
static inline uint16_t digitalIn(GPIO_TypeDef *p, uint16_t i) {return p->IDR & i; }
|
||||
#endif
|
||||
|
||||
void gpioInit(GPIO_TypeDef *gpio, gpio_config_t *config);
|
||||
void gpioInit(GPIO_TypeDef *gpio, const gpio_config_t *config);
|
||||
void gpioExtiLineConfig(uint8_t portsrc, uint8_t pinsrc);
|
||||
void gpioPinRemapConfig(uint32_t remap, bool enable);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "gpio.h"
|
||||
|
||||
void gpioInit(GPIO_TypeDef *gpio, gpio_config_t *config)
|
||||
void gpioInit(GPIO_TypeDef *gpio, const gpio_config_t *config)
|
||||
{
|
||||
uint32_t pinpos;
|
||||
for (pinpos = 0; pinpos < 16; pinpos++) {
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
//#define GPIO_Speed_2MHz GPIO_Speed_Level_2 Medium Speed:2MHz
|
||||
//#define GPIO_Speed_50MHz GPIO_Speed_Level_3 High Speed:50MHz
|
||||
|
||||
void gpioInit(GPIO_TypeDef *gpio, gpio_config_t *config)
|
||||
void gpioInit(GPIO_TypeDef *gpio, const gpio_config_t *config)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue