ソースを参照

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)


読み込み中…
キャンセル
保存