Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed to work with Orange Pi Zero Plus #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions wiringPi/wiringPi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,8 @@ int isH3(void)
FILE *cpuFd ;
char line [120] ;
char *d;
return 1;//by chen

if ((cpuFd = fopen ("/proc/cpuinfo", "r")) == NULL)
piBoardRevOops ("Unable to open /proc/cpuinfo") ;
while (fgets (line, 120, cpuFd) != NULL)
Expand Down Expand Up @@ -1417,17 +1419,18 @@ int piBoardRev (void)
void piBoardId (int *model, int *rev, int *mem, int *maker, int *overVolted)
{
FILE *cpuFd ;
char line [120] ;
// char line [120] ; //edit by chen
char *line="Revision : 0000";
char *c ;

(void)piBoardRev () ; // Call this first to make sure all's OK. Don't care about the result.

if ((cpuFd = fopen ("/proc/cpuinfo", "r")) == NULL)
piBoardRevOops ("Unable to open /proc/cpuinfo") ;

while (fgets (line, 120, cpuFd) != NULL)
if (strncmp (line, "Revision", 8) == 0)
break ;
// while (fgets (line, 120, cpuFd) != NULL)
// if (strncmp (line, "Revision", 8) == 0)
// break ;

fclose (cpuFd) ;

Expand Down