Pārlūkot izejas kodu

support bookworm

No Hardware line in /proc/cpuinfo for Bookworm (especially for Raspberry Pi 4 or later), which cause gpio failure.
    Add trying to read model name from /sys/firmware/devicetree/base/model for model name when failed to fetch Hardware line from /proc/cpuinfo
pull/257/head
gcd0318 pirms 5 mēnešiem
vecāks
revīzija
960fee52bf
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. +5
    -1
      wiringPi/wiringPiLegacy.c

+ 5
- 1
wiringPi/wiringPiLegacy.c Parādīt failu

@@ -80,7 +80,11 @@ int piGpioLayoutLegacy (void)
if (strncmp (line, "Hardware", 8) == 0)
break ;

if (strncmp (line, "Hardware", 8) != 0)
FILE * modelFd;
if ((strncmp (line, "Hardware", 8) != 0) &&
(((modelFd = fopen ("/sys/firmware/devicetree/base/model", "r")) != NULL) ||
(fgets (line, 64, modelFd) != NULL)))
piGpioLayoutOops ("No \"Hardware\" line") ;

if (wiringPiDebug)


Notiek ielāde…
Atcelt
Saglabāt