mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
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:
@@ -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"),
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user