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,17 +435,24 @@ 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) {
wiringPiFailure(WPI_FATAL, "** Model string on this board is not well formatted **"); if (strcmp(line, "ODROIDC") == 0) {
modelCodename++; // 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 **");
}
} else {
modelCodename++;
libwiring.model = 0; libwiring.model = 0;
for (i = 1; i <= sizeOfAssignedModelNames; i++) { for (i = 1; i <= sizeOfAssignedModelNames; i++) {
model = strstr(piModelNames[i], "-"); model = strstr(piModelNames[i], "-");
if (strcasestr(model, modelCodename) != NULL) { if (strcasestr(model, modelCodename) != NULL) {
libwiring.model = i; libwiring.model = i;
break; break;
}
} }
} }