From 5cabf4a4f8ac801819341c63ae3e308a8ba2e47b Mon Sep 17 00:00:00 2001 From: toca21 Date: Tue, 20 Jul 2021 21:49:53 +0200 Subject: [PATCH] Fixed the Compute Module 4 pin mode setting. The CM4 is equal to RB4 std platform, not CM3 family as it turned out. --- gpio/readall.c | 4 ++-- wiringPi/wiringPi.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gpio/readall.c b/gpio/readall.c index f0ad40d..ec06724 100644 --- a/gpio/readall.c +++ b/gpio/readall.c @@ -361,9 +361,9 @@ void doReadall (void) (model == PI_MODEL_3AP) || (model == PI_MODEL_3B) || (model == PI_MODEL_3BP) || (model == PI_MODEL_4B) || (model == PI_MODEL_400) || - (model == PI_MODEL_ZERO) || (model == PI_MODEL_ZERO_W)) + (model == PI_MODEL_ZERO) || (model == PI_MODEL_ZERO_W) || (model == PI_MODEL_CM4)) piPlusReadall (model) ; - else if ((model == PI_MODEL_CM) || (model == PI_MODEL_CM3) || (model == PI_MODEL_CM3P) || (model == PI_MODEL_CM4)) + else if ((model == PI_MODEL_CM) || (model == PI_MODEL_CM3) || (model == PI_MODEL_CM3P) ) allReadall () ; else printf ("Oops - unable to determine board type... model: %d\n", model) ; diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c index a970e27..24decea 100644 --- a/wiringPi/wiringPi.c +++ b/wiringPi/wiringPi.c @@ -2284,8 +2284,7 @@ int wiringPiSetup (void) if ((model == PI_MODEL_CM) || (model == PI_MODEL_CM3) || - (model == PI_MODEL_CM3P) || - (model == PI_MODEL_CM4)) + (model == PI_MODEL_CM3P)) wiringPiMode = WPI_MODE_GPIO ; else wiringPiMode = WPI_MODE_PINS ;