WiringPi: Ignore case when identifying a board
Signed-off-by: Yang Deokgyu <secugyu@gmail.com> Change-Id: Ia9edd472026f45ad9b9b923f652ca27d43d51f19
This commit is contained in:
@@ -336,7 +336,7 @@ int piGpioLayout (void)
|
|||||||
if (wiringPiDebug)
|
if (wiringPiDebug)
|
||||||
printf ("piGpioLayout: Hardware: %s\n", line) ;
|
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 ((dtFd = fopen("/sys/firmware/devicetree/base/model", "r")) != NULL) {
|
||||||
if (fgets(line, 30, dtFd) == NULL)
|
if (fgets(line, 30, dtFd) == NULL)
|
||||||
wiringPiFailure (WPI_FATAL, "Unable to read /sys/firmware/devicetree/base/model");
|
wiringPiFailure (WPI_FATAL, "Unable to read /sys/firmware/devicetree/base/model");
|
||||||
@@ -344,7 +344,7 @@ int piGpioLayout (void)
|
|||||||
if (wiringPiDebug)
|
if (wiringPiDebug)
|
||||||
printf ("piGpioLayout: devicetree/base/model: %s\n", line) ;
|
printf ("piGpioLayout: devicetree/base/model: %s\n", line) ;
|
||||||
|
|
||||||
if (!(strstr (line, "Odroid")))
|
if (!(strcasestr (line, "odroid")))
|
||||||
wiringPiFailure (WPI_FATAL, "** This board is not ODROID. **") ;
|
wiringPiFailure (WPI_FATAL, "** This board is not ODROID. **") ;
|
||||||
} else {
|
} else {
|
||||||
wiringPiFailure (WPI_FATAL, "Unable to open /sys/firmware/devicetree/base/model") ;
|
wiringPiFailure (WPI_FATAL, "Unable to open /sys/firmware/devicetree/base/model") ;
|
||||||
|
|||||||
Reference in New Issue
Block a user