micropeak: Support µPUSB with our own USB ids
[fw/altos] / micropeak / MicroUSB.java
index f56d81d40b087fc5de6be346e800660fd821ab98..6ffdb6281ea82e0e9a14a68a588675c9101e7667 100644 (file)
@@ -19,7 +19,8 @@ package org.altusmetrum.micropeak;
 
 import java.util.*;
 import libaltosJNI.*;
-import org.altusmetrum.altosuilib.*;
+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
+}