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

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

View File

@ -237,7 +237,7 @@ const char *piModelNames [20] =
"Pi 3A+", // 14
"Unknown15", // 15
"CM3+", // 16
"Unknown17", // 17
"Pi 4B", // 17
"Unknown18", // 18
"Unknown19", // 19
} ;

View File

@ -102,6 +102,7 @@
#define PI_MODEL_3BP 13
#define PI_MODEL_3AP 14
#define PI_MODEL_CM3P 16
#define PI_MODEL_4B 17
#define PI_VERSION_1 0
#define PI_VERSION_1_1 1