compiler warning for fsl_gpio.h

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

compiler warning for fsl_gpio.h

ソリューションへジャンプ
1,233件の閲覧回数
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).

ラベル(1)
0 件の賞賛
返信
1 解決策
1,053件の閲覧回数
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 件の賞賛
返信
2 返答(返信)
1,053件の閲覧回数
randylee
Contributor V

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

0 件の賞賛
返信
1,054件の閲覧回数
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 件の賞賛
返信