浏览代码

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 个月前
父节点
当前提交
960fee52bf
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. +5
    -1
      wiringPi/wiringPiLegacy.c

+ 5
- 1
wiringPi/wiringPiLegacy.c 查看文件

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


正在加载...
取消
保存