From e73bcac8c7b1b560428bb0c43ce1b1ff296d4de8 Mon Sep 17 00:00:00 2001 From: Daniel-Foley <143452385+Daniel-Foley@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:15:28 -0500 Subject: [PATCH] Added CM4 model check to IsPi4 (#2125) CM4 needs to be handled the same way as a pi4. Right now, due to the device model of a CM4 being "Raspberry Pi Computer Module 4" it is being treated as a pi3. This causes a problem with the pin mapping and prevents the CM4 from having it's input/output and pullup/pulldown changed on OpenPin(). --- .../System/Device/Gpio/Drivers/RaspberryPi3LinuxDriver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Device.Gpio/System/Device/Gpio/Drivers/RaspberryPi3LinuxDriver.cs b/src/System.Device.Gpio/System/Device/Gpio/Drivers/RaspberryPi3LinuxDriver.cs index 227d4fed..3c731c86 100644 --- a/src/System.Device.Gpio/System/Device/Gpio/Drivers/RaspberryPi3LinuxDriver.cs +++ b/src/System.Device.Gpio/System/Device/Gpio/Drivers/RaspberryPi3LinuxDriver.cs @@ -722,7 +722,7 @@ internal unsafe class RaspberryPi3LinuxDriver : GpioDriver if (File.Exists(ModelFilePath)) { string model = File.ReadAllText(ModelFilePath, Text.Encoding.ASCII); - if (model.Contains("Raspberry Pi 4")) + if (model.Contains("Raspberry Pi 4") || model.Contains("Raspberry Pi Compute Module 4")) { IsPi4 = true; } -- GitLab