動作環境
OS: Ubuntu 18.04 LTS
基板: LPCXpresso54628
IDE: MCUXpresso IDE v11.0.1 [Build 2563] [2019-09-01]
関連
疑問点
-
#include "fsl_gpio.h"
があるプロジェクトとないプロジェクトがある- ある: import SDK example(s)...で生成したプロジェクト
- ない: 新規プロジェクト
- ない方であっても、GPIO_PortInit()などの関数を使用してもエラーにはならない
- どこからインクルードしているのだろう
fsl_gpio.hをインクルードしているファイル
プロジェクトのトップフォルダに移動し、下記を実行した。
$ grep -r fsl_gpio.h | grep include
source/gpio_led_output.c:#include "fsl_gpio.h"
drivers/fsl_gpio.c:#include "fsl_gpio.h"
board/board.h:#include "fsl_gpio.h"
board.h
からインクルードされている。
このファイルは上記の二者ともにインクルードしている。
SDK exampleの#include "fsl_gpio.h"
はなくても動く。明示的にしておきたかったのかも。
関連
1.) The wizzard asks for driver inclusion. Why aren't the chosen drivers not automatically included, e.g. #include "fsl_gpio.h" in main.c when I chose the GPIO driver in the wizzard?
答え: board.hからインクルードされているから不要
ということなのかもしれない。