AnsweredAssumed Answered

compiler warning for fsl_gpio.h

Question asked by RANDY LEE on Aug 17, 2018
Latest reply on Aug 22, 2018 by RANDY LEE

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).

Outcomes