Bladeren bron

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 5 maanden geleden
bovenliggende
commit
960fee52bf
1 gewijzigde bestanden met toevoegingen van 5 en 1 verwijderingen
  1. +5
    -1
      wiringPi/wiringPiLegacy.c

+ 5
- 1
wiringPi/wiringPiLegacy.c Bestand weergeven

@@ -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)


Laden…
Annuleren
Opslaan