Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
authorBdale Garbee <bdale@gag.com>
Thu, 19 Dec 2013 01:25:35 +0000 (18:25 -0700)
committerBdale Garbee <bdale@gag.com>
Thu, 19 Dec 2013 01:25:35 +0000 (18:25 -0700)
21 files changed:
.gitignore
altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java
altoslib/AltosEepromDownload.java
altoslib/AltosIdleMonitor.java
altoslib/AltosLib.java
altoslib/AltosMs5607.java
altoslib/AltosTelemetryReader.java
altosui/AltosAscent.java
altosui/AltosDescent.java
altosui/AltosIdleMonitorUI.java
altosui/AltosPad.java
altosui/Makefile.am
configure.ac
doc/micropeak.xsl
libaltos/cjnitest.c
libaltos/libaltos.c
libaltos/libaltos.dylib
micropeak/Makefile.am
pdclib
src/Makedefs.in
src/Makefile

index 54834f663c3aa0164cfdcac0123a135d208a567f..61f48048b88aae31a664151618befeebfe2d734f 100644 (file)
@@ -64,3 +64,4 @@ doc/telemetrum.fo
 doc/telemetrum.html
 doc/telemetrum.pdf
 altosui/altos-windows.log
+pdclib-root
index 2c6732e52e9765ec34df56a3f1b1ffeeaff31971..b9e878f12519be8ac4ecf2325fe668db3e1a7f6e 100644 (file)
@@ -104,13 +104,13 @@ public class TabPad extends Fragment implements AltosDroidTab {
        public void update_ui(AltosState state, AltosGreatCircle from_receiver, Location receiver) {
                if (state != null) {
                        mBatteryVoltageView.setText(AltosDroid.number("%4.2f V", state.battery_voltage));
-                       mBatteryLights.set(state.battery_voltage > 3.7, state.battery_voltage == AltosLib.MISSING);
+                       mBatteryLights.set(state.battery_voltage >= AltosLib.ao_battery_good, state.battery_voltage == AltosLib.MISSING);
 
                        mApogeeVoltageView.setText(AltosDroid.number("%4.2f V", state.apogee_voltage));
-                       mApogeeLights.set(state.apogee_voltage > 3.2, state.apogee_voltage == AltosLib.MISSING);
+                       mApogeeLights.set(state.apogee_voltage >= AltosLib.ao_igniter_good, state.apogee_voltage == AltosLib.MISSING);
 
                        mMainVoltageView.setText(AltosDroid.number("%4.2f V", state.main_voltage));
-                       mMainLights.set(state.main_voltage > 3.2, state.main_voltage == AltosLib.MISSING);
+                       mMainLights.set(state.main_voltage >= AltosLib.ao_igniter_good, state.main_voltage == AltosLib.MISSING);
 
                        if (state.flight != 0) {
                                if (state.state <= AltosLib.ao_flight_pad)
index 542defeefb1e202c81a61019b9cec2bdfdd0fd97..1b04316715809b1e42be683748112761b6e720aa 100644 (file)
@@ -239,6 +239,7 @@ public class AltosEepromDownload implements Runnable {
 
        public void start() {
                eeprom_thread = new Thread(this);
+               monitor.set_thread(eeprom_thread);
                eeprom_thread.start();
        }
 
@@ -255,7 +256,6 @@ public class AltosEepromDownload implements Runnable {
 
                monitor.set_states(AltosLib.ao_flight_boost, AltosLib.ao_flight_landed);
 
-               monitor.set_thread(eeprom_thread);
                monitor.start();
        }
 }
index c816c202cc44533463a7763fb943fe9219e938fe..d9d71143a0f5f4fea10ea535e00498fcc5e2fdd6 100644 (file)
@@ -91,14 +91,11 @@ public class AltosIdleMonitor extends Thread {
        }
 
        public void abort() throws InterruptedException {
-               System.out.printf("Attempting to abort monitor thread\n");
                while (isAlive()) {
-                       System.out.printf("Interrupting\n");
                        interrupt();
                        link.abort_reply();
                        Thread.sleep(100);
                }
-               System.out.printf("Appears to be dead now\n");
                join();
        }
 
index 36a2ab3289598ba7e23d877b670a47895dcfed2b..efbc3ddbe69c15f57bee5ae272673d2749c14b77 100644 (file)
@@ -143,6 +143,11 @@ public class AltosLib {
        /* Bluetooth "identifier" (bluetooth sucks) */
        public final static String bt_product_telebt = "TeleBT";
 
+       /* "good" voltages */
+
+       public final static double ao_battery_good = 3.8;
+       public final static double ao_igniter_good = 3.5;
+
        /* Telemetry modes */
        public static final int ao_telemetry_off = 0;
        public static final int ao_telemetry_min = 1;
index 23d65ea9c07be5ca2f5ed9490af485df9d4555d7..2319d5b821b833becd9cd72c37b796caca051aa6 100644 (file)
@@ -85,12 +85,10 @@ public class AltosMs5607 {
        }
 
        public boolean parse_line(String line) {
-               System.out.printf ("parse %s\n", line);
                String[] items = line.split("\\s+");
                if (line.startsWith("Pressure:")) {
                        if (items.length >= 2) {
                                raw_pres = Integer.parseInt(items[1]);
-                               System.out.printf ("raw_pres %d\n", raw_pres);
                        }
                } else if (line.startsWith("Temperature:")) {
                        if (items.length >= 2)
@@ -99,10 +97,8 @@ public class AltosMs5607 {
                        if (items.length >= 3)
                                reserved = Integer.parseInt(items[2]);
                } else if (line.startsWith("ms5607 sens:")) {
-                       System.out.printf ("found sens length %d\n", items.length);
                        if (items.length >= 3) {
                                sens = Integer.parseInt(items[2]);
-                               System.out.printf ("sens %d\n", sens);
                        }
                } else if (line.startsWith("ms5607 off:")) {
                        if (items.length >= 3)
@@ -156,13 +152,9 @@ public class AltosMs5607 {
                                throw new TimeoutException();
                        }
                        if (!parse_line(line)) {
-                               System.out.printf ("stop parsing at %s\n", line);
                                break;
                        }
                }
-               System.out.printf ("sens %d off %d tcs %d tco %d tref %d tempsens %d crc %d pres %d temp %d\n",
-                                  sens, off, tcs, tco, tref, tempsens, crc, raw_pres, raw_temp);
                convert();
-               System.out.printf ("pa %d cc %d\n", pa, cc);
        }
 }
index 405c555b35b460c27448ca73fae8bb23a12b6c20..eeb35cb51c6579e141678d4c2cce352b9d3eb6d2 100644 (file)
@@ -124,6 +124,7 @@ public class AltosTelemetryReader extends AltosFlightReader {
        public AltosTelemetryReader (AltosLink in_link)
                throws IOException, InterruptedException, TimeoutException {
                link = in_link;
+               boolean success = false;
                try {
                        log = new AltosLog(link);
                        name = link.name;
@@ -133,8 +134,10 @@ public class AltosTelemetryReader extends AltosFlightReader {
                        telemetry = AltosPreferences.telemetry(link.serial);
                        set_telemetry(telemetry);
                        link.add_monitor(telem);
+                       success = true;
                } finally {
-                       close(true);
+                       if (!success)
+                               close(true);
                }
        }
 }
index 1d9af54679d4f637a82aadb7d32306eed069337d..ba4fc614bfc70646ddbbcda8e3a7eebf05459964 100644 (file)
@@ -285,7 +285,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
        class Apogee extends AscentStatus {
                void show (AltosState state, AltosListenerState listener_state) {
                        show("%4.2f V", state.apogee_voltage);
-                       lights.set(state.apogee_voltage > 3.7);
+                       lights.set(state.apogee_voltage >= AltosLib.ao_igniter_good);
                }
                public Apogee (GridBagLayout layout, int y) {
                        super(layout, y, "Apogee Igniter Voltage");
@@ -297,7 +297,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
        class Main extends AscentStatus {
                void show (AltosState state, AltosListenerState listener_state) {
                        show("%4.2f V", state.main_voltage);
-                       lights.set(state.main_voltage > 3.7);
+                       lights.set(state.main_voltage >= AltosLib.ao_igniter_good);
                }
                public Main (GridBagLayout layout, int y) {
                        super(layout, y, "Main Igniter Voltage");
index 77776ff2ce3417d8b847874505dd1c8572228dc3..e73d990cb5ccde177ee73e818ae5514b30195c6a 100644 (file)
@@ -323,7 +323,7 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay {
        class Apogee extends DescentStatus {
                void show (AltosState state, AltosListenerState listener_state) {
                        show("%4.2f V", state.apogee_voltage);
-                       lights.set(state.apogee_voltage > 3.7);
+                       lights.set(state.apogee_voltage >= AltosLib.ao_igniter_good);
                }
                public Apogee (GridBagLayout layout, int y) {
                        super(layout, y, "Apogee Igniter Voltage");
@@ -335,7 +335,7 @@ public class AltosDescent extends JComponent implements AltosFlightDisplay {
        class Main extends DescentStatus {
                void show (AltosState state, AltosListenerState listener_state) {
                        show("%4.2f V", state.main_voltage);
-                       lights.set(state.main_voltage > 3.7);
+                       lights.set(state.main_voltage >= AltosLib.ao_igniter_good);
                }
                public Main (GridBagLayout layout, int y) {
                        super(layout, y, "Main Igniter Voltage");
index 6da920e29cb89e30f90338cc7e8fef9f74c7ca4a..6a79604efff6b33f894ebaba09e111c652befb9d 100644 (file)
@@ -195,13 +195,11 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
                addWindowListener(new WindowAdapter() {
                                @Override
                                public void windowClosing(WindowEvent e) {
-                                       System.out.printf("Closing idle monitor window\n");
                                        try {
                                                disconnect();
                                        } catch (Exception ex) {
                                                System.out.println(Arrays.toString(ex.getStackTrace()));
                                        }
-                                       System.out.printf("hiding\n");
                                        setVisible(false);
                                        dispose();
                                        AltosUIPreferences.unregister_font_listener(AltosIdleMonitorUI.this);
index b35bd23a8626f14032344b671dcd91575a385c1a..06a0f1efa2bc9c3855c2760bbfb3b71ff9a2b0e3 100644 (file)
@@ -180,7 +180,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay {
                                hide();
                        else {
                                show("%4.2f V", state.battery_voltage);
-                               lights.set(state.battery_voltage > 3.7);
+                               lights.set(state.battery_voltage >= AltosLib.ao_battery_good);
                        }
                }
                public Battery (GridBagLayout layout, int y) {
@@ -196,7 +196,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay {
                                hide();
                        else {
                                show("%4.2f V", state.apogee_voltage);
-                               lights.set(state.apogee_voltage > 3.7);
+                               lights.set(state.apogee_voltage >= AltosLib.ao_igniter_good);
                        }
                }
                public Apogee (GridBagLayout layout, int y) {
@@ -212,7 +212,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay {
                                hide();
                        else {
                                show("%4.2f V", state.main_voltage);
-                               lights.set(state.main_voltage > 3.7);
+                               lights.set(state.main_voltage >= AltosLib.ao_igniter_good);
                        }
                }
                public Main (GridBagLayout layout, int y) {
@@ -287,7 +287,7 @@ public class AltosPad extends JComponent implements AltosFlightDisplay {
                                hide();
                        else {
                                show("%4.2f V", listener_state.battery);
-                               lights.set(listener_state.battery > 3.7);
+                               lights.set(listener_state.battery > AltosLib.ao_battery_good);
                        }
                }
                public ReceiverBattery (GridBagLayout layout, int y) {
index 0b75a2b166562ec9c85d541f5881b65d3e23a7c9..824ec9e103019a3aa46d7a7fe2fe24b485e8c9ff 100644 (file)
@@ -178,7 +178,7 @@ LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC)
 LINUX_EXTRA=altosui-fat
 
 MACOSX_INFO_PLIST=Info.plist
-MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) ReadMe-Mac.rtf
+MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(DOC) ReadMe-Mac.rtf
 MACOSX_EXTRA=$(FIRMWARE)
 
 WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(top_srcdir)/telemetrum.inf $(WINDOWS_ICON)
@@ -329,6 +329,8 @@ $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) Makefile
        mkdir macosx
        cp -a AltosUI.app macosx/
        cp -a ReadMe-Mac.rtf macosx/ReadMe.rtf
+       mkdir -p macosx/Doc
+       cp -a $(DOC) macosx/Doc
        cp -p Info.plist macosx/AltosUI.app/Contents
        mkdir -p macosx/AltOS-$(VERSION) macosx/AltosUI.app/Contents/Resources/Java
        cp -p $(FATJAR) macosx/AltosUI.app/Contents/Resources/Java/altosui.jar
index b6e17355a496c1ddc5451698b7f4c282f9d67af2..b92e06a9af6d5696b2864a077269379526bf0036 100644 (file)
@@ -239,9 +239,10 @@ AC_SUBST(HAVE_ARM_CC)
 AC_SUBST(ARM_CC)
 
 if test -d pdclib -a x"$HAVE_ARM_CC" = xyes; then
-       PDCLIB_INCLUDES='-I$(TOPDIR)/../pdclib/opt/include'
-       PDCLIB_LIBS_M0='-L$(TOPDIR)/../pdclib/opt/lib -lpdclib-cortex-m0'
-       PDCLIB_LIBS_M3='-L$(TOPDIR)/../pdclib/opt/lib -lpdclib-cortex-m3'
+       PDCLIB_ROOT='$(TOPDIR)/../pdclib-root'
+       PDCLIB_INCLUDES='-I$(TOPDIR)/../pdclib-root/include'
+       PDCLIB_LIBS_M0='-L$(TOPDIR)/../pdclib-root/lib -lpdclib-cortex-m0'
+       PDCLIB_LIBS_M3='-L$(TOPDIR)/../pdclib-root/lib -lpdclib-cortex-m3'
        HAVE_PDCLIB=yes
 else
        PDCLIB_INCLUDES=''
@@ -255,6 +256,7 @@ AM_CONDITIONAL(PDCLIB, [test x$HAVE_PDCLIB = xyes])
 AC_SUBST(PDCLIB_INCLUDES)
 AC_SUBST(PDCLIB_LIBS_M0)
 AC_SUBST(PDCLIB_LIBS_M3)
+AC_SUBST(PDCLIB_ROOT)
 AC_SUBST(HAVE_PDCLIB)
 
 if test "x$HAVE_ARM_CC" = "xyes"; then
index afa6fd1575fdba714407535d2610c239d5b904ab..8c487e5d97d0d60d8d1cfc892b431356107892e7 100644 (file)
@@ -115,20 +115,20 @@ NAR #88757, TRA #12200
        <para>
          Finish preparing the rocket for flight. After the
          previous flight data have been reported, MicroPeak waits for
-         30 seconds before starting to check for launch. This gives
+         one minute before starting to check for launch. This gives
          you time to finish assembling the rocket. As those
          activities might cause pressure changes inside the airframe,
          MicroPeak might accidentally detect boost. If you need to do
-         anything to the airframe after the 30 second window passes,
+         anything to the airframe after the one minute window passes,
          make sure to be careful not to disturb the altimeter. The
-         LED will remain dark during the 30 second delay, but after
+         LED will remain dark during the one minute delay, but after
          that, it will start blinking once every 3 seconds.
        </para>
       </listitem>
       <listitem>
        <para>
-         Fly the rocket. Once the rocket passes about 10m in height
-         (32 feet), the micro-controller will record the ground
+         Fly the rocket. Once the rocket passes about 30m in height
+         (100 feet), the micro-controller will record the ground
          pressure and track the pressure seen during the flight. In
          this mode, the LED flickers rapidly. When the rocket lands,
          and the pressure stabilizes, the micro-controller will record
@@ -401,7 +401,7 @@ NAR #88757, TRA #12200
     <section>
       <title>Lithium Battery</title>
       <para>
-       The CR1025 battery used by MicroPeak holes 30mAh of power,
+       The CR1025 battery used by MicroPeak holds 30mAh of power,
        which is sufficient to run for over 40 hours. Because
        MicroPeak powers down on landing, run time includes only time
        sitting on the launch pad or during flight.
index f0fe78f764cf4abb703a65610b442f8e66ac5481..3a65c3d68b10cf8ffceda422ba0f93bf7aa8f551 100644 (file)
@@ -10,7 +10,8 @@ altos_puts(struct altos_file *file, char *string)
                altos_putchar(file, c);
 }
 
-main ()
+int
+main (int argc, char **argv)
 {
        struct altos_device     device;
        struct altos_list       *list;
index 4a6363edc7a069c4e0f83d930d24d9d7bdea4b2c..a623d5ae0b5c187f9b0c5a7bec962b1c73e2451d 100644 (file)
@@ -53,6 +53,8 @@ altos_get_last_error(struct altos_error *error)
 
 #ifdef DARWIN
 
+#include <unistd.h>
+
 #undef USE_POLL
 
 /* Mac OS X don't have strndup even if _GNU_SOURCE is defined */
@@ -887,15 +889,6 @@ altos_list_next(struct altos_list *list, struct altos_device *device)
                if (!get_number (object, CFSTR(kUSBVendorID), &device->vendor) ||
                    !get_number (object, CFSTR(kUSBProductID), &device->product))
                        continue;
-               if (list->ftdi) {
-                       if (device->vendor != 0x0403)
-                               continue;
-               } else {
-                       if (device->vendor != 0xfffe)
-                               continue;
-                       if (device->product < 0x000a || 0x0013 < device->product)
-                               continue;
-               }
                if (get_string (object, CFSTR("IOCalloutDevice"), device->path, sizeof (device->path)) &&
                    get_string (object, CFSTR("USB Product Name"), device->name, sizeof (device->name)) &&
                    get_string (object, CFSTR("USB Serial Number"), serial_string, sizeof (serial_string))) {
index cfbd3f54cee22e98f28638a3d515ff22e344cab9..8b491c580c9c06e913b9438e083ae7274734f5d8 100755 (executable)
Binary files a/libaltos/libaltos.dylib and b/libaltos/libaltos.dylib differ
index 098a00fb0e293e765571f50e48894167c941f615..af46abc0727f032c952fbfe3af2f47c94bf66771 100644 (file)
@@ -1,5 +1,5 @@
 JAVAROOT=classes
-AM_JAVACFLAGS=-encoding UTF-8 -Xlint:deprecation
+AM_JAVACFLAGS=-target 1.6 -encoding UTF-8 -Xlint:deprecation -source 6
 
 altoslibdir=$(libdir)/altos
 
diff --git a/pdclib b/pdclib
index f3165dbd639299d08033ed5eef62a21b69540a8d..8b1c9061fa3a8f1b30ee13b373afe5cc1ad9d382 160000 (submodule)
--- a/pdclib
+++ b/pdclib
@@ -1 +1 @@
-Subproject commit f3165dbd639299d08033ed5eef62a21b69540a8d
+Subproject commit 8b1c9061fa3a8f1b30ee13b373afe5cc1ad9d382
index d4ef28be0122d598589662aa36d29cc0ba9c45ab..a52f96fa5d25898977f597aec057d75d69bf54f1 100644 (file)
@@ -4,6 +4,7 @@ HAVE_ARM_M0_CC=@HAVE_ARM_M0_CC@
 PDCLIB_INCLUDES=@PDCLIB_INCLUDES@
 PDCLIB_LIBS_M0=@PDCLIB_LIBS_M0@
 PDCLIB_LIBS_M3=@PDCLIB_LIBS_M3@
+PDCLIB_ROOT=@PDCLIB_ROOT@
 HAVE_PDCLIB=@HAVE_PDCLIB@
 
 SDCC=@SDCC@
index 0ca101c07c526a3457fcfa9d0e0171d1eff621f2..392262d48db8a66d17ef43a71b36f221285a9896 100644 (file)
@@ -13,6 +13,7 @@ vpath load_csv.5c kalman
 vpath matrix.5c kalman
 
 include Version
+TOPDIR=.
 include Makedefs
 
 SDCCDIRS=\
@@ -114,7 +115,9 @@ clean-local: $(CLEAN_PDCLIB)
        rm -f altitude.h ao_kalman.h
 
 pdclib:
-       cd ../pdclib && mkdir -p opt/include opt/lib && make && make prefix=`pwd`/opt install
+       mkdir -p $(PDCLIB_ROOT)/include $(PDCLIB_ROOT)/lib 
+       cd ../pdclib && make && make prefix=`pwd`/../pdclib-root install
 
 clean-pdclib:
-       cd ../pdclib && make clean && rm -rf opt
\ No newline at end of file
+       rm -rf $(PDCLIB_ROOT)
+       cd ../pdclib && make clean