Odroid-C1: Fix to keep compatibility with Odroid-C series

which are not having proper model name like "Hardkernel ODROID-C1".

Signed-off-by: Deokgyu Yang <secugyu@gmail.com>
Change-Id: Ifcb1923435f2e7c1500d9ce14bd84b1e7ae0060d
This commit is contained in:
Deokgyu Yang
2020-09-07 17:45:31 +09:00
parent 2557a0a2d1
commit 141eec2565

View File

@@ -435,8 +435,14 @@ int piGpioLayout (void) {
buf = strchr(line, '-'); buf = strchr(line, '-');
modelCodename = buf != NULL ? buf : strchr(line, ' '); modelCodename = buf != NULL ? buf : strchr(line, ' ');
if (modelCodename == NULL) if (modelCodename == NULL) {
if (strcmp(line, "ODROIDC") == 0) {
// Compatibility for Odroid-C series that are not having proper model name
libwiring.model = MODEL_ODROID_C1;
} else {
wiringPiFailure(WPI_FATAL, "** Model string on this board is not well formatted **"); wiringPiFailure(WPI_FATAL, "** Model string on this board is not well formatted **");
}
} else {
modelCodename++; modelCodename++;
libwiring.model = 0; libwiring.model = 0;
@@ -448,6 +454,7 @@ int piGpioLayout (void) {
break; break;
} }
} }
}
switch (libwiring.model) { switch (libwiring.model) {
case MODEL_ODROID_C1: case MODEL_ODROID_C1: