Add Pi zero 2 W to PiVersion enum (#373)

This approach is quite brittle, but it's easy to get working and can ship in an initial 2022 release. It's necessary to prevent GPU acceleration from happening on Pi 4s though. Let's try to put together something better for future releases.
This commit is contained in:
Matt
2022-01-05 20:34:42 -08:00
committed by GitHub
parent 641101f574
commit 12e06b09c3
3 changed files with 4 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ public enum PiVersion {
PI_B("Pi Model B"),
COMPUTE_MODULE("Compute Module Rev"),
ZERO_W("Pi Zero W Rev 1.1"),
ZERO_2_W("Raspberry Pi Zero 2 W"),
PI_3("Pi 3"),
PI_4("Pi 4"),
COMPUTE_MODULE_3("Compute Module 3"),

View File

@@ -46,7 +46,7 @@ public enum Platform {
private static final String OS_NAME = System.getProperty("os.name");
private static final String OS_ARCH = System.getProperty("os.arch");
// These are querried on init and should never change after
// These are queried on init and should never change after
public static final Platform currentPlatform = getCurrentPlatform();
protected static final String currentPiVersionStr = getPiVersionString();
public static final PiVersion currentPiVersion = PiVersion.getPiVersion();

View File

@@ -89,7 +89,8 @@ public class PicamJNI {
&& getSensorModel() != SensorModel.Disconnected
&& Platform.isRaspberryPi()
&& (Platform.currentPiVersion == PiVersion.PI_3
|| Platform.currentPiVersion == PiVersion.COMPUTE_MODULE_3);
|| Platform.currentPiVersion == PiVersion.COMPUTE_MODULE_3
|| Platform.currentPiVersion == PiVersion.ZERO_2_W);
}
public static SensorModel getSensorModel() {