projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
micropeak: Support µPUSB with our own USB ids
[fw/altos]
/
micropeak
/
MicroUSB.java
diff --git
a/micropeak/MicroUSB.java
b/micropeak/MicroUSB.java
index 908ac51b6afbc1eff197f6ed5aa0149ce1aca580..6ffdb6281ea82e0e9a14a68a588675c9101e7667 100644
(file)
--- a/
micropeak/MicroUSB.java
+++ b/
micropeak/MicroUSB.java
@@
-19,7
+19,8
@@
package org.altusmetrum.micropeak;
import java.util.*;
import libaltosJNI.*;
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 {
public class MicroUSB extends altos_device implements AltosDevice {
@@
-50,7
+51,7
@@
public class MicroUSB extends altos_device implements AltosDevice {
String name = getName();
if (name == null)
name = "Altus Metrum";
String name = getName();
if (name == null)
name = "Altus Metrum";
- return String.format("%-2
0.20
s %s",
+ return String.format("%-2
4.24
s %s",
name, getPath());
}
name, getPath());
}
@@
-75,11
+76,14
@@
public class MicroUSB extends altos_device implements AltosDevice {
}
private boolean isMicro() {
}
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) {
}
public boolean matchProduct(int product) {
@@
-90,7
+94,7
@@
public class MicroUSB extends altos_device implements AltosDevice {
if (!load_library())
return null;
if (!load_library())
return null;
- SWIGTYPE_p_altos_list list = libaltos.altos_list_start();
+ SWIGTYPE_p_altos_list list = libaltos.altos_
ftdi_
list_start();
ArrayList<MicroUSB> device_list = new ArrayList<MicroUSB>();
if (list != null) {
ArrayList<MicroUSB> device_list = new ArrayList<MicroUSB>();
if (list != null) {
@@
-106,4
+110,4
@@
public class MicroUSB extends altos_device implements AltosDevice {
return device_list;
}
return device_list;
}
-}
\ No newline at end of file
+}