WiringPi: Ignore case when identifying a board

Signed-off-by: Yang Deokgyu <secugyu@gmail.com>
Change-Id: Ia9edd472026f45ad9b9b923f652ca27d43d51f19
This commit is contained in:
Yang Deokgyu
2020-01-02 12:15:25 +09:00
parent 51d37029a1
commit 2363e5811b

View File

@@ -336,7 +336,7 @@ int piGpioLayout (void)
if (wiringPiDebug)
printf ("piGpioLayout: Hardware: %s\n", line) ;
if (!(strstr (line, "ODROID"))) {
if (!(strcasestr (line, "odroid"))) {
if ((dtFd = fopen("/sys/firmware/devicetree/base/model", "r")) != NULL) {
if (fgets(line, 30, dtFd) == NULL)
wiringPiFailure (WPI_FATAL, "Unable to read /sys/firmware/devicetree/base/model");
@@ -344,7 +344,7 @@ int piGpioLayout (void)
if (wiringPiDebug)
printf ("piGpioLayout: devicetree/base/model: %s\n", line) ;
if (!(strstr (line, "Odroid")))
if (!(strcasestr (line, "odroid")))
wiringPiFailure (WPI_FATAL, "** This board is not ODROID. **") ;
} else {
wiringPiFailure (WPI_FATAL, "Unable to open /sys/firmware/devicetree/base/model") ;