compiler warning for fsl_gpio.h

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

compiler warning for fsl_gpio.h

Jump to solution
827 Views
randylee
Contributor V

Using MCUexpresso 10.2 I get a compiler warning message:

../drivers/fsl_gpio.h:161:20: note: expected 'GPIO_Type * {aka struct <anonymous> *}' but argument is of type 'PORT_Type * {aka struct <anonymous> *}'
 static inline void GPIO_PinWrite(GPIO_Type *base, uint32_t pin, uint8_t output)

when using e.g. GPIO_PinWrite(BOARD_PWR_ON_PORT, BOARD_PWR_ON_PIN, 0);

pinmux.h has:

#define BOARD_PWR_ON_PORT PORTC /*!<@brief PORT device name: PORTC */

MK22FN512.h has:

/** Peripheral PORTC base address */
#define PORTC_BASE                               (0x4004B000u)
/** Peripheral PORTC base pointer */
#define PORTC                                    ((PORT_Type *)PORTC_BASE)

so somewhere along the line the compiler is getting plenty confused by something.  Since it's a warning, I'm only a little annoyed by it, but I really don't want that warning in there (and there are a lot of those kinds of warnings).

Labels (1)
0 Kudos
1 Solution
647 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello RANDY LEE,

Please change

#define BOARD_PWR_ON_PORT PORTC

to

#define BOARD_PWR_ON_PORT GPIOC 

the warning will be disappear. 

From the definition of function GPIO_PinWrite:

static inline void GPIO_PinWrite(GPIO_Type *base, uint32_t pin, uint8_t output)

the parameter type is GPIO_Type * .

Hope it helps,


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
647 Views
randylee
Contributor V

thanx...  yes my eyes are playing tricks on me apparently. Sorry...

0 Kudos
648 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello RANDY LEE,

Please change

#define BOARD_PWR_ON_PORT PORTC

to

#define BOARD_PWR_ON_PORT GPIOC 

the warning will be disappear. 

From the definition of function GPIO_PinWrite:

static inline void GPIO_PinWrite(GPIO_Type *base, uint32_t pin, uint8_t output)

the parameter type is GPIO_Type * .

Hope it helps,


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos