Skip to content

Commit

Permalink
Improved checkPiModel() for recognition of pi 3b+
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvdp committed Mar 26, 2018
1 parent 0d8061d commit 5aad09b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Binary file modified dgtpicom
Binary file not shown.
13 changes: 6 additions & 7 deletions dgtpicom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1588,16 +1588,15 @@ int checkPiModel() {
// looking for the revision....
while (fgets (line, 120, cpuFd) != NULL)
if (strncmp (line, "Revision", 8) == 0) {
// See if it's BCM2708 or BCM2709
if ( strstr(line, "a01041") != NULL || strstr(line,"a21041") != NULL ) {
if ( line[13] == '2' ) { // BCM2837
fclose(cpuFd);
return 2; // PI 2
} else if ( strstr(line, "a02082") != NULL || strstr(line,"a22082") != NULL ) {
return 3; // PI 3b(+)
} else if ( line[13] == '1' ) { // BCM2836
fclose(cpuFd);
return 3; // PI 3
} else {
return 2; // PI 2b
} else { // BCM2835
fclose(cpuFd);
return 1; // PI B+
return 1; // PI a, b, zero (+)
}
}
fclose(cpuFd);
Expand Down
Binary file modified dgtpicom.so
Binary file not shown.

0 comments on commit 5aad09b

Please sign in to comment.