From 728ac129854b4869828ced685228c251750a5af2 Mon Sep 17 00:00:00 2001 From: "roman.bessmertnyi" Date: Sun, 16 Dec 2018 18:09:17 +0200 Subject: [PATCH] Changed to work with Orange Pi Zero Plus --- wiringPi/wiringPi.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c index 111977b..46e5446 100644 --- a/wiringPi/wiringPi.c +++ b/wiringPi/wiringPi.c @@ -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) @@ -1417,7 +1419,8 @@ 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. @@ -1425,9 +1428,9 @@ void piBoardId (int *model, int *rev, int *mem, int *maker, int *overVolted) 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) ;