Add support for Raspberry Pi 4B

This change make the following commands correctly detect the 4B
however there may be an issue with reading GPIO inputs on the 4B
as they are always returning zero.

The aim of this change is to be the source-equivalent of the binary
package release 2.52[1] which was the last release before upstream
development ceased.

[1] http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/
This commit is contained in:
Steve Baker
2019-12-14 01:09:13 +00:00
parent 03204c3807
commit aca883a051
3 changed files with 26 additions and 22 deletions

View File

@@ -80,7 +80,7 @@ static char *alts [] =
"IN", "OUT", "ALT5", "ALT4", "ALT0", "ALT1", "ALT2", "ALT3"
} ;
static int physToWpi [64] =
static int physToWpi [64] =
{
-1, // 0
-1, -1, // 1, 2
@@ -113,7 +113,7 @@ static int physToWpi [64] =
-1, -1, -1, -1, -1, -1, -1, -1, -1
} ;
static char *physNames [64] =
static char *physNames [64] =
{
NULL,
@@ -309,6 +309,8 @@ static void plus2header (int model)
printf (" +-----+-----+---------+------+---+---Pi 3B+-+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_3AP)
printf (" +-----+-----+---------+------+---+---Pi 3A+-+---+------+---------+-----+-----+\n") ;
else if (model == PI_MODEL_4B)
printf (" +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+\n") ;
else
printf (" +-----+-----+---------+------+---+---Pi ?---+---+------+---------+-----+-----+\n") ;
}
@@ -356,6 +358,7 @@ 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_ZERO) || (model == PI_MODEL_ZERO_W))
piPlusReadall (model) ;
else if ((model == PI_MODEL_CM) || (model == PI_MODEL_CM3) || ((model == PI_MODEL_CM3P)))