浏览代码

Merge pull request #89 from fanoush/master

Add support for Pi 400 and CM4
pull/92/head
Philip Howard 4 年前
committed by GitHub
父节点
当前提交
4fc9420625
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 3 个文件被更改,包括 12 次插入5 次删除
  1. +4
    -2
      gpio/readall.c
  2. +5
    -2
      wiringPi/wiringPi.c
  3. +3
    -1
      wiringPi/wiringPi.h

+ 4
- 2
gpio/readall.c 查看文件

@@ -311,6 +311,8 @@ static void plus2header (int model)
printf (" +-----+-----+---------+------+---+---Pi 3A+-+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_4B)
printf (" +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_400)
printf (" +-----+-----+---------+------+---+---Pi 400-+---+------+---------+-----+-----+\n") ;
else
printf (" +-----+-----+---------+------+---+---Pi ?---+---+------+---------+-----+-----+\n") ;
}
@@ -358,10 +360,10 @@ void doReadall (void)
(model == PI_MODEL_2) ||
(model == PI_MODEL_3AP) ||
(model == PI_MODEL_3B) || (model == PI_MODEL_3BP) ||
(model == PI_MODEL_4B) ||
(model == PI_MODEL_4B) || (model == PI_MODEL_400) ||
(model == PI_MODEL_ZERO) || (model == PI_MODEL_ZERO_W))
piPlusReadall (model) ;
else if ((model == PI_MODEL_CM) || (model == PI_MODEL_CM3) || ((model == PI_MODEL_CM3P)))
else if ((model == PI_MODEL_CM) || (model == PI_MODEL_CM3) || (model == PI_MODEL_CM3P) || (model == PI_MODEL_CM4))
allReadall () ;
else
printf ("Oops - unable to determine board type... model: %d\n", model) ;


+ 5
- 2
wiringPi/wiringPi.c 查看文件

@@ -219,7 +219,7 @@ volatile unsigned int *_wiringPiTimerIrqRaw ;

static volatile unsigned int piGpioBase = 0 ;

const char *piModelNames [20] =
const char *piModelNames [21] =
{
"Model A", // 0
"Model B", // 1
@@ -240,7 +240,8 @@ const char *piModelNames [20] =
"CM3+", // 16
"Pi 4B", // 17
"Unknown18", // 18
"Unknown19", // 19
"Pi 400", // 19
"CM4", // 20
} ;

const char *piRevisionNames [16] =
@@ -2312,6 +2313,8 @@ int wiringPiSetup (void)
break ;

case PI_MODEL_4B:
case PI_MODEL_400:
case PI_MODEL_CM4:
piGpioBase = GPIO_PERI_BASE_2711 ;
piGpioPupOffset = GPPUPPDN0 ;
break ;


+ 3
- 1
wiringPi/wiringPi.h 查看文件

@@ -103,6 +103,8 @@
#define PI_MODEL_3AP 14
#define PI_MODEL_CM3P 16
#define PI_MODEL_4B 17
#define PI_MODEL_400 19
#define PI_MODEL_CM4 20

#define PI_VERSION_1 0
#define PI_VERSION_1_1 1
@@ -114,7 +116,7 @@
#define PI_MAKER_EMBEST 2
#define PI_MAKER_UNKNOWN 3

extern const char *piModelNames [20] ;
extern const char *piModelNames [21] ;
extern const char *piRevisionNames [16] ;
extern const char *piMakerNames [16] ;
extern const int piMemorySize [ 8] ;


正在加载...
取消
保存