Browse Source

Add RPi4 detection

pull/65/head
Igor Kanyuka 5 years ago
parent
commit
cd8e37719f
2 changed files with 5 additions and 1 deletions
  1. +4
    -1
      gpio/readall.c
  2. +1
    -0
      wiringPi/wiringPi.h

+ 4
- 1
gpio/readall.c View File

@@ -307,6 +307,8 @@ static void plus2header (int model)
printf (" +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_3P)
printf (" +-----+-----+---------+------+---+---Pi 3+--+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_4)
printf (" +-----+-----+---------+------+---+---Pi 4+--+---+------+---------+-----+-----+\n") ;
else
printf (" +-----+-----+---------+------+---+---Pi ?---+---+------+---------+-----+-----+\n") ;
}
@@ -353,7 +355,8 @@ void doReadall (void)
else if ((model == PI_MODEL_BP) || (model == PI_MODEL_AP) ||
(model == PI_MODEL_2) ||
(model == PI_MODEL_3) || (model == PI_MODEL_3P) ||
(model == PI_MODEL_ZERO) || (model == PI_MODEL_ZERO_W))
(model == PI_MODEL_ZERO) || (model == PI_MODEL_ZERO_W) ||
(model == PI_MODEL_4))
piPlusReadall (model) ;
else if ((model == PI_MODEL_CM) || (model == PI_MODEL_CM3))
allReadall () ;


+ 1
- 0
wiringPi/wiringPi.h View File

@@ -100,6 +100,7 @@
#define PI_MODEL_CM3 10
#define PI_MODEL_ZERO_W 12
#define PI_MODEL_3P 13
#define PI_MODEL_4 17

#define PI_VERSION_1 0
#define PI_VERSION_1_1 1


Loading…
Cancel
Save