summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-12-06 15:08:53 -0800
committerKeith Packard <keithp@keithp.com>2014-12-06 15:09:48 -0800
commit5b7ec0c69343db3793c0317939b5eff1f2d04752 (patch)
treed6a8c744c7a671f9981b76a95b1964401df5ecfb
parent7e52ef59082cb2afdba498233c429321c37a6ac3 (diff)
micropeak: Support µPUSB with our own USB ids
This matches the new µPUSB id as well as the FTDI USB id. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--micropeak/MicroUSB.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/micropeak/MicroUSB.java b/micropeak/MicroUSB.java
index 24f6722b..6ffdb628 100644
--- a/micropeak/MicroUSB.java
+++ b/micropeak/MicroUSB.java
@@ -19,6 +19,7 @@ package org.altusmetrum.micropeak;
import java.util.*;
import libaltosJNI.*;
+import org.altusmetrum.altoslib_5.*;
import org.altusmetrum.altosuilib_3.*;
public class MicroUSB extends altos_device implements AltosDevice {
@@ -75,11 +76,14 @@ public class MicroUSB extends altos_device implements AltosDevice {
}
private boolean isMicro() {
- if (getVendor() != 0x0403)
- return false;
- if (getProduct() != 0x6015)
- return false;
- return true;
+ int vid = getVendor();
+ int pid = getProduct();
+ if (vid == 0x0403 && pid == 0x6015)
+ return true;
+ if (vid == AltosLib.vendor_altusmetrum &&
+ pid == AltosLib.product_mpusb)
+ return true;
+ return false;
}
public boolean matchProduct(int product) {
@@ -106,4 +110,4 @@ public class MicroUSB extends altos_device implements AltosDevice {
return device_list;
}
-} \ No newline at end of file
+}