Merge branch 'branch-1.3' into debian
authorBdale Garbee <bdale@gag.com>
Thu, 23 Jan 2014 03:55:41 +0000 (20:55 -0700)
committerBdale Garbee <bdale@gag.com>
Thu, 23 Jan 2014 03:55:41 +0000 (20:55 -0700)
253 files changed:
ChangeLog
altosdroid/AndroidManifest.xml
altosdroid/Makefile.am
altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java
altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java
altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java
altosdroid/src/org/altusmetrum/AltosDroid/TabDescent.java
altosdroid/src/org/altusmetrum/AltosDroid/TabLanded.java
altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java
altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java
altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java
altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java
altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java
altoslib/AltosAccel.java
altoslib/AltosCRCException.java
altoslib/AltosCompanion.java
altoslib/AltosConfigData.java
altoslib/AltosConfigValues.java
altoslib/AltosConvert.java
altoslib/AltosDebug.java
altoslib/AltosDistance.java
altoslib/AltosEeprom.java
altoslib/AltosEepromChunk.java
altoslib/AltosEepromDownload.java
altoslib/AltosEepromFile.java
altoslib/AltosEepromHeader.java
altoslib/AltosEepromIterable.java
altoslib/AltosEepromList.java
altoslib/AltosEepromLog.java
altoslib/AltosEepromMega.java
altoslib/AltosEepromMetrum2.java
altoslib/AltosEepromMini.java
altoslib/AltosEepromMonitor.java
altoslib/AltosEepromTM.java
altoslib/AltosEepromTm.java
altoslib/AltosFile.java
altoslib/AltosFlash.java
altoslib/AltosFlashListener.java
altoslib/AltosFlightReader.java
altoslib/AltosFrequency.java
altoslib/AltosGPS.java
altoslib/AltosGPSSat.java
altoslib/AltosGreatCircle.java
altoslib/AltosHeight.java
altoslib/AltosHexfile.java
altoslib/AltosHexsym.java
altoslib/AltosIMU.java
altoslib/AltosIdle.java
altoslib/AltosIdleFetch.java
altoslib/AltosIdleMonitor.java
altoslib/AltosIdleMonitorListener.java
altoslib/AltosIgnite.java
altoslib/AltosLib.java
altoslib/AltosLine.java
altoslib/AltosLink.java
altoslib/AltosListenerState.java
altoslib/AltosLog.java
altoslib/AltosMag.java
altoslib/AltosMma655x.java
altoslib/AltosMs5607.java
altoslib/AltosNoSymbol.java
altoslib/AltosOrient.java [new file with mode: 0644]
altoslib/AltosParse.java
altoslib/AltosPreferences.java
altoslib/AltosPreferencesBackend.java
altoslib/AltosProgrammer.java
altoslib/AltosPyro.java
altoslib/AltosReplayReader.java
altoslib/AltosRomconfig.java
altoslib/AltosSelfFlash.java
altoslib/AltosSensorEMini.java
altoslib/AltosSensorMM.java
altoslib/AltosSensorMega.java
altoslib/AltosSensorMetrum.java
altoslib/AltosSensorTM.java
altoslib/AltosSensorTMini.java
altoslib/AltosSpeed.java
altoslib/AltosState.java
altoslib/AltosStateIterable.java
altoslib/AltosStateUpdate.java
altoslib/AltosTelemetry.java
altoslib/AltosTelemetryConfiguration.java
altoslib/AltosTelemetryFile.java
altoslib/AltosTelemetryIterable.java
altoslib/AltosTelemetryLegacy.java
altoslib/AltosTelemetryLocation.java
altoslib/AltosTelemetryMap.java
altoslib/AltosTelemetryMegaData.java
altoslib/AltosTelemetryMegaSensor.java
altoslib/AltosTelemetryMetrumData.java
altoslib/AltosTelemetryMetrumSensor.java
altoslib/AltosTelemetryMini.java
altoslib/AltosTelemetryRaw.java
altoslib/AltosTelemetryReader.java
altoslib/AltosTelemetrySatellite.java
altoslib/AltosTelemetrySensor.java
altoslib/AltosTelemetryStandard.java
altoslib/AltosTemperature.java
altoslib/AltosUnits.java
altoslib/AltosUnitsListener.java
altoslib/Makefile.am
altosui/Altos.java
altosui/AltosAscent.java
altosui/AltosBTKnown.java
altosui/AltosCSV.java
altosui/AltosCSVUI.java
altosui/AltosCompanionInfo.java
altosui/AltosConfig.java
altosui/AltosConfigFreqUI.java
altosui/AltosConfigPyroUI.java
altosui/AltosConfigTD.java
altosui/AltosConfigTDUI.java
altosui/AltosConfigUI.java
altosui/AltosDataChooser.java
altosui/AltosDescent.java
altosui/AltosDisplayThread.java
altosui/AltosEepromDelete.java
altosui/AltosEepromManage.java
altosui/AltosEepromMonitorUI.java
altosui/AltosEepromSelect.java
altosui/AltosFlashUI.java
altosui/AltosFlightDisplay.java
altosui/AltosFlightStats.java
altosui/AltosFlightStatsTable.java
altosui/AltosFlightStatus.java
altosui/AltosFlightStatusTableModel.java
altosui/AltosFlightStatusUpdate.java
altosui/AltosFlightUI.java
altosui/AltosFreqList.java
altosui/AltosGraph.java
altosui/AltosGraphDataPoint.java
altosui/AltosGraphDataSet.java
altosui/AltosGraphUI.java
altosui/AltosIdleMonitorUI.java
altosui/AltosIgniteUI.java
altosui/AltosInfoTable.java
altosui/AltosKML.java
altosui/AltosLanded.java
altosui/AltosPad.java
altosui/AltosRomconfigUI.java
altosui/AltosScanUI.java
altosui/AltosSerial.java
altosui/AltosSiteMap.java
altosui/AltosSiteMapCache.java
altosui/AltosSiteMapPreload.java
altosui/AltosSiteMapTile.java
altosui/AltosUI.java
altosui/AltosUIPreferencesBackend.java
altosui/AltosWriter.java
altosui/Makefile.am
altosui/altos-windows.nsi.in
altosuilib/AltosUIAxis.java
altosuilib/AltosUIEnable.java
altosuilib/AltosUIGraph.java
altosuilib/AltosUIGrapher.java
altosuilib/AltosUILib.java
altosuilib/AltosUIMarker.java
altosuilib/AltosUIPreferences.java
altosuilib/AltosUIPreferencesBackend.java
altosuilib/AltosUISeries.java
ao-bringup/turnon_telemega
configure.ac
debian/docs
doc/Makefile
doc/altusmetrum.xsl
doc/ascent.png
doc/descent.png
doc/fire-igniter.png
doc/graph-configure.png
doc/landed.png
doc/launch-pad.png
doc/release-notes-1.3.1.xsl [new file with mode: 0644]
doc/site-map.png
doc/table.png
doc/telemini.pdf [new file with mode: 0644]
libaltos/.gitignore
libaltos/Makefile.am
micropeak/MicroData.java
micropeak/MicroDownload.java
micropeak/MicroExport.java
micropeak/MicroFile.java
micropeak/MicroFileChooser.java
micropeak/MicroGraph.java
micropeak/MicroPeak.java
micropeak/MicroRaw.java
micropeak/MicroSave.java
micropeak/MicroStats.java
micropeak/MicroStatsTable.java
src/aes/ao_aes.c
src/core/ao.h
src/core/ao_config.c
src/core/ao_convert_volt.c [new file with mode: 0644]
src/core/ao_data.h
src/core/ao_fec.h
src/core/ao_flight.c
src/core/ao_flight.h
src/core/ao_gps_report_mega.c
src/core/ao_gps_report_metrum.c
src/core/ao_ignite.c
src/core/ao_kalman.c
src/core/ao_log.c
src/core/ao_log_metrum.c
src/core/ao_log_mini.c
src/core/ao_notask.c
src/core/ao_pyro.c
src/core/ao_radio_cmac.c
src/core/ao_sample.c
src/core/ao_telemetry.c
src/drivers/ao_aprs.c
src/drivers/ao_button.c
src/drivers/ao_cc1120.c
src/drivers/ao_cc115l.c
src/drivers/ao_companion.c
src/drivers/ao_event.c
src/drivers/ao_event.h
src/drivers/ao_hmc5883.c
src/drivers/ao_lco_cmd.c
src/drivers/ao_lco_func.c
src/drivers/ao_mma655x.c
src/drivers/ao_mma655x.h
src/drivers/ao_mpu6000.c
src/lpc/Makefile-lpc.defs
src/lpc/ao_adc_lpc.c
src/lpc/ao_exti_lpc.c
src/lpc/ao_spi_lpc.c
src/lpc/ao_usb_lpc.c
src/lpc/lpc.h
src/math/ef_log.c [new file with mode: 0644]
src/math/ef_rem_pio2.c
src/math/fdlibm.h
src/math/math.h
src/product/ao_flash_task.c
src/stm/Makefile.defs
src/stm/ao_adc_stm.c
src/stm/ao_arch.h
src/stm/ao_exti_stm.c
src/stm/ao_i2c_stm.c
src/stm/ao_lcd_stm.c
src/stm/ao_profile.h
src/stm/ao_spi_stm_slave.c
src/stm/ao_usb_stm.c
src/stm/stm32l.h
src/telegps-v0.3/Makefile
src/telelco-v0.2/ao_lco.c
src/telemega-v0.1/Makefile
src/telemega-v0.1/ao_pins.h
src/telemega-v1.0/Makefile
src/telemega-v1.0/ao_pins.h
src/telemetrum-v2.0/Makefile
src/telemetrum-v2.0/ao_pins.h

index 1a16bd7fa3b86b1d224222617fa1e0f69045b344..083233ba2f34f8097ffcc8eb3db2267604bde36b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,605 @@
+commit 200137060651f48c99276c8feb0e15980a9b46be
+Author: Bdale Garbee <bdale@gag.com>
+Date:   Wed Jan 22 20:52:09 2014 -0700
+
+    update copyright date on main documentation file
+
+commit 63171339c03cf9bf3d691511889223bf43024124
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Jan 21 23:02:27 2014 -0800
+
+    doc: Update for 1.3.1
+    
+    Add 1.3.1 release notes. Update screen shots. Document new functionality
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit e6a73d6cbe149a930f8c4e2dac655bc3f6270013
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Jan 21 23:01:28 2014 -0800
+
+    doc: Fix image widths to make them all scale the same amount
+    
+    Hand-compute scale factors so that all images are presented at the
+    same relative size as they would be on the screen.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit e61c02b51e069aa58b36f59b9ca8e7c8284bc93a
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Jan 21 22:13:01 2014 -0800
+
+    altosui: Handle serial-port startup errors in idle-monitor
+    
+    Trap exceptions during idle monitor startup and report them.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 42922b40fc695bdaa92e3fb0b41a248f7df918d0
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Jan 21 22:01:39 2014 -0800
+
+    altosui: Handle already-opened link in IgniteUI
+    
+    Must run the link open from the UI thread so that we can put up the
+    in-use dialog immdiately; otherwise the UI thread is blocked which
+    means the dialog never appears and the app appears to hang.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit f118e33416e45ea9a2b5ede4157bd8b58ddb6ebb
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Jan 21 21:37:18 2014 -0800
+
+    altosuilib: Remove some spurious debug printfs
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 677fcafd3816b6d8d86b2dc41b840d97b5ccbf07
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Jan 21 21:34:58 2014 -0800
+
+    altoslib: Fetch target device config for Fire Igniter npyro value
+    
+    The code was using the AltosLink config_data, which is always the
+    locally connected device's configuration. When using the packet link,
+    that's not terribly useful when asking how many extra pyro channels
+    are available.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 13cf4000bd53ac4af66231d56e24c9eb11178a5f
+Merge: 7a8551f 99fedbf
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Jan 21 20:59:06 2014 -0800
+
+    Merge remote-tracking branch 'origin/master'
+
+commit 99fedbf0ed42a5d4fa80f094576ca0260040ef5e
+Author: Bdale Garbee <bdale@gag.com>
+Date:   Tue Jan 21 21:31:25 2014 -0700
+
+    set version to 1.3.1 for release
+
+commit 7a8551fe8e5f0a90cbc494842715a96f08c11900
+Author: Anthony Towns <aj@erisian.com.au>
+Date:   Mon Jan 20 19:38:21 2014 +1000
+
+    altosui: rate limit map downloads
+
+commit 0faa098f05d43eefc1fa54462401171fca5034cb
+Author: Anthony Towns <aj@erisian.com.au>
+Date:   Mon Jan 20 05:10:58 2014 +1000
+
+    altosui: --fetchmaps gets same number of maps as GUI
+
+commit aab5873c87d6ecfe0854751746f80d4bc7ebeffa
+Author: Anthony Towns <aj@erisian.com.au>
+Date:   Mon Jan 20 04:52:43 2014 +1000
+
+    AltosSiteMapPreload: only load 49 maps
+    
+    Google Static Maps API limits queries to 50 maps per IP per minute,
+    so querying a 7x7 array instead of a 9x9 array seems more likely to
+    work well.
+
+commit 7f9cda0e2531a7bba7f1b4e3b7212a62b5bec1ed
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sun Jan 19 00:17:06 2014 -0800
+
+    altosui: Make romconfig serial and radio cal fields 8 digits wide
+    
+    This ensure that they are wide enough to show a cc1120 calibration
+    value, which is 7 digits.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 2b891115c95453d9002d8ef307a27e14eda145a5
+Author: Bdale Garbee <bdale@gag.com>
+Date:   Fri Jan 17 20:55:45 2014 -0700
+
+    set version to 1.3.0.2 for test flights this weekend
+
+commit c33ec8207c0e5d4c855e87b2746371b19d437f7d
+Author: Bdale Garbee <bdale@gag.com>
+Date:   Fri Jan 17 20:47:16 2014 -0700
+
+    use firmware in /usr/share/altos for production flashing
+
+commit cfcb127b248b62231049b6b50cf9b7edc2731f0a
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Jan 15 13:28:16 2014 -0800
+
+    altos: Add missing ADC divider values for Tmega v1.0
+    
+    Somehow I left these out of the previous commit
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 9001d5780a41986017bd3bbc7f8c5556b116c351
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Jan 15 12:42:59 2014 -0800
+
+    Ignore 32 and 64 bit cjnitest apps
+
+commit c743eaa060080a7bd236466b93cff3abc96f405b
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Jan 15 12:40:26 2014 -0800
+
+    altos: Report battery, apogee and main voltages over APRS
+    
+    This makes APRS more usable when you mute the RF audio on the HT.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit cc06242e882cba462791962c199b7c89e79adc65
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Jan 14 23:29:59 2014 -0800
+
+    altos: Use factory calibration for all acceleration computations
+    
+    The ground acceleration value will vary depending on the tilt angle of
+    the airframe, which will result in incorrect acceleration computations
+    during flight. This also avoids accidental boost detect when moving
+    the airframe around in pad mode.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 9d812b3db418fd9816731b761a0853eb38f5a265
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Jan 14 23:21:40 2014 -0800
+
+    altos: Switch APRS to compressed position format
+    
+    This provides lat/lon/alt in fewer bytes while improving precision.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit f560d5063b1339dbfb3e6723cfadb7b4c5eace25
+Author: Keith Packard <keithp@keithp.com>
+Date:   Tue Jan 14 23:18:40 2014 -0800
+
+    doc: Ship telemini outline as pdf file too
+    
+    Build telemini.pdf from telemini.svg and include it in all of the
+    released packages.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 06ffd8022ff5ac74274c9839d42c0c47274cb8b9
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Jan 1 22:08:13 2014 -0800
+
+    altosui: Require both libaltos32 and libaltos64 for fat Linux tarball
+    
+    No sense shipping a broken tarball ever
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 8bff2822c242d2878b408b9c0d8a7647108ea4b1
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Jan 1 22:02:56 2014 -0800
+
+    libaltos: Build -m64 and -m32 for fat tarball when possible
+    
+    Check to see if we can compile libaltos for both 32 bit and 64 bit
+    systems, and then use those when generating the linux tarball.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 95d77eaff708397d8b1e29904dc47d8ea09e8754
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Jan 1 22:02:04 2014 -0800
+
+    Bump version to 1.3.9.1
+    
+    Lots of new features; let's not release with 1.3 set
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit b15bd24bbe48e338497c6257f5fe2c7fd1cbffbb
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Jan 1 22:00:24 2014 -0800
+
+    altosui: Handle a missing libaltos when starting up
+    
+    Skip a null list of devices when figuring out what to open monitor
+    windows for during startup.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit c35ea586b9e792c45b287924fd256928308d9a36
+Author: Keith Packard <keithp@keithp.com>
+Date:   Wed Jan 1 21:12:20 2014 -0800
+
+    altos: Flip acceleration data consistently for orientation changes
+    
+    Must flip the acceleration calibration data using the same function as
+    flipping the actual acceleration data or the calibration will no
+    longer be valid after changing orientation. For the MMA655x, this
+    means using 4095 in both places, rather than using 0x7fff for the
+    calibration data changes and 4095 for the data value changes. For the
+    MPU6000, this means using 0 in both places.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit afc16e805145c3e9ab4ba948f9ab1d9aa2b27afb
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Dec 28 10:18:53 2013 -0800
+
+    altos: Add 'O' command for TeleMega orient testing
+    
+    Only present when HAS_FLIGHT_DEBUG is enabled, this command lets the
+    user check the orientation tracking code by showing the current
+    orientation and when the calibration values are reset.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 9877f6b880a0e89fbfbf1a39ded94bdc1891f3d9
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Dec 28 10:17:37 2013 -0800
+
+    altosui: Switch Graph to AltosOrient type
+    
+    The graph was using a private class for orient type, use the altoslib one
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit aa01f06acfbf029958a55f68175b6868817b333f
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Dec 28 10:16:24 2013 -0800
+
+    altosui: Adjust info table column width
+    
+    Make sure the info table can show a full longitude value
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit bbc4940730e6b431f1b9ccd9bbaf9faa0ffb2b1f
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Dec 28 10:15:26 2013 -0800
+
+    altosui: Add orient to ascent and info table views
+    
+    This adds 'tilt angle' to both ascent and info table views
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 053d092b3dca4ebb98e97ec0fe24f5f5e1c31f88
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Dec 28 10:13:05 2013 -0800
+
+    altoslib: Add AltosOrient class and max_orient()
+    
+    This adds the class necessary to put orient into a UI.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 081455dcba860f3e4df8cd66f3fe686b204034ad
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Dec 21 08:56:00 2013 -0800
+
+    altosui: Extend Fire Igniter to additional channels
+    
+    This lets the UI test fire other pyro channels on TeleMega
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 9cf9a67f937185c0c0bb5b2bae4f420755965799
+Author: Keith Packard <keithp@keithp.com>
+Date:   Sat Dec 21 06:46:46 2013 -0800
+
+    altosui: Switch from radio buttons to check boxes in pyro config. Add close
+    
+    First of (we hope) many review comments from Troj.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 9289200ccb661b10ff892760ecbc752c7745de6b
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 23:04:43 2013 -0800
+
+    altos: Turn on -Werror for STM and LPC builds
+    
+    Now that the build completes with no warnings, make future warnings
+    into errors.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 16b37b49985daf21ebb93b3d6ae64af67533be22
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 23:02:51 2013 -0800
+
+    altos: Turn on warnings for LPC products too
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit f578d9455eec9ea0eccd2d5e21349e274ea4281a
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 23:02:21 2013 -0800
+
+    altos/lpc: Missing */ in definition of PIO0_4
+    
+    Would maek using these values pretty hard.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 14790172e02d4e1624c35797f87ffd94345d54ff
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 23:00:43 2013 -0800
+
+    altos: lpc exti setup was incorrectly testing mode
+    
+    Check for NOCONFIGURE bit was missing parens
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 48f996a9d65631238b4de446530f31f83acb99f5
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 22:59:42 2013 -0800
+
+    altos: cc115l driver tone_run wasn't recording number of tones
+    
+    This would prevent the cc115l driver from ever sending tones.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit e11fcc299f4a1a0461a3442ca13f8984d76c30ff
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 22:58:10 2013 -0800
+
+    altos: Clean up warnings for LPC products
+    
+    Unused varibles, functions and parameters.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 4ed108fb86676daea17264d7159c2cff9ea7a6e4
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 22:45:56 2013 -0800
+
+    altos/stm: Turn on -Wextra
+    
+    All of the warnings for STM projects are cleaned up now
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 1406a5b0721a135913a9801e9eea9e91f0a536b4
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 22:45:01 2013 -0800
+
+    altos: Add default button return value from ao_button_get
+    
+    This "can't" happen, but it's not unreasonable to have a default
+    return value.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 316d898715746a379068ac8511692bdb9da14b39
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 22:44:20 2013 -0800
+
+    altos: unsigned value in ao_pyro_set checked for negative value
+    
+    No sense checking unsigned values for less than zero.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 5c9172ba5681ff93d63c9c263a453d0025170045
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 22:43:18 2013 -0800
+
+    altos: Clean up -Wextra warnings
+    
+    Unused variables, mismatching signed/unsigned and a few other misc
+    warnings.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit db8f3426ac1cf756a2e4974ca61a5ae9048c80ce
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 22:21:23 2013 -0800
+
+    altos: Turn on -Wall for stm compiles
+    
+    The warnings are all cleaned up now, leave this on by default
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit b31b4622d5bd92c0cc0851818f5b595dbdb60ead
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 22:15:25 2013 -0800
+
+    altos: Clean up some minor warnings from -Wall
+    
+    Unused variables, functions and labels, missing enums in switch.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 755082d36231c1b247bc0e1f13919dd9b5c362a8
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 22:13:32 2013 -0800
+
+    altos: mma655x also needs ao_sensor_errors
+    
+    TeleMetrum has an MMA655X but no IMU, so it needs an explicit addition
+    for sensor errors.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 758acb92cccbe4b64a35a1883b42713738c90630
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 22:08:11 2013 -0800
+
+    altos: Complain about sensor self-test errors only in idle mode
+    
+    When the accelerometer says to go into pad mode, don't look for other
+    sensor self test errors. Only look for sensor self test errors to
+    choose between idle and invalid mode. This will prevent minor sensor
+    self test errors from letting the rocket fly safely.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit c8b27410e45cc3d80ad4b896bffe70e9aec5e3aa
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 22:06:52 2013 -0800
+
+    altos: 3-axis accel calibration was invalid in explicit accel cal mode
+    
+    When explicit Z-axis accel calibration values were provided to the 'c
+    a' command, the 3-axis accelerometer calibration values would get set
+    to uninitialized values. Not so helpful.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 2a912dcde191e2f750845c464611641a5abdc28a
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 22:04:53 2013 -0800
+
+    altos: Execute self-test on MMA655X part
+    
+    This doesn't check for fine calibration, just makes sure the part is
+    within the broad tolerances specified by the manufacturer. The subtle fix
+    here was actually getting reset working -- there was a typo in the
+    bitpattern definition which caused the reset to fail, making it hard
+    to self-test the part, as self-test is only valid before the part is running.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit b89fb51a963635e2effe3a31f803bfc29c2c46b7
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 19:44:38 2013 -0800
+
+    altoslib: Bump library version
+    
+    Prepare for next release by making sure we notice that the API/ABI for
+    this library has changed.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 8e5f3b922100f9de54b9650df14749e81b1a6562
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 19:40:31 2013 -0800
+
+    altosui: Add imu and mag sensor values to plots
+    
+    Makes for a lot of potential graph elements.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit f65880cf5bfcba5005c32db2b300448e585f3e45
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 19:39:40 2013 -0800
+
+    altosuilib: Rearrange graph enable buttons
+    
+    Eliminate separate 'enable' radio button, provide for multiple columns
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 796cb90e3241103f79ae12565cf6f0dad21cb57c
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 19:38:29 2013 -0800
+
+    altoslib: Fetch 'orient' value from Mega Sensor packet
+    
+    The mega sensor packet had a spare byte to hold the current
+    orientation value.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 91bcfae2e64ecb2e7de1292b264910382b635aea
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Dec 20 19:37:08 2013 -0800
+
+    altoslib: Convert IMU and Mag sensor values to useful units
+    
+    Convert from raw sensor values to metric units
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 2ad31bad20b20615e9d8b29088e2488fddc81ac9
+Author: Mike Beattie <mike@ethernal.org>
+Date:   Fri Dec 20 15:06:37 2013 +1300
+
+    altosdroid: improve build system dependencies
+    
+    Signed-off-by: Mike Beattie <mike@ethernal.org>
+
+commit 0e3b3ce66035e8a90fd708d9a4bc01370174c9eb
+Author: Mike Beattie <mike@ethernal.org>
+Date:   Fri Dec 20 15:06:07 2013 +1300
+
+    altosdroid: update to latest google play services
+    
+    Signed-off-by: Mike Beattie <mike@ethernal.org>
+
+commit 96f2ae5fc0d3bf88704d2ae1b4df5dc6aefc523b
+Author: Mike Beattie <mike@ethernal.org>
+Date:   Fri Dec 20 15:05:42 2013 +1300
+
+    altosdroid: force older jarsigner signing algorithm for java 1.7
+    
+    (increment versionCode, re-upload to Play Store)
+    
+    Signed-off-by: Mike Beattie <mike@ethernal.org>
+
+commit ac12e77e3dffc9e9ddb1578a38b32783ad64e940
+Author: Bdale Garbee <bdale@gag.com>
+Date:   Thu Dec 19 03:22:21 2013 -0700
+
+    updated notes from 1.3 release
+
+commit 27528961457865acc3a38b822268df6d7cb86cfd
+Merge: 4006eff a31629d
+Author: Bdale Garbee <bdale@gag.com>
+Date:   Thu Dec 19 02:00:10 2013 -0700
+
+    Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
+
+commit 4006effc538289c36a1563c1b717231991292c0c
+Author: Bdale Garbee <bdale@gag.com>
+Date:   Thu Dec 19 01:58:24 2013 -0700
+
+    fix missing newline at end of src/test/Makefile
+
+commit a31629dfceb5e9cf1d5c654b8bd87d575f73c34b
+Author: Keith Packard <keithp@keithp.com>
+Date:   Thu Dec 19 00:58:50 2013 -0800
+
+    altosui: Ship EasyMini firmware too
+    
+    Missing the FIRMWARE_EMINI define left all easy mini firmware out of
+    the distribution
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit bc3610d8cecbfed40c62d4dcb93fc9a4d2a7c9e3
+Author: Bdale Garbee <bdale@gag.com>
+Date:   Thu Dec 19 01:29:55 2013 -0700
+
+    update ChangeLog from git
+
 commit 701c26ed85c28ac59e338975f2a6ba6bd25f6493
 Author: Keith Packard <keithp@keithp.com>
 Date:   Thu Dec 19 00:16:16 2013 -0800
index 06644fbb67b08ca09fa0f662c2bdb8e2df5d2672..02507bb9b8afeb61dc41aef632e3ac099b3d93e3 100644 (file)
@@ -17,7 +17,7 @@
 -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
           package="org.altusmetrum.AltosDroid"
-          android:versionCode="4"
+          android:versionCode="5"
           android:versionName="1.3">
     <uses-sdk android:targetSdkVersion="10" android:minSdkVersion="10"/>
     <!-- Google Maps -->
@@ -32,6 +32,7 @@
     <uses-permission android:name="android.permission.INTERNET"/>
     <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
 
     <permission android:name="org.altusmetrum.AltosDroid.permission.MAPS_RECEIVE"
                 android:protectionLevel="signature"/>
@@ -58,5 +59,7 @@
 
         <meta-data android:name="com.google.android.maps.v2.API_KEY"
                    android:value="AIzaSyDSr6u4i9TJmVGhgGk4g0wUUhTy9FGyn0s"/>
+        <meta-data android:name="com.google.android.gms.version"
+                   android:value="@integer/google_play_services_version" />
     </application>
 </manifest>
index 0473c17a85cad887e79b4757eedb67f5db37a8e2..1590e0c952697b63cf787588faa8f06534267320 100644 (file)
@@ -29,7 +29,7 @@ SUPPORT_V4=$(EXT_LIBDIR)/$(SUPPORT_V4_JAR)
 GOOGLE_PLAY_SERVICES_LIB_SRCDIR=$(SDK)/extras/google/google_play_services/libproject
 GOOGLE_PLAY_SERVICES_LIB=google-play-services_lib
 
-JAVA_SRC=$(JAVA_SRC_DIR)/*.java
+JAVA_SRC=$(JAVA_SRC_DIR)/*.java $(JAVA_SRC_DIR)/BuildInfo.java
 
 DRAWABLES=\
     $(DRAWABLE_DIR)/redled.png \
@@ -53,7 +53,7 @@ $(GOOGLE_PLAY_SERVICES_LIB): $(GOOGLE_PLAY_SERVICES_LIB_SRCDIR)/$(GOOGLE_PLAY_SE
        cp -a $(GOOGLE_PLAY_SERVICES_LIB_SRCDIR)/$(GOOGLE_PLAY_SERVICES_LIB) .
        cd $(GOOGLE_PLAY_SERVICES_LIB) && $(SDK)/tools/android update project --target $(SDK_TARGET) --path .
 
-$(JAVA_SRC_DIR)/BuildInfo.java: $(JAVA_SRC)
+$(JAVA_SRC_DIR)/BuildInfo.java: $(filter-out $(JAVA_SRC_DIR)/BuildInfo.java,$(shell echo $(JAVA_SRC)))
        ./buildinfo.sh
 
 $(DRAWABLE_DIR)/%.png: ../icon/%.png
@@ -72,18 +72,22 @@ bin/AltosDroid-debug.apk: $(SRC) $(ALTOSLIB) $(SUPPORT_V4) $(GOOGLE_PLAY_SERVICE
 bin/AltosDroid-release-unsigned.apk: $(SRC) $(ALTOSLIB) $(SUPPORT_V4) $(GOOGLE_PLAY_SERVICES_LIB)
        ant release
 
-release: bin/AltosDroid-release-unsigned.apk
-       jarsigner -keystore release.keystore \
+bin/AltosDroid-release.apk: bin/AltosDroid-release-unsigned.apk
+       jarsigner -sigalg SHA1withDSA -digestalg SHA1 \
+          -keystore release.keystore \
           -signedjar bin/AltosDroid-release-signed.apk \
           bin/AltosDroid-release-unsigned.apk AltosDroid
        $(ZIPALIGN) -f 4 \
           bin/AltosDroid-release-signed.apk \
           bin/AltosDroid-release.apk
 
+release: bin/AltosDroid-release.apk
+
 clean-local: $(GOOGLE_PLAY_SERVICES_LIB)
        ant clean
-       rm -rf $(EXT_LIBDIR)
+       rm -f $(JAVA_SRC_DIR)/BuildInfo.java
        rm -f $(DRAWABLES)
+       rm -rf $(EXT_LIBDIR)
        rm -rf $(GOOGLE_PLAY_SERVICES_LIB)
 
 else
index 643e94f5fa3f8802fef2b7985c058d4dd2deec0c..634769ccff6e7e94fc5de49ce665a735e113ec11 100644 (file)
@@ -31,7 +31,7 @@ import android.os.Handler;
 //import android.os.Message;
 import android.util.Log;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosBluetooth extends AltosLink {
 
index 92287476b7dbf56fc654c408e5ddeb8c5ba41fd4..9125d56bfa6ceed6843491b8181f91889dacb712 100644 (file)
@@ -49,7 +49,7 @@ import android.widget.Toast;
 import android.app.AlertDialog;
 import android.location.Location;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosDroid extends FragmentActivity {
        // Debugging
index 59fef84279d6c2b6985f9d192e05fd69e894dd48..067cb6208a014ce745feb1e556ac6abf4e1624de 100644 (file)
@@ -23,7 +23,7 @@ import android.content.Context;
 import android.content.SharedPreferences;
 import android.os.Environment;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosDroidPreferences implements AltosPreferencesBackend {
        public final static String        NAME    = "org.altusmetrum.AltosDroid";
index c652a1694f24b62df27f2ca829f0868ac79b0265..9d155385db3f61fee18fca876923e500d9518744 100644 (file)
@@ -17,7 +17,7 @@
 
 package org.altusmetrum.AltosDroid;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import android.location.Location;
 
 public interface AltosDroidTab {
index f17cb82171e2f54e34eca4cd799677a95bdc1d2c..b50cab2232254e8f4d68aff83d233b16a685e492 100644 (file)
@@ -21,7 +21,7 @@ package org.altusmetrum.AltosDroid;
 import android.speech.tts.TextToSpeech;
 import android.speech.tts.TextToSpeech.OnInitListener;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosVoice {
 
index 3eaf12dbd1f53ca0124794c5ebb52990d1136132..edfd82458f1392cee616a26303f1e05128a472c4 100644 (file)
@@ -17,7 +17,7 @@
 
 package org.altusmetrum.AltosDroid;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 import android.app.Activity;
 import android.os.Bundle;
index e4a954ca1603e7fc38d9ffd46558fe597463f082..cc070b0d1192dbfa14532b18bd72d4c77d09587c 100644 (file)
@@ -17,7 +17,7 @@
 
 package org.altusmetrum.AltosDroid;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 import android.app.Activity;
 import android.os.Bundle;
index 40399f2aed0df4d0fe31ad6e5fec78c0fb814d45..5a70397825a47a969f391bd45c51e924bcc73ecf 100644 (file)
@@ -17,7 +17,7 @@
 
 package org.altusmetrum.AltosDroid;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 import android.app.Activity;
 import android.os.Bundle;
index a4e224aad486ac6f3216f728868c5ce3b00d53c0..5fe88f51c3a0c39818258b833e9ab7f2083e410f 100644 (file)
@@ -19,7 +19,7 @@ package org.altusmetrum.AltosDroid;
 
 import java.util.Arrays;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 import com.google.android.gms.maps.CameraUpdateFactory;
 import com.google.android.gms.maps.GoogleMap;
index b9e878f12519be8ac4ecf2325fe668db3e1a7f6e..3f0a188703c0eda6cdbd6ec6f678e78623bec5b6 100644 (file)
@@ -17,7 +17,7 @@
 
 package org.altusmetrum.AltosDroid;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 import android.app.Activity;
 import android.os.Bundle;
index 4d793413a8983e3403775b1e6217d03b034c0435..c8c61838989d59ae48d85c31de93c481eb1accb6 100644 (file)
@@ -1,6 +1,6 @@
 package org.altusmetrum.AltosDroid;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 import android.content.BroadcastReceiver;
 import android.content.Context;
index 45604284e0767a405de80b2f5d6b8c66d77cb24a..2a2cc4040de33ead81269752adbd99716a559e4a 100644 (file)
@@ -25,7 +25,7 @@ import java.util.concurrent.*;
 import android.util.Log;
 import android.os.Handler;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 
 public class TelemetryReader extends Thread {
index 76efa74968ca557627ce2cf5495e7dbecd5b4645..96cedad81aeca07e0bce56db0c1c8e014514daac 100644 (file)
@@ -44,7 +44,7 @@ import android.location.LocationManager;
 import android.location.LocationListener;
 import android.location.Criteria;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 
 public class TelemetryService extends Service implements LocationListener {
index b838d30b23e815581f0d038bff783d6658e4574b..43dc20bd3f0a33322603da70d0eb981151f0b4cd 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosAccel extends AltosUnits {
 
index be2ec4fec48e0bd00e311ea7b6c410718e07c4ac..949627317800c07aa46e2d9c8ed5636863034b72 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosCRCException extends Exception {
        public int rssi;
index 57bb21afbccdd666a20a0f836c987eed18574fd1..47ca328e5bcd9c70f5b8721b812cbcbcd9fd5966 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosCompanion {
        public final static int board_id_telescience = 0x0a;
index 1c3085bd7efc2f39ee41bddabdb806fe82960bfd..c4e108f848e40313b6113ad9e8539231c30f1dcb 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.*;
 import java.text.*;
index fd5584c2422b0552bc4dfa4086bf288354dd69c3..4aa55d6a68085d6889fa52b4ed7aaeb79573932c 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public interface AltosConfigValues {
        /* set and get all of the dialog values */
index 8d0b74ddf475051c3d587edab328ddf28a6d3a5c..8f214c8b40c7a80fc6778a3b6806e471b76b7ad6 100644 (file)
@@ -18,7 +18,7 @@
 /*
  * Sensor data conversion functions
  */
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosConvert {
        /*
@@ -330,6 +330,8 @@ public class AltosConvert {
 
        public static AltosTemperature temperature = new AltosTemperature();
 
+       public static AltosOrient orient = new AltosOrient();
+
        public static String show_gs(String format, double a) {
                a = meters_to_g(a);
                format = format.concat(" g");
index fb11d39abac0b49e01abf532eabaca4429cb1b89..4dfb31e5ebf5860e85d9dbe542dcb91535c494f1 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 
index 8d359feb9a0cacbbd4a270a19600b5551b717cf8..71ee81d7c9ee895d1fadc7b824feb38b29f8d093 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosDistance extends AltosUnits {
 
index dd5993c763e7bc0cfd1747d81544062ca5f3e58a..57ee73adb87bfdb4b52dcf9402550c7b5c9611a6 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index c03fa931fdc0f230b307e97d726b4ea31570e23f..c884b6593af6eea75acbe7601b9f1f8be9bf3d66 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.text.*;
 import java.util.concurrent.*;
index 1b04316715809b1e42be683748112761b6e720aa..041010797837ef615b8ac7fad57c174ae9173b76 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index 60ab2573cc70e8021a638d19ca6fce06b64838b6..91ffc223764d3a909d23ba7e10fc9020e3197e32 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index 0aeb78dd36e4bf8c9772e47bb8c116fba20feaf7..6ce7ddd38516ecd3de0db752801e77b76b1202dc 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index fc793579f41837469a54c8924a6b85025d9c23e9..081721b3ecec0ac18a19dd76d69b1ab601171a85 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index 763bd1e269eb61b00585a709fccab9b1b6ea7e06..a9dac13aaa9a67623c8d28e38c58793f7b642e11 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index 95c0c3f6c5bcb272ba8db7b8cfbd89b8640d198c..cc2982071432db8f0f987ba6f7f06466042850b1 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.text.*;
 import java.util.concurrent.*;
index 7a4ee52d10680e1e61c3289bb029a12e079b444c..1ac72b1c4f5d65e491de6fc548d2d8238ff330ae 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
@@ -115,19 +115,19 @@ public class AltosEepromMega extends AltosEeprom {
                        state.set_ms5607(pres(), temp());
 
                        AltosIMU imu = new AltosIMU();
-                       imu.accel_x = accel_x();
-                       imu.accel_y = accel_y();
-                       imu.accel_z = accel_z();
+                       imu.accel_x = AltosIMU.convert_accel(accel_x());
+                       imu.accel_y = AltosIMU.convert_accel(accel_y());
+                       imu.accel_z = AltosIMU.convert_accel(accel_z());
 
-                       imu.gyro_x = gyro_x();
-                       imu.gyro_y = gyro_y();
-                       imu.gyro_z = gyro_z();
+                       imu.gyro_x = AltosIMU.convert_gyro(gyro_x());
+                       imu.gyro_y = AltosIMU.convert_gyro(gyro_y());
+                       imu.gyro_z = AltosIMU.convert_gyro(gyro_z());
                        state.imu = imu;
 
                        AltosMag mag = new AltosMag();
-                       mag.x = mag_x();
-                       mag.y = mag_y();
-                       mag.z = mag_z();
+                       mag.x = AltosMag.convert_gauss(mag_x());
+                       mag.y = AltosMag.convert_gauss(mag_y());
+                       mag.z = AltosMag.convert_gauss(mag_z());
 
                        state.mag = mag;
 
index c1d62c0c7663fd8c64bdb078657dc3e0fe40512e..f1bca6dc14344b118597ce25dafc1eb877e7f453 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index a09a62ceb6adfd4e24e95733a773c672f82367dc..fb3b4d23b6d7fbafe5868c948d49563322f123da 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index eeef0678ad7f01e041bc609b1d640af7e2cf472b..9ab1a5ab103acd402e3f25cd4b5f8379ff20ba30 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public interface AltosEepromMonitor {
 
index 36803912b2c7a5ddc0410ed75ac825a7fb86a6fe..c8b1e60cb450d06151839a6d71019d8c87c3a04c 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index b8914131532a6188c90be7595c0682a199ca064d..049dd340612568cb56f6002ae62740e0526a52b7 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index f39c3962a3f42b7e56dd2510a9c05dee871ff2b6..37bf70751a7a88dba353e0dea09f36d4d14cd355 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2
+package org.altusmetrum.altoslib_3
 
 import java.io.File;
 import java.util.*;
index 0977070e2a2883adba4a49b772712c5c6dd436b0..25c76863b6b037de0fbd50605cc49caa607fb647 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 
index 777ae635bf3ec24475ec3bda2b80d44df98fd941..b7fcd73bfae19b0b6a329a4897666b7a24adcc69 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public interface AltosFlashListener {
        public void position(String label, int percent);
index b251e7ccdd53ad37394d11f16251408b611c0813..86757e8272521a1b2e474e0a8c6b11027137678e 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.text.*;
 import java.io.*;
index ece7525ad848d78408d432c328dac7235c6d3ece..5770b646ae36a1f4175083534fc4e9743c4ef8a2 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosFrequency {
        public double   frequency;
index f5162225ac200c08edb3359f8865545e5024075d..01e6fdbccf5575ba56ef838aeb3a8780163bd375 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.text.*;
 import java.util.concurrent.*;
index 0e17d7f24d9eca661543f1ce3eeb56f17f8fd129..76fa3a560015c304038f19de1b7fb31ec555569f 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosGPSSat {
        public int      svid;
index 2c84bf4a27534c607f0c517215e41f354fc0000d..b884a3bc210712fbe190f15727800d6309005628 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.lang.Math;
 
index 84bd42d91589e1324bf1cb5dc825e5f9ca488269..a81897e7c4a533bcfabb47d0f32cfbf0c6a5303d 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosHeight extends AltosUnits {
 
index 717c1c5d813778ba73ed6d5755527c83d86f6f53..60f4ecdc5012f64f1b64d61c5fc18c0c06682203 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.LinkedList;
index 810a480380ceb73b420c4b5e561f25e08cf018fd..a98ef0fc13223eb161d759670871fee19dd3d9d6 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosHexsym {
        String  name;
index 6d88ccae9a45f6a45926444528db9debc04993b4..260f35876aff359df7e49ae12edff4ea4fa9217a 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.concurrent.*;
 
 public class AltosIMU implements Cloneable {
-       public int              accel_x;
-       public int              accel_y;
-       public int              accel_z;
+       public double           accel_x;
+       public double           accel_y;
+       public double           accel_z;
 
-       public int              gyro_x;
-       public int              gyro_y;
-       public int              gyro_z;
+       public double           gyro_x;
+       public double           gyro_y;
+       public double           gyro_z;
+
+       public static int       counts_per_g = 2048;
+
+       public static double convert_accel(int counts) {
+               return (double) counts / (double) counts_per_g * (-AltosConvert.GRAVITATIONAL_ACCELERATION);
+       }
+
+       public static double    counts_per_degsec = 16.4;
+
+       public static double convert_gyro(int counts) {
+               return (double) counts / counts_per_degsec;
+       }
 
        public boolean parse_string(String line) {
                if (!line.startsWith("Accel:"))
@@ -35,12 +47,12 @@ public class AltosIMU implements Cloneable {
                String[] items = line.split("\\s+");
 
                if (items.length >= 8) {
-                       accel_x = Integer.parseInt(items[1]);
-                       accel_y = Integer.parseInt(items[2]);
-                       accel_z = Integer.parseInt(items[3]);
-                       gyro_x = Integer.parseInt(items[5]);
-                       gyro_y = Integer.parseInt(items[6]);
-                       gyro_z = Integer.parseInt(items[7]);
+                       accel_x = convert_accel(Integer.parseInt(items[1]));
+                       accel_y = convert_accel(Integer.parseInt(items[2]));
+                       accel_z = convert_accel(Integer.parseInt(items[3]));
+                       gyro_x = convert_gyro(Integer.parseInt(items[5]));
+                       gyro_y = convert_gyro(Integer.parseInt(items[6]));
+                       gyro_z = convert_gyro(Integer.parseInt(items[7]));
                }
                return true;
        }
index 456a9247194d20e6a87d2a1ba8839dd6670ecacd..c7b546b6c67e350592e689932e4ff69eb789fee1 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index 4adc6c41d9d619feb5700c733bcc252d9b6a05d0..02cb7a947a30b4df6a8e766c733f280b05b54342 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index d9d71143a0f5f4fea10ea535e00498fcc5e2fdd6..8342f8a53d9da17ce3fc0f9cb29b16ba7fbf95fd 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.concurrent.*;
index 0b03b897ae3139ebb27ef7c12a26976e61885aaa..dcaa77a6c8f21058f337a106667c74fe59a7a728 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public interface AltosIdleMonitorListener {
        public void update(AltosState state, AltosListenerState listener_state);
index fc9599b65ce4cb8aa44ed66dc31011240d5b5b7f..8ab47d1de49a9ba8c54e6327ca096addd5334563 100644 (file)
@@ -15,8 +15,9 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
+import java.util.*;
 import java.io.*;
 import java.util.concurrent.*;
 
@@ -24,10 +25,13 @@ public class AltosIgnite {
        AltosLink       link;
        boolean         remote;
        boolean         link_started;
+       boolean         have_npyro = false;
+       int             npyro;
+       AltosConfigData config_data;
 
-       public final static int None = 0;
-       public final static int Apogee = 1;
-       public final static int Main = 2;
+       public final static String      None = null;
+       public final static String      Apogee = "drogue";
+       public final static String      Main = "main";
 
        public final static int Unknown = 0;
        public final static int Ready = 1;
@@ -81,7 +85,7 @@ public class AltosIgnite {
        }
        */
 
-       private int status(String status_name) {
+       private int map_status(String status_name) {
                if (status_name.equals("unknown"))
                        return Unknown;
                if (status_name.equals("ready"))
@@ -93,13 +97,38 @@ public class AltosIgnite {
                return Unknown;
        }
 
-       public int status(int igniter) throws InterruptedException, TimeoutException {
-               int status = Unknown;
+       private void get_npyro() throws InterruptedException, TimeoutException {
+               if (config_data == null)
+                       config_data = new AltosConfigData(link);
+               if (config_data != null)
+                       npyro = config_data.npyro;
+               else
+                       npyro = 0;
+               have_npyro = true;
+       }
+
+       public int npyro() throws InterruptedException, TimeoutException {
+               if (!have_npyro) {
+                       start_link();
+                       get_npyro();
+                       stop_link();
+               }
+               return npyro;
+       }
+
+       public HashMap<String,Integer> status() throws InterruptedException, TimeoutException {
+               HashMap<String,Integer> status = new HashMap<String,Integer>();
+
                if (link == null)
                        return status;
-               //string_ref status_name = new string_ref();
                try {
                        start_link();
+                       get_npyro();
+
+                       String last_igniter = Main;
+                       if (npyro > 0)
+                               last_igniter = String.format("%d", npyro - 1);
+
                        link.printf("t\n");
                        for (;;) {
                                String line = link.get_reply(5000);
@@ -116,14 +145,10 @@ public class AltosIgnite {
                                if (!items[2].equals("Status:"))
                                        continue;
 
-                               if (items[1].equals("drogue")) {
-                                       if (igniter == Apogee)
-                                               status = status(items[3]);
-                               } else if (items[1].equals("main")) {
-                                       if (igniter == Main)
-                                               status = status(items[3]);
+                               status.put(items[1], map_status(items[3]));
+
+                               if (items[1].equals(last_igniter))
                                        break;
-                               }
                        }
                } finally {
                        stop_link();
@@ -141,19 +166,12 @@ public class AltosIgnite {
                }
        }
 
-       public void fire(int igniter) throws InterruptedException {
+       public void fire(String igniter) throws InterruptedException {
                if (link == null)
                        return;
                try {
                        start_link();
-                       switch (igniter) {
-                       case Main:
-                               link.printf("i DoIt main\n");
-                               break;
-                       case Apogee:
-                               link.printf("i DoIt drogue\n");
-                               break;
-                       }
+                       link.printf("i DoIt %s\n", igniter);
                } catch (TimeoutException te) {
                } finally {
                        stop_link();
index efbc3ddbe69c15f57bee5ae272673d2749c14b77..05f0af8df5d4fa518191dc7e1a96c88c0e4772a1 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.*;
 import java.io.*;
index e5dd13fc2901c7d582be2c937ea7560409454e75..9d796a896f38e8cb880c9b982e1b671c2fa74289 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosLine {
        public String   line;
index ee1f9785bb7a111158edceb3cc249afa0f5f3014..8346d281f1e2a0be012f2b69fcef15fa302e04e8 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.concurrent.*;
index 01dd7afb4e6f7b9a6c7e52adec741584d0c1a31c..53ed33f9219d2b26e69114137a164b774c3b7a4b 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosListenerState {
        public int      crc_errors;
index d4fbee97bc47e491a326bf33135a6e9424fb7039..70c017b7df950c2353ed21d57346b9b6305f72fc 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.text.*;
index 89e72bd6e5983153dcacb499011a254369aa946f..d2bb9da6fbe086430a92c03be434fb844a4b1bf0 100644 (file)
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.concurrent.*;
 
 public class AltosMag implements Cloneable {
-       public int              x;
-       public int              y;
-       public int              z;
+       public double           x;
+       public double           y;
+       public double           z;
+
+       public static double counts_per_gauss = 1090;
+
+       public static double convert_gauss(int counts) {
+               return (double) counts / counts_per_gauss;
+       }
 
        public boolean parse_string(String line) {
 //             if (line.startsWith("Syntax error")) {
@@ -36,9 +42,9 @@ public class AltosMag implements Cloneable {
                String[] items = line.split("\\s+");
 
                if (items.length >= 6) {
-                       x = Integer.parseInt(items[1]);
-                       y = Integer.parseInt(items[3]);
-                       z = Integer.parseInt(items[5]);
+                       x = convert_gauss(Integer.parseInt(items[1]));
+                       y = convert_gauss(Integer.parseInt(items[3]));
+                       z = convert_gauss(Integer.parseInt(items[5]));
                }
                return true;
        }
index f825619016d515d952a46978ff8926caae272314..0d90c351a8e7f21e1ee222fe0da29fd6accea4ff 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.concurrent.*;
 
index 2319d5b821b833becd9cd72c37b796caca051aa6..97d08c3ea7c894f6f74be8515b6d0aaf0b5ed7ae 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.concurrent.*;
 
index e94687cd002b959950a76f44798ccb87d278f78f..791899c06706f3ea48e17c71dec7079af9c2ebcd 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosNoSymbol extends Exception {
        public AltosNoSymbol(String name) {
diff --git a/altoslib/AltosOrient.java b/altoslib/AltosOrient.java
new file mode 100644 (file)
index 0000000..d916a0f
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright Â© 2013 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+package org.altusmetrum.altoslib_3;
+
+public class AltosOrient extends AltosUnits {
+
+       public double value(double p, boolean imperial_units) {
+               return p;
+       }
+
+       public double inverse(double p, boolean imperial_units) {
+               return p;
+       }
+
+       public String show_units(boolean imperial_units) {
+               return "°";
+       }
+
+       public String say_units(boolean imperial_units) {
+               return "degrees";
+       }
+
+       public int show_fraction(int width, boolean imperial_units) {
+               return 0;
+       }
+}
\ No newline at end of file
index ca96a8f94385aeb3877458628b33afb1293d48e0..5137fef8caddc1c34da4bccb2c47e0771e822074 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.text.*;
 
index c4051f9b58e2155a56a5a81e8ebf7d186d7f87fb..b8920d266c2324ef01474c7f3c7133aa59a3425d 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index 1ea28b0131ab11510ea7fe719680036e3fc1cb81..2eb29702c322a221e87bcfce959828d7ce6dd12a 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.File;
 
index b010d56484e185cd158aa20b7689a51ec341491f..750e1f02b7e2655660cb25c87186a2f69290c30e 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 
index a219468c7468cfe0c6c11607b14073b167c4deeb..aefc6fbda7d7383441e3673fd35771bd564b03f2 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.*;
 import java.text.*;
index 19091d3dfd22cea4055948b566e6548f61689c0c..4cf642ca43801e378181bab6189adbdefca47dea 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index 2f106deb8223aca4be55d391d091da5a4ef6ff1a..1273fbc605e2b95aad949482bfd92e5ffec87643 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 
index 3bf7ce41f3c689a87a9f382770b877c7e20293d8..aae993ebc368731fb42899a67303d6212a27cb1c 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 
index 5f9eed55238fe2d3f68fdcf4a44f76f16d8d27dd..f888754c80ea812ee953b1f0d054cbc476dfb44e 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.concurrent.TimeoutException;
 
index 0ef42cf683e372938d951ddd788ec0dad0c7f4c9..0c23d671cfe8128f2d207c882d83d7c15beec9ce 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.concurrent.TimeoutException;
 
index e715242a268219556679bab842339d7b8272002c..c52f688d6495f459c4337dae879edc6e2a70e765 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.concurrent.TimeoutException;
 
index c30eaebd9a15ce60632d37162f47330fadb883d5..bb794a1e598f04f624b76a77a47b3a6cf0baf7ee 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.concurrent.TimeoutException;
 
index f867de4b8efa5dc0eb0f8b410cdbd1732d382568..b8f54bcb257845f4a11c357a230055b80e018c2a 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.concurrent.TimeoutException;
 
index ee03091065881debdce275e1f02788dc01854193..35857e350113e4ef24c06e1dbf223252278619f1 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.util.concurrent.TimeoutException;
 
index 6618c539eed867c3beda5f993b35796c096e15a0..d93229dd0a3837d0a6bfaa59010a91bd6ba7668f 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosSpeed extends AltosUnits {
 
index 6d55b833b83a5bf1a8878d10d6e45b539a71b088..08dafbb4c8ad6d12333e458638e6732abc04aede 100644 (file)
@@ -19,7 +19,7 @@
  * Track flight state from telemetry or eeprom data stream
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosState implements Cloneable {
 
@@ -464,6 +464,20 @@ public class AltosState implements Cloneable {
                return acceleration.max();
        }
 
+       public AltosValue       orient;
+
+       public void set_orient(double new_orient) {
+               orient.set(new_orient, time);
+       }
+
+       public double orient() {
+               return orient.value();
+       }
+
+       public double max_orient() {
+               return orient.max();
+       }
+
        public AltosValue       kalman_height, kalman_speed, kalman_acceleration;
 
        public void set_kalman(double height, double speed, double acceleration) {
@@ -560,6 +574,7 @@ public class AltosState implements Cloneable {
                pressure = new AltosPressure();
                speed = new AltosSpeed();
                acceleration = new AltosAccel();
+               orient = new AltosValue();
 
                temperature = AltosLib.MISSING;
                battery_voltage = AltosLib.MISSING;
@@ -621,6 +636,7 @@ public class AltosState implements Cloneable {
                pressure.finish_update();
                speed.finish_update();
                acceleration.finish_update();
+               orient.finish_update();
 
                kalman_height.finish_update();
                kalman_speed.finish_update();
@@ -665,6 +681,7 @@ public class AltosState implements Cloneable {
                pressure.copy(old.pressure);
                speed.copy(old.speed);
                acceleration.copy(old.acceleration);
+               orient.copy(old.orient);
 
                battery_voltage = old.battery_voltage;
                pyro_voltage = old.pyro_voltage;
@@ -932,14 +949,8 @@ public class AltosState implements Cloneable {
        }
 
        void update_accel() {
-               double  ground = ground_accel;
-
-               if (ground == AltosLib.MISSING)
-                       ground = ground_accel_avg;
                if (accel == AltosLib.MISSING)
                        return;
-               if (ground == AltosLib.MISSING)
-                       return;
                if (accel_plus_g == AltosLib.MISSING)
                        return;
                if (accel_minus_g == AltosLib.MISSING)
@@ -947,7 +958,7 @@ public class AltosState implements Cloneable {
 
                double counts_per_g = (accel_minus_g - accel_plus_g) / 2.0;
                double counts_per_mss = counts_per_g / 9.80665;
-               acceleration.set_measured((ground - accel) / counts_per_mss, time);
+               acceleration.set_measured((accel_plus_g - accel) / counts_per_mss, time);
        }
 
        public void set_accel_g(double accel_plus_g, double accel_minus_g) {
@@ -959,10 +970,8 @@ public class AltosState implements Cloneable {
        }
 
        public void set_ground_accel(double ground_accel) {
-               if (ground_accel != AltosLib.MISSING) {
+               if (ground_accel != AltosLib.MISSING)
                        this.ground_accel = ground_accel;
-                       update_accel();
-               }
        }
 
        public void set_accel(double accel) {
index 6d63741947e715bb30ec2a8facf1e08a32e3e0e9..5a919b66c40a5565d047333e18aaa065535ce8cf 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index 97a5dfe2464186f39ca7e25880886d32dca65cea..4614c67a1f0db70397be7747a77158b9e93c9691 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public interface AltosStateUpdate {
        public void     update_state(AltosState state) throws InterruptedException;
index 03ca9f80504bafa4b3b418bf43924a6b36686b14..01bedd5e71173f759e3545440b62a7730bda5d91 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.text.*;
 
index e5d444dd2099beadc728addd9fe0a4180d7b49c6..67a437489294f28291dc5ea3e0c8ca7f0fef165c 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 
 public class AltosTelemetryConfiguration extends AltosTelemetryStandard {
index 7566d9466bffc543ee01243c88d9c20ee9e6bfbc..09d7d3f8ce26c02432892527d170b8264ddf3c9b 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index bf30b4c88b0906cb948684be2d52a27b2c3c8c65..002f53b4eacdc86f3dfdfd0223d29143b5c620fb 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.io.*;
 import java.util.*;
index 132b9e80f342f5d5a28eee1c6a2e431ba78959bd..d302adddb487b54956793d2f083c950c461410a0 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.text.*;
 
index 6e880914f36c36ea1ef1285ff0de14003daaf5c3..8dcda9e173abf75f67fef1077c43502a208166fe 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 
 public class AltosTelemetryLocation extends AltosTelemetryStandard {
index 37883a1c47e838b19cf5e562eed21e220142edef..37b2527b663b410466e619cf1adf7bb1e565d913 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 import java.text.*;
 import java.util.HashMap;
 
index f5cc01d07a5d1913ebad9d7629e6fdde4fe0d43f..a4df70bee80ed084f1c17723802c594590b0c4b3 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosTelemetryMegaData extends AltosTelemetryStandard {
        int     state;
index 23b67af8b03e8a37ba82a172b28b0ae54625d874..d1a463c06cd8ede43dd8252c7eec6216acdfcf95 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosTelemetryMegaSensor extends AltosTelemetryStandard {
        int     accel;
@@ -34,9 +34,12 @@ public class AltosTelemetryMegaSensor extends AltosTelemetryStandard {
        int     mag_y;
        int     mag_z;
 
+       int     orient;
+
        public AltosTelemetryMegaSensor(int[] bytes) {
                super(bytes);
 
+               orient        = int8(5);
                accel         = int16(6);
                pres          = int32(8);
                temp          = int16(12);
@@ -61,23 +64,25 @@ public class AltosTelemetryMegaSensor extends AltosTelemetryStandard {
                state.set_pressure(pres);
                state.set_temperature(temp / 100.0);
 
+               state.set_orient(orient);
+
                AltosIMU imu = new AltosIMU();
                
-               imu.accel_x = accel_x;
-               imu.accel_y = accel_y;
-               imu.accel_z = accel_z;
+               imu.accel_x = AltosIMU.convert_accel(accel_x);
+               imu.accel_y = AltosIMU.convert_accel(accel_y);
+               imu.accel_z = AltosIMU.convert_accel(accel_z);
 
-               imu.gyro_x = gyro_x;
-               imu.gyro_y = gyro_y;
-               imu.gyro_z = gyro_z;
+               imu.gyro_x = AltosIMU.convert_gyro(gyro_x);
+               imu.gyro_y = AltosIMU.convert_gyro(gyro_y);
+               imu.gyro_z = AltosIMU.convert_gyro(gyro_z);
 
                state.imu = imu;
 
                AltosMag mag = new AltosMag();
 
-               mag.x = mag_x;
-               mag.y = mag_y;
-               mag.z = mag_z;
+               mag.x = AltosMag.convert_gauss(mag_x);
+               mag.y = AltosMag.convert_gauss(mag_y);
+               mag.z = AltosMag.convert_gauss(mag_z);
 
                state.mag = mag;
        }
index b623997195ad5a1fb4887f9566f8e81661eaa7ac..b8f7e9ea6768fb045664b8faeda104db286211ce 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 
 public class AltosTelemetryMetrumData extends AltosTelemetryStandard {
index fc047afd9a59391f3888170bbb7c30d3d12e60ac..232468bbf67ca5967d42f4d4f8996f1ffee09b5c 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 
 public class AltosTelemetryMetrumSensor extends AltosTelemetryStandard {
index e71094609f91b231eb48aba0ea27d1f6675037ed..e0a493dc06c7c6c3eb5afed0ab44d06a9c7aa960 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 
 public class AltosTelemetryMini extends AltosTelemetryStandard {
index dbe70fe9e7066cd470d238a40e23e5fb92ae5283..91cfbb18d5e23320fd8fe2d8c9bb0827d4248bfe 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosTelemetryRaw extends AltosTelemetryStandard {
        public AltosTelemetryRaw(int[] bytes) {
index eeb35cb51c6579e141678d4c2cce352b9d3eb6d2..5e28358762c72e9ca51f013efa782ae5742529db 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 import java.text.*;
 import java.io.*;
index fde3d86d133de914a8c01ff49a9634e87ba78399..01252bdea92a81186e176b0d2b9fccc52da96abb 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosTelemetrySatellite extends AltosTelemetryStandard {
        int             channels;
index e1106440c352f43e7fe689bae7d6a6367fb3a7d3..d6389865c15197e8a90310b45bbcc3cc54486e9b 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 
 public class AltosTelemetrySensor extends AltosTelemetryStandard {
index 3186ae097c8460737156bbb3b516a739f76bc18a..c9531fcb3fcd0470de446f4d1aa1fcb174b6f6c7 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public abstract class AltosTelemetryStandard extends AltosTelemetry {
        int[]   bytes;
index a636533f5e7c95c5cc639906c5d50bb0cbb19ba2..36e2656436827614f7fa7e221d4fe3838753193b 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public class AltosTemperature extends AltosUnits {
 
index 8f9ccded5f4e8659c93085d30c57b709f5ec6150..e573a43b7f1e2289e0051006d5680772317a494e 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public abstract class AltosUnits {
 
index 1e3ad6556888b4881c6a6bcbc32aa9066aa14ea0..e9b29f9a866a23722aeb64fac49438b7eddf90e4 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
 
 public interface AltosUnitsListener {
        public void units_changed(boolean imperial_units);
index 6d396635905ab2e6bbacb0d48485442940797290..2ee4d89f635e97db90b065c08d95d296b58d165c 100644 (file)
@@ -70,6 +70,7 @@ altoslib_JAVA = \
        AltosMma655x.java \
        AltosMs5607.java \
        AltosNoSymbol.java \
+       AltosOrient.java \
        AltosParse.java \
        AltosPreferences.java \
        AltosPreferencesBackend.java \
index 07280b4ae1c5af8e776c6a288aef54b42294b8da..4b171fa77512f7de17a3a5c827d8bdab389b209b 100644 (file)
@@ -20,7 +20,7 @@ package altosui;
 import java.awt.*;
 import libaltosJNI.*;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class Altos extends AltosUILib {
index ba4fc614bfc70646ddbbcda8e3a7eebf05459964..3f74fdd1a481224c0db121c8dab2cc9ad7a5190a 100644 (file)
@@ -19,7 +19,7 @@ package altosui;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosAscent extends JComponent implements AltosFlightDisplay {
        GridBagLayout   layout;
@@ -271,6 +271,17 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
 
        Accel   accel;
 
+       class Orient extends AscentValueHold {
+               void show (AltosState state, AltosListenerState listener_state) {
+                       show(AltosConvert.orient, state.orient());
+               }
+               public Orient (GridBagLayout layout, int y) {
+                       super (layout, y, "Tilt Angle");
+               }
+       }
+
+       Orient  orient;
+
        String pos(double p, String pos, String neg) {
                String  h = pos;
                if (p < 0) {
@@ -342,6 +353,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
                height.reset();
                speed.reset();
                accel.reset();
+               orient.reset();
        }
 
        public void set_font() {
@@ -354,6 +366,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
                height.set_font();
                speed.set_font();
                accel.set_font();
+               orient.set_font();
        }
 
        public void show(AltosState state, AltosListenerState listener_state) {
@@ -375,6 +388,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
                        apogee.hide();
                speed.show(state, listener_state);
                accel.show(state, listener_state);
+               orient.show(state, listener_state);
        }
 
        public void labels(GridBagLayout layout, int y) {
@@ -410,13 +424,15 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
                 * lon
                 * height
                 */
-               labels(layout, 0);
-               height = new Height(layout, 1);
-               speed = new Speed(layout, 2);
-               accel = new Accel(layout, 3);
-               lat = new Lat(layout, 4);
-               lon = new Lon(layout, 5);
-               apogee = new Apogee(layout, 6);
-               main = new Main(layout, 7);
+               int y = 0;
+               labels(layout, y++);
+               height = new Height(layout, y++);
+               speed = new Speed(layout, y++);
+               accel = new Accel(layout, y++);
+               orient = new Orient(layout, y++);
+               lat = new Lat(layout, y++);
+               lon = new Lon(layout, y++);
+               apogee = new Apogee(layout, y++);
+               main = new Main(layout, y++);
        }
 }
index a1652ec4e0a6a893d53b96a4009fc20ea5f5c04b..968d72d5466a42451699485ca589fce00372b76f 100644 (file)
@@ -17,7 +17,7 @@
 
 package altosui;
 import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosBTKnown implements Iterable<AltosBTDevice> {
index 7598eca00ffce570a58fcb30e8103228fb626e48..13f29f07f686e097f89cf597ad5658d5b44f78cf 100644 (file)
@@ -19,7 +19,7 @@ package altosui;
 
 import java.io.*;
 import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosCSV implements AltosWriter {
        File                    name;
index c41ea74b5190dba3a7c5868db374cfec20db9613..05cabcdf4bcc68a4b6ccfe2e9d1ab7463ce3030a 100644 (file)
@@ -21,7 +21,7 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosCSVUI
index 1f446700218827c64ff1ff6673df8cf1654f2156..4cc6c462f28e948bbadad37c0b03da90299f538c 100644 (file)
@@ -19,7 +19,7 @@ package altosui;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosCompanionInfo extends JTable {
        private AltosFlightInfoTableModel model;
index 206cbee3e57bf2fd718d124f09da374ad2b167fd..e1805fc12be91d70b1365f86d08dc8e019985ea1 100644 (file)
@@ -22,7 +22,7 @@ import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.text.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosConfig implements ActionListener {
index 555af3b6b69ffdc8c12abd03f4dcbd8de98a384e..e9923a32ac78ce4cbe703ef7d24f6f159124cd92 100644 (file)
@@ -21,7 +21,7 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 class AltosEditFreqUI extends AltosUIDialog implements ActionListener {
index 81d121119acce8c580343078132213a95f9a9bd5..47b2b662bb5ac7b49d4804527384cfc2feb85599 100644 (file)
@@ -21,12 +21,12 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import javax.swing.event.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosConfigPyroUI
        extends AltosUIDialog
-       implements ItemListener, DocumentListener, AltosUnitsListener
+       implements ItemListener, DocumentListener, AltosUnitsListener, ActionListener
 {
        AltosConfigUI   owner;
        Container       pane;
@@ -48,7 +48,7 @@ public class AltosConfigPyroUI
        class PyroItem implements ItemListener, DocumentListener, AltosUnitsListener
        {
                public int              flag;
-               public JRadioButton     enable;
+               public JCheckBox        enable;
                public JTextField       value;
                public JComboBox        combo;
                AltosConfigPyroUI       ui;
@@ -146,7 +146,7 @@ public class AltosConfigPyroUI
                        c.fill = GridBagConstraints.NONE;
                        c.anchor = GridBagConstraints.LINE_START;
                        c.insets = il;
-                       enable = new JRadioButton();
+                       enable = new JCheckBox();
                        enable.addItemListener(this);
                        pane.add(enable, c);
                        
@@ -309,6 +309,14 @@ public class AltosConfigPyroUI
                }
        }
 
+       /* Listen for events from our buttons */
+       public void actionPerformed(ActionEvent e) {
+               String  cmd = e.getActionCommand();
+
+               if (cmd.equals("Close"))
+                       setVisible(false);
+       }
+
        public AltosConfigPyroUI(AltosConfigUI in_owner, AltosPyro[] pyros) {
 
                super(in_owner, "Configure Pyro Channels", false);
@@ -353,6 +361,17 @@ public class AltosConfigPyroUI
                        columns[i] = new PyroColumn(this, i*2 + 1, 0, i);
                        columns[i].set(pyros[i]);
                }
+
+               c = new GridBagConstraints();
+               c.gridx = pyros.length*2-1;
+               c.fill = GridBagConstraints.HORIZONTAL;
+               c.gridwidth = 2;
+               c.gridy = 1000;
+               JButton close = new JButton("Close");
+               pane.add(close, c);
+               close.addActionListener(this);
+               close.setActionCommand("Close");
+               
                addWindowListener(new ConfigListener(this, owner));
                AltosPreferences.register_units_listener(this);
        }
index f879ff88bcdef1324db4714e8e16a7a0c9487cd1..ad9ebbfacf82b4ab8a3ad479713f949b30850935 100644 (file)
@@ -21,7 +21,7 @@ import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosConfigTD implements ActionListener {
index b5a6cd7c3fdd8ee6a355bb3d5daeea882722ac98..3ce0d98c1c8068a48eaa0370cc3674bc6d0ccc73 100644 (file)
@@ -21,7 +21,7 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import javax.swing.event.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosConfigTDUI
index a7d95903ae25d828dc14c214419ed492fdcf3e38..21ea50e638f6bb21ddcab43dd0c5009c2b67bfb9 100644 (file)
@@ -21,7 +21,7 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import javax.swing.event.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosConfigUI
index c0d6668279574e051dfafdf0dce2e097b12016f4..a9344a01c832ed0c96b52918a4feb056cb4e1d0d 100644 (file)
@@ -20,7 +20,7 @@ package altosui;
 import javax.swing.*;
 import javax.swing.filechooser.FileNameExtensionFilter;
 import java.io.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosDataChooser extends JFileChooser {
index e73d990cb5ccde177ee73e818ae5514b30195c6a..d1379083feed0d11f9e5bb18ac17612bcb762b79 100644 (file)
@@ -19,7 +19,7 @@ package altosui;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosDescent extends JComponent implements AltosFlightDisplay {
        GridBagLayout   layout;
index 4b4cc3b9ac2aee901b5e633228eb2142b15ad4e9..2a33f996ac52418d0d07eeb2ae715c2d5326b81e 100644 (file)
@@ -21,7 +21,7 @@ import java.awt.*;
 import javax.swing.*;
 import java.io.*;
 import java.text.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosDisplayThread extends Thread {
 
index 9984d1a2420d37fe247688ab0c735e853967b26b..b2d2e291f0be03ab43fd5e16ef9851c2c2278357 100644 (file)
@@ -21,7 +21,7 @@ import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosEepromDelete implements Runnable {
        AltosEepromList         flights;
index da0a977733083696bacd66870a42f5118ddb6646..e363557141547dc0d92f46719b924ee010ec7c57 100644 (file)
@@ -21,7 +21,7 @@ import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosEepromManage implements ActionListener {
index 6ad4ca5c54a1f5cd0330e70af8efe15823b19bb9..c2e925a26f6c730a74c36156d2b91450fac1b351 100644 (file)
@@ -21,7 +21,7 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import org.altusmetrum.altosuilib_1.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosEepromMonitorUI extends AltosUIDialog implements AltosEepromMonitor {
        JFrame          owner;
index 8f86eebff55436ec04e8cf7bfbb4349af0b2bf07..b7cdbb72fc6a446eb5ad269696cf017c503d6daf 100644 (file)
@@ -21,7 +21,7 @@ import javax.swing.*;
 import javax.swing.border.*;
 import java.awt.*;
 import java.awt.event.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 class AltosEepromItem implements ActionListener {
index 296ad8ef9d761997aebf142704e1d4c6b5adde0a..5913e50699c2f390a597b1b828407476f608661f 100644 (file)
@@ -23,7 +23,7 @@ import javax.swing.*;
 import javax.swing.filechooser.FileNameExtensionFilter;
 import java.io.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosFlashUI
index 289ddd01b66ac9a87bd4d351c638f38e2c59bfb3..c12642592790f92465794fdf722d97a50b869161 100644 (file)
@@ -17,7 +17,7 @@
 
 package altosui;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public interface AltosFlightDisplay {
        void reset();
index 552210c36adac61f13cc1c4c617903a208b9d8ba..bf5644c39888a26940df8fbb866836fe5ad32968 100644 (file)
@@ -18,7 +18,7 @@
 package altosui;
 
 import java.io.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosFlightStats {
        double          max_height;
@@ -38,6 +38,9 @@ public class AltosFlightStats {
        boolean         has_gps;
        boolean         has_other_adc;
        boolean         has_rssi;
+       boolean         has_imu;
+       boolean         has_mag;
+       boolean         has_orient;
 
        double landed_time(AltosStateIterable states) {
                AltosState state = null;
@@ -108,6 +111,9 @@ public class AltosFlightStats {
                has_gps = false;
                has_other_adc = false;
                has_rssi = false;
+               has_imu = false;
+               has_mag = false;
+               has_orient = false;
                for (AltosState state : states) {
                        if (serial == AltosLib.MISSING && state.serial != AltosLib.MISSING)
                                serial = state.serial;
@@ -157,6 +163,12 @@ public class AltosFlightStats {
                                lon = state.gps.lon;
                                has_gps = true;
                        }
+                       if (state.imu != null)
+                               has_imu = true;
+                       if (state.mag != null)
+                               has_mag = true;
+                       if (state.orient() != AltosLib.MISSING)
+                               has_orient = true;
                }
                for (int s = Altos.ao_flight_startup; s <= Altos.ao_flight_landed; s++) {
                        if (state_count[s] > 0) {
index db875b3bb70fac4bc9cc10a8e14fedfa24725fe9..3e7e9fe11c5737878798985b5e73262aeba30dbc 100644 (file)
@@ -19,7 +19,7 @@ package altosui;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosFlightStatsTable extends JComponent {
        GridBagLayout   layout;
index 9d575e4c8897ebb8c14e651ca94e5c64712348d7..c6d75420fba38af29e9f237097e53481f56ad610 100644 (file)
@@ -19,7 +19,7 @@ package altosui;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosFlightStatus extends JComponent implements AltosFlightDisplay {
        GridBagLayout   layout;
index 08154fdadd1cc76cd052dd4b52a04fe4ecebda70..e372d40197ade4bc31063fba71dc92e1d75f61c2 100644 (file)
@@ -27,7 +27,7 @@ import java.util.*;
 import java.text.*;
 import java.util.prefs.*;
 import java.util.concurrent.LinkedBlockingQueue;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosFlightStatusTableModel extends AbstractTableModel {
        private String[] columnNames = {
index 7821a77709a90fd32b9f58621998334fd5ceb947..93399a13791e2094fb6be49a658670821eac4ae8 100644 (file)
@@ -18,7 +18,7 @@
 package altosui;
 
 import java.awt.event.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosFlightStatusUpdate implements ActionListener {
 
index c151177e73e1915fae355b66fc9939ff33507b56..e8cf7f081a06c3a5827f9f260395a5629dbb620c 100644 (file)
@@ -21,7 +21,7 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay, AltosFontListener {
index 17a995d41c0b8fa5b3bc5f482551f7bc048b9e7d..039b5f220277c35914ca5961552e276dd4668a2e 100644 (file)
@@ -18,7 +18,7 @@
 package altosui;
 
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosFreqList extends JComboBox {
index c505d2d8c5dc41771b9cc1d07bd03e8afece8f0e..42334e319cc435d5d85090c3bb2c169fb6fd4b4c 100644 (file)
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 import org.jfree.ui.*;
@@ -127,6 +127,52 @@ class AltosDbm extends AltosUnits {
        }
 }
 
+class AltosGyroUnits extends AltosUnits {
+
+       public double value(double p, boolean imperial_units) {
+               return p;
+       }
+
+       public double inverse(double p, boolean imperial_units) {
+               return p;
+       }
+
+       public String show_units(boolean imperial_units) {
+               return "°/sec";
+       }
+
+       public String say_units(boolean imperial_units) {
+               return "degrees per second";
+       }
+
+       public int show_fraction(int width, boolean imperial_units) {
+               return 1;
+       }
+}
+
+class AltosMagUnits extends AltosUnits {
+
+       public double value(double p, boolean imperial_units) {
+               return p;
+       }
+
+       public double inverse(double p, boolean imperial_units) {
+               return p;
+       }
+
+       public String show_units(boolean imperial_units) {
+               return "Ga";
+       }
+
+       public String say_units(boolean imperial_units) {
+               return "gauss";
+       }
+
+       public int show_fraction(int width, boolean imperial_units) {
+               return 2;
+       }
+}
+
 public class AltosGraph extends AltosUIGraph {
 
        static final private Color height_color = new Color(194,31,31);
@@ -146,14 +192,28 @@ public class AltosGraph extends AltosUIGraph {
        static final private Color temperature_color = new Color (31, 194, 194);
        static final private Color dbm_color = new Color(31, 100, 100);
        static final private Color state_color = new Color(0,0,0);
+       static final private Color accel_x_color = new Color(255, 0, 0);
+       static final private Color accel_y_color = new Color(0, 255, 0);
+       static final private Color accel_z_color = new Color(0, 0, 255);
+       static final private Color gyro_x_color = new Color(192, 0, 0);
+       static final private Color gyro_y_color = new Color(0, 192, 0);
+       static final private Color gyro_z_color = new Color(0, 0, 192);
+       static final private Color mag_x_color = new Color(128, 0, 0);
+       static final private Color mag_y_color = new Color(0, 128, 0);
+       static final private Color mag_z_color = new Color(0, 0, 128);
+       static final private Color orient_color = new Color(31, 31, 31);
 
        static AltosVoltage voltage_units = new AltosVoltage();
        static AltosPressure pressure_units = new AltosPressure();
        static AltosNsat nsat_units = new AltosNsat();
        static AltosDbm dbm_units = new AltosDbm();
+       static AltosGyroUnits gyro_units = new AltosGyroUnits();
+       static AltosOrient orient_units = new AltosOrient();
+       static AltosMagUnits mag_units = new AltosMagUnits();
 
        AltosUIAxis     height_axis, speed_axis, accel_axis, voltage_axis, temperature_axis, nsat_axis, dbm_axis;
        AltosUIAxis     distance_axis, pressure_axis;
+       AltosUIAxis     gyro_axis, orient_axis, mag_axis;
 
        public AltosGraph(AltosUIEnable enable, AltosFlightStats stats, AltosGraphDataSet dataSet) {
                super(enable);
@@ -169,6 +229,10 @@ public class AltosGraph extends AltosUIGraph {
                dbm_axis = newAxis("Signal Strength", dbm_units, dbm_color, 0);
                distance_axis = newAxis("Distance", AltosConvert.distance, range_color);
 
+               gyro_axis = newAxis("Rotation Rate", gyro_units, gyro_z_color, 0);
+               orient_axis = newAxis("Tilt Angle", orient_units, orient_color, 0);
+               mag_axis = newAxis("Magnetic Field", mag_units, mag_x_color, 0);
+
                addMarker("State", AltosGraphDataPoint.data_state, state_color);
                addSeries("Height",
                          AltosGraphDataPoint.data_height,
@@ -260,6 +324,72 @@ public class AltosGraph extends AltosUIGraph {
                                  voltage_axis);
                }
 
+               if (stats.has_imu) {
+                       addSeries("Acceleration X",
+                                 AltosGraphDataPoint.data_accel_x,
+                                 AltosConvert.accel,
+                                 accel_x_color,
+                                 false,
+                                 accel_axis);
+                       addSeries("Acceleration Y",
+                                 AltosGraphDataPoint.data_accel_y,
+                                 AltosConvert.accel,
+                                 accel_y_color,
+                                 false,
+                                 accel_axis);
+                       addSeries("Acceleration Z",
+                                 AltosGraphDataPoint.data_accel_z,
+                                 AltosConvert.accel,
+                                 accel_z_color,
+                                 false,
+                                 accel_axis);
+                       addSeries("Rotation Rate X",
+                                 AltosGraphDataPoint.data_gyro_x,
+                                 gyro_units,
+                                 gyro_x_color,
+                                 false,
+                                 gyro_axis);
+                       addSeries("Rotation Rate Y",
+                                 AltosGraphDataPoint.data_gyro_y,
+                                 gyro_units,
+                                 gyro_y_color,
+                                 false,
+                                 gyro_axis);
+                       addSeries("Rotation Rate Z",
+                                 AltosGraphDataPoint.data_gyro_z,
+                                 gyro_units,
+                                 gyro_z_color,
+                                 false,
+                                 gyro_axis);
+               }
+               if (stats.has_mag) {
+                       addSeries("Magnetometer X",
+                                 AltosGraphDataPoint.data_mag_x,
+                                 mag_units,
+                                 mag_x_color,
+                                 false,
+                                 mag_axis);
+                       addSeries("Magnetometer Y",
+                                 AltosGraphDataPoint.data_mag_y,
+                                 mag_units,
+                                 mag_y_color,
+                                 false,
+                                 mag_axis);
+                       addSeries("Magnetometer Z",
+                                 AltosGraphDataPoint.data_mag_z,
+                                 mag_units,
+                                 mag_z_color,
+                                 false,
+                                 mag_axis);
+               }
+               if (stats.has_orient)
+                       addSeries("Tilt Angle",
+                                 AltosGraphDataPoint.data_orient,
+                                 orient_units,
+                                 orient_color,
+                                 false,
+                                 orient_axis);
+
                setDataSet(dataSet);
        }
 }
\ No newline at end of file
index d8191f5d35199ab378188c5e071885031db2d47e..61a1a2276bdfdf493e3d0740385299cb15db9f7e 100644 (file)
@@ -18,7 +18,7 @@
 package altosui;
 
 import org.altusmetrum.altosuilib_1.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosGraphDataPoint implements AltosUIDataPoint {
 
@@ -40,6 +40,16 @@ public class AltosGraphDataPoint implements AltosUIDataPoint {
        public static final int data_range = 13;
        public static final int data_distance = 14;
        public static final int data_pressure = 15;
+       public static final int data_accel_x = 16;
+       public static final int data_accel_y = 17;
+       public static final int data_accel_z = 18;
+       public static final int data_gyro_x = 19;
+       public static final int data_gyro_y = 20;
+       public static final int data_gyro_z = 21;
+       public static final int data_mag_x = 22;
+       public static final int data_mag_y = 23;
+       public static final int data_mag_z = 24;
+       public static final int data_orient = 25;
 
        public double x() throws AltosUIDataMissing {
                double  time = state.time_since_boost();
@@ -99,6 +109,58 @@ public class AltosGraphDataPoint implements AltosUIDataPoint {
                case data_pressure:
                        y = state.pressure();
                        break;
+                       
+               case data_accel_x:
+               case data_accel_y:
+               case data_accel_z:
+               case data_gyro_x:
+               case data_gyro_y:
+               case data_gyro_z:
+                       AltosIMU        imu = state.imu;
+                       if (imu == null)
+                               break;
+                       switch (index) {
+                       case data_accel_x:
+                               y = imu.accel_x;
+                               break;
+                       case data_accel_y:
+                               y = imu.accel_y;
+                               break;
+                       case data_accel_z:
+                               y = imu.accel_z;
+                               break;
+                       case data_gyro_x:
+                               y = imu.gyro_x;
+                               break;
+                       case data_gyro_y:
+                               y = imu.gyro_y;
+                               break;
+                       case data_gyro_z:
+                               y = imu.gyro_z;
+                               break;
+                       }
+                       break;
+               case data_mag_x:
+               case data_mag_y:
+               case data_mag_z:
+                       AltosMag        mag = state.mag;
+                       if (mag == null)
+                               break;
+                       switch (index) {
+                       case data_mag_x:
+                               y = mag.x;
+                               break;
+                       case data_mag_y:
+                               y = mag.y;
+                               break;
+                       case data_mag_z:
+                               y = mag.z;
+                               break;
+                       }
+                       break;
+               case data_orient:
+                       y = state.orient();
+                       break;
                }
                if (y == AltosLib.MISSING)
                        throw new AltosUIDataMissing(index);
index 4e6c46d1605a3d2bd840792a6cc447c4b10adae3..d2773a3f8558c285436c02ad44e2e35d48ad76ba 100644 (file)
@@ -20,7 +20,7 @@ package altosui;
 import java.lang.*;
 import java.io.*;
 import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 class AltosGraphIterator implements Iterator<AltosUIDataPoint> {
index c42f7b5f89d4f346517fad948c5b3ec6a86229d4..40d2f7f4bc40dc83f091ba95e6250ddb740376e7 100644 (file)
@@ -9,7 +9,7 @@ import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 import org.jfree.chart.ChartPanel;
index 6a79604efff6b33f894ebaba09e111c652befb9d..7ca935b654ee4a0a66444a7196297f60dc97d1b0 100644 (file)
@@ -24,7 +24,7 @@ import javax.swing.event.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.util.Arrays;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDisplay, AltosFontListener, AltosIdleMonitorListener, DocumentListener {
@@ -132,8 +132,35 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
                return constraints(x, width, GridBagConstraints.NONE);
        }
 
+       void idle_exception(JFrame owner, Exception e) {
+               if (e instanceof FileNotFoundException) {
+                       JOptionPane.showMessageDialog(owner,
+                                                     ((FileNotFoundException) e).getMessage(),
+                                                     "Cannot open target device",
+                                                     JOptionPane.ERROR_MESSAGE);
+               } else if (e instanceof AltosSerialInUseException) {
+                       JOptionPane.showMessageDialog(owner,
+                                                     String.format("Device \"%s\" already in use",
+                                                                   device.toShortString()),
+                                                     "Device in use",
+                                                     JOptionPane.ERROR_MESSAGE);
+               } else if (e instanceof IOException) {
+                       IOException ee = (IOException) e;
+                       JOptionPane.showMessageDialog(owner,
+                                                     device.toShortString(),
+                                                     ee.getLocalizedMessage(),
+                                                     JOptionPane.ERROR_MESSAGE);
+               } else {
+                       JOptionPane.showMessageDialog(owner,
+                                                     String.format("Connection to \"%s\" failed",
+                                                                   device.toShortString()),
+                                                     "Connection Failed",
+                                                     JOptionPane.ERROR_MESSAGE);
+               }
+       }
+
        public AltosIdleMonitorUI(JFrame in_owner)
-               throws FileNotFoundException, AltosSerialInUseException, TimeoutException, InterruptedException {
+               throws FileNotFoundException, TimeoutException, InterruptedException {
 
                device = AltosDeviceUIDialog.show(in_owner, Altos.product_any);
                remote = false;
@@ -141,6 +168,15 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
                        remote = true;
 
                serial = device.getSerial();
+
+               AltosLink link;
+               try {
+                       link = new AltosSerial(device);
+               } catch (Exception ex) {
+                       idle_exception(in_owner, ex);
+                       return;
+               }
+
                bag = getContentPane();
                bag.setLayout(new GridBagLayout());
 
@@ -209,7 +245,7 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl
                pack();
                setVisible(true);
 
-               thread = new AltosIdleMonitor((AltosIdleMonitorListener) this, (AltosLink) new AltosSerial (device), (boolean) remote);
+               thread = new AltosIdleMonitor((AltosIdleMonitorListener) this, link, (boolean) remote);
 
                status_update = new AltosFlightStatusUpdate(flightStatus);
 
index c8024aaedacf2773338179443abdd98b6c753008..2e69249f42771db2c9d5854e5d64da8583002def 100644 (file)
@@ -22,8 +22,9 @@ import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
 import java.text.*;
+import java.util.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosIgniteUI
@@ -33,17 +34,14 @@ public class AltosIgniteUI
        AltosDevice     device;
        JFrame          owner;
        JLabel          label;
-       JRadioButton    apogee;
-       JLabel          apogee_status_label;
-       JRadioButton    main;
-       JLabel          main_status_label;
        JToggleButton   arm;
        JButton         fire;
        javax.swing.Timer       timer;
        JButton         close;
+       ButtonGroup     group;
+       Boolean         opened;
 
-       int             apogee_status;
-       int             main_status;
+       int             npyro;
 
        final static int        timeout = 1 * 1000;
 
@@ -52,9 +50,68 @@ public class AltosIgniteUI
 
        LinkedBlockingQueue<String>     command_queue;
 
+       LinkedBlockingQueue<String>     reply_queue;
+
+       class Igniter {
+               JRadioButton    button;
+               JLabel          status_label;
+               String          name;
+               int             status;
+
+               void set_status (int status) {
+                       this.status = status;
+                       status_label.setText(String.format("\"%s\"", AltosIgnite.status_string(status)));
+               }
+
+               Igniter(AltosIgniteUI ui, String label, String name, int y) {
+                       Container               pane = getContentPane();
+                       GridBagConstraints      c = new GridBagConstraints();
+                       Insets                  i = new Insets(4,4,4,4);
+
+                       this.name = name;
+                       this.status = AltosIgnite.Unknown;
+
+                       c.gridx = 0;
+                       c.gridy = y;
+                       c.gridwidth = 1;
+                       c.anchor = GridBagConstraints.WEST;
+                       button = new JRadioButton (label);
+                       pane.add(button, c);
+                       button.addActionListener(ui);
+                       button.setActionCommand(name);
+                       group.add(button);
+
+                       c.gridx = 1;
+                       c.gridy = y;
+                       c.gridwidth = 1;
+                       c.anchor = GridBagConstraints.WEST;
+                       status_label = new JLabel("plenty of text");
+                       pane.add(status_label, c);
+
+                       status = AltosIgnite.Unknown;
+               }
+       }
+
+       Igniter igniters[];
+
+       void set_status(String _name, int _status) {
+
+               final String name = _name;
+               final int status = _status;
+               Runnable r = new Runnable() {
+                               public void run() {
+                                       for (int p = 0; p < igniters.length; p++)
+                                               if (name.equals(igniters[p].name))
+                                                       igniters[p].set_status(status);
+                               }
+                       };
+               SwingUtilities.invokeLater(r);
+       }
+
        class IgniteHandler implements Runnable {
                AltosIgnite     ignite;
                JFrame          owner;
+               AltosLink       link;
 
                void send_exception(Exception e) {
                        final Exception f_e = e;
@@ -68,9 +125,7 @@ public class AltosIgniteUI
 
                public void run () {
                        try {
-                               AltosSerial     serial = new AltosSerial(device);
-                               serial.set_frame(owner);
-                               ignite = new AltosIgnite(serial,
+                               ignite = new AltosIgnite(link,
                                                         !device.matchProduct(Altos.product_altimeter));
 
                        } catch (Exception e) {
@@ -86,20 +141,23 @@ public class AltosIgniteUI
                                        String          reply = null;
 
                                        if (command.equals("get_status")) {
-                                               apogee_status = ignite.status(AltosIgnite.Apogee);
-                                               main_status = ignite.status(AltosIgnite.Main);
+                                               HashMap<String,Integer> status_map = ignite.status();
+
+                                               for (int p = 0; p < igniters.length; p++) {
+                                                       Integer i = status_map.get(igniters[p].name);
+                                                       if (i != null)
+                                                               set_status(igniters[p].name, i);
+                                               }
                                                reply = "status";
-                                       } else if (command.equals("main")) {
-                                               ignite.fire(AltosIgnite.Main);
-                                               reply = "fired";
-                                       } else if (command.equals("apogee")) {
-                                               ignite.fire(AltosIgnite.Apogee);
-                                               reply = "fired";
+                                       } else if (command.equals("get_npyro")) {
+                                               put_reply(String.format("%d", ignite.npyro()));
+                                               continue;
                                        } else if (command.equals("quit")) {
                                                ignite.close();
                                                break;
                                        } else {
-                                               throw new ParseException(String.format("invalid command %s", command), 0);
+                                               ignite.fire(command);
+                                               reply = "fired";
                                        }
                                        final String f_reply = reply;
                                        r = new Runnable() {
@@ -114,8 +172,9 @@ public class AltosIgniteUI
                        }
                }
 
-               public IgniteHandler(JFrame in_owner) {
+               public IgniteHandler(JFrame in_owner, AltosLink in_link) {
                        owner = in_owner;
+                       link = in_link;
                }
        }
 
@@ -170,16 +229,15 @@ public class AltosIgniteUI
 
        void stop_timer() {
                time_remaining = 0;
-               arm.setSelected(false);
-               arm.setEnabled(false);
                fire.setEnabled(false);
                timer_running = false;
+               arm.setSelected(false);
+               arm.setEnabled(false);
                set_arm_text();
        }
 
        void cancel () {
-               apogee.setSelected(false);
-               main.setSelected(false);
+               group.clearSelection();
                fire.setEnabled(false);
                stop_timer();
        }
@@ -192,13 +250,30 @@ public class AltosIgniteUI
                }
        }
 
+       void put_reply(String reply) {
+               try {
+                       reply_queue.put(reply);
+               } catch (Exception ex) {
+                       ignite_exception(ex);
+               }
+       }
+
+       String get_reply() {
+               String reply = "";
+               try {
+                       reply = reply_queue.take();
+               } catch (Exception ex) {
+                       ignite_exception(ex);
+               }
+               return reply;
+       }
+
        boolean getting_status = false;
 
        boolean visible = false;
+
        void set_ignite_status() {
                getting_status = false;
-               apogee_status_label.setText(String.format("\"%s\"", AltosIgnite.status_string(apogee_status)));
-               main_status_label.setText(String.format("\"%s\"", AltosIgnite.status_string(main_status)));
                if (!visible) {
                        visible = true;
                        setVisible(true);
@@ -212,6 +287,12 @@ public class AltosIgniteUI
                }
        }
 
+       int get_npyro() {
+               send_command("get_npyro");
+               String reply = get_reply();
+               return Integer.parseInt(reply);
+       }
+
        boolean firing = false;
 
        void start_fire(String which) {
@@ -227,8 +308,10 @@ public class AltosIgniteUI
        }
 
        void close() {
-               send_command("quit");
-               timer.stop();
+               if (opened) {
+                       send_command("quit");
+                       timer.stop();
+               }
                setVisible(false);
                dispose();
        }
@@ -247,10 +330,12 @@ public class AltosIgniteUI
        void fire() {
                if (arm.isEnabled() && arm.isSelected() && time_remaining > 0) {
                        String  igniter = "none";
-                       if (apogee.isSelected() && !main.isSelected())
-                               igniter = "apogee";
-                       else if (main.isSelected() && !apogee.isSelected())
-                               igniter = "main";
+
+                       for (int p = 0; p < igniters.length; p++)
+                               if (igniters[p].button.isSelected()) {
+                                       igniter = igniters[p].name;
+                                       break;
+                               }
                        send_command(igniter);
                        cancel();
                }
@@ -258,18 +343,13 @@ public class AltosIgniteUI
 
        public void actionPerformed(ActionEvent e) {
                String cmd = e.getActionCommand();
-               if (cmd.equals("apogee") || cmd.equals("main")) {
-                       stop_timer();
-               }
 
-               if (cmd.equals("apogee") && apogee.isSelected()) {
-                       main.setSelected(false);
-                       arm.setEnabled(true);
-               }
-               if (cmd.equals("main") && main.isSelected()) {
-                       apogee.setSelected(false);
-                       arm.setEnabled(true);
-               }
+               for (int p = 0; p < igniters.length; p++)
+                       if (cmd.equals(igniters[p].name)) {
+                               stop_timer();
+                               arm.setEnabled(true);
+                               break;
+                       }
 
                if (cmd.equals("arm")) {
                        if (arm.isSelected()) {
@@ -282,9 +362,8 @@ public class AltosIgniteUI
                        fire();
                if (cmd.equals("tick"))
                        tick_timer();
-               if (cmd.equals("close")) {
+               if (cmd.equals("close"))
                        close();
-               }
        }
 
        /* A window listener to catch closing events and tell the config code */
@@ -304,13 +383,22 @@ public class AltosIgniteUI
 
        private boolean open() {
                command_queue = new LinkedBlockingQueue<String>();
+               reply_queue = new LinkedBlockingQueue<String>();
 
+               opened = false;
                device = AltosDeviceUIDialog.show(owner, Altos.product_any);
                if (device != null) {
-                               IgniteHandler   handler = new IgniteHandler(owner);
+                       try {
+                               AltosSerial     serial = new AltosSerial(device);
+                               serial.set_frame(owner);
+                               IgniteHandler   handler = new IgniteHandler(owner, serial);
                                Thread          t = new Thread(handler);
                                t.start();
+                               opened = true;
                                return true;
+                       } catch (Exception ex) {
+                               ignite_exception(ex);
+                       }
                }
                return false;
        }
@@ -318,13 +406,14 @@ public class AltosIgniteUI
        public AltosIgniteUI(JFrame in_owner) {
 
                owner = in_owner;
-               apogee_status = AltosIgnite.Unknown;
-               main_status = AltosIgnite.Unknown;
 
                if (!open())
                        return;
 
+               group = new ButtonGroup();
+
                Container               pane = getContentPane();
+
                GridBagConstraints      c = new GridBagConstraints();
                Insets                  i = new Insets(4,4,4,4);
 
@@ -343,47 +432,32 @@ public class AltosIgniteUI
                c.weightx = 0;
                c.weighty = 0;
 
+               int y = 0;
+
                c.gridx = 0;
-               c.gridy = 0;
+               c.gridy = y;
                c.gridwidth = 2;
                c.anchor = GridBagConstraints.CENTER;
                label = new JLabel ("Fire Igniter");
                pane.add(label, c);
 
-               c.gridx = 0;
-               c.gridy = 1;
-               c.gridwidth = 1;
-               c.anchor = GridBagConstraints.WEST;
-               apogee = new JRadioButton ("Apogee");
-               pane.add(apogee, c);
-               apogee.addActionListener(this);
-               apogee.setActionCommand("apogee");
+               y++;
 
-               c.gridx = 1;
-               c.gridy = 1;
-               c.gridwidth = 1;
-               c.anchor = GridBagConstraints.WEST;
-               apogee_status_label = new JLabel();
-               pane.add(apogee_status_label, c);
+               int npyro = get_npyro();
 
-               c.gridx = 0;
-               c.gridy = 2;
-               c.gridwidth = 1;
-               c.anchor = GridBagConstraints.WEST;
-               main = new JRadioButton ("Main");
-               pane.add(main, c);
-               main.addActionListener(this);
-               main.setActionCommand("main");
+               igniters = new Igniter[2 + npyro];
 
-               c.gridx = 1;
-               c.gridy = 2;
-               c.gridwidth = 1;
-               c.anchor = GridBagConstraints.WEST;
-               main_status_label = new JLabel();
-               pane.add(main_status_label, c);
+               igniters[0] = new Igniter(this, "Apogee", AltosIgnite.Apogee, y++);
+               igniters[1] = new Igniter(this, "Main", AltosIgnite.Main, y++);
+
+               for (int p = 0; p < npyro; p++) {
+                       String  name = String.format("%d", p);
+                       String  label = String.format("%c", 'A' + p);
+                       igniters[2+p] = new Igniter(this, label, name, y++);
+               }
 
                c.gridx = 0;
-               c.gridy = 3;
+               c.gridy = y;
                c.gridwidth = 1;
                c.anchor = GridBagConstraints.CENTER;
                arm = new JToggleButton ("Arm");
@@ -393,7 +467,7 @@ public class AltosIgniteUI
                arm.setEnabled(false);
 
                c.gridx = 1;
-               c.gridy = 3;
+               c.gridy = y;
                c.gridwidth = 1;
                c.anchor = GridBagConstraints.CENTER;
                fire = new JButton ("Fire");
@@ -402,8 +476,10 @@ public class AltosIgniteUI
                fire.addActionListener(this);
                fire.setActionCommand("fire");
 
+               y++;
+
                c.gridx = 0;
-               c.gridy = 4;
+               c.gridy = y;
                c.gridwidth = 2;
                c.anchor = GridBagConstraints.CENTER;
                close = new JButton ("Close");
index feafed21f32a852e0ecf3d8cec954fe65a97ed21..158b61f0bc8ab4f2e89f45075025258a9fc07e29 100644 (file)
@@ -20,7 +20,7 @@ package altosui;
 import java.awt.*;
 import javax.swing.*;
 import javax.swing.table.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosInfoTable extends JTable {
        private AltosFlightInfoTableModel model;
@@ -46,9 +46,9 @@ public class AltosInfoTable extends JTable {
                        TableColumn column = getColumnModel().getColumn(i);
 
                        if ((i & 1) == 0)
-                               column.setPreferredWidth(text_width(" Satellites Visible "));
+                               column.setPreferredWidth(text_width(" Satellites Visible"));
                        else
-                               column.setPreferredWidth(text_width(" 179°59.99999' "));
+                               column.setPreferredWidth(text_width("W 179°59.99999' "));
                }
        }
 
@@ -125,6 +125,10 @@ public class AltosInfoTable extends JTable {
                                info_add_row(0, "Speed", "%8.1f  m/s", state.speed());
                        if (state.max_speed() != AltosLib.MISSING)
                                info_add_row(0, "Max Speed", "%8.1f  m/s", state.max_speed());
+                       if (state.orient() != AltosLib.MISSING)
+                               info_add_row(0, "Tilt", "%4.0f Â°", state.orient());
+                       if (state.max_orient() != AltosLib.MISSING)
+                               info_add_row(0, "Max Tilt", "%4.0f Â°", state.max_orient());
                        if (state.temperature != AltosLib.MISSING)
                                info_add_row(0, "Temperature", "%9.2f Â°C", state.temperature);
                        if (state.battery_voltage != AltosLib.MISSING)
index fbb0ece41867319c95f15a3b5cf38fff9d2350f6..ae1f8259c4d19d459502a525c40f2f1d23494dfa 100644 (file)
@@ -18,7 +18,7 @@
 package altosui;
 
 import java.io.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosKML implements AltosWriter {
 
index cc2053e0ca5fe7896557241f31e9dc0bb2854424..74177753c6dbfe31cd9275dd370b4e30b3170964 100644 (file)
@@ -21,7 +21,7 @@ import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosLanded extends JComponent implements AltosFlightDisplay, ActionListener {
        GridBagLayout   layout;
index 06a0f1efa2bc9c3855c2760bbfb3b71ff9a2b0e3..7baf0eb214cadac7a4361af3ee6370dfc08aa183 100644 (file)
@@ -19,7 +19,7 @@ package altosui;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosPad extends JComponent implements AltosFlightDisplay {
        GridBagLayout   layout;
index fa7801257289c2f7577449b54a6bcfecacaeb29b..899946790f2649db585e6e806d5c2bc8f8250a79 100644 (file)
@@ -20,7 +20,7 @@ package altosui;
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosRomconfigUI
@@ -69,7 +69,7 @@ public class AltosRomconfigUI
                c.weightx = 1;
                c.anchor = GridBagConstraints.LINE_START;
                c.insets = ir;
-               serial_value = new JTextField("0");
+               serial_value = new JTextField("00000000");
                pane.add(serial_value, c);
 
                /* Radio calibration value */
@@ -91,7 +91,7 @@ public class AltosRomconfigUI
                c.anchor = GridBagConstraints.LINE_START;
                c.insets = ir;
                c.ipady = 5;
-               radio_calibration_value = new JTextField("0");
+               radio_calibration_value = new JTextField("00000000");
                pane.add(radio_calibration_value, c);
 
                /* Buttons */
index a5ccb15aac379a6d6cb82dc8a0a4850b8eb567f0..e4a9336233cd93205e7ec2ba9f406c7a1a6d1943 100644 (file)
@@ -25,7 +25,7 @@ import java.io.*;
 import java.util.*;
 import java.text.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 class AltosScanResult {
index 5e9322e598a5a143c8fda318d2635613dbcc76ac..2c5d2dfd3104fbaf7107e673ecd8b56629587397 100644 (file)
@@ -25,7 +25,7 @@ import java.io.*;
 import java.util.*;
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 import libaltosJNI.*;
index 9491ce2be4b95c4ddf5f400beda942a23a1294bf..105afade192ed206b3fcde8f3c688231b4da3ba8 100644 (file)
@@ -23,7 +23,7 @@ import java.io.*;
 import java.lang.Math;
 import java.awt.geom.Point2D;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay {
@@ -182,7 +182,9 @@ public class AltosSiteMap extends JScrollPane implements AltosFlightDisplay {
                }
        }
 
-       public static void prefetchMaps(double lat, double lng, int w, int h) {
+       public static void prefetchMaps(double lat, double lng) {
+               int w = AltosSiteMapPreload.width;
+               int h = AltosSiteMapPreload.height;
                AltosSiteMap asm = new AltosSiteMap(true);
                asm.centre = asm.getBaseLocation(lat, lng);
 
index 40c8ff6bf0dc078beff6f8b5016f8910ffe2f4c4..03dc3cf5d67ebc8a3170d863d8557c75258452c1 100644 (file)
@@ -25,8 +25,13 @@ import java.net.URL;
 import java.net.URLConnection;
 
 public class AltosSiteMapCache extends JLabel {
+       static final long google_maps_ratelimit_ms = 1200;
+       // Google limits static map queries to 50 per minute per IP, so
+       // each query should take at least 1.2 seconds.
+
        public static boolean fetchMap(File file, String url) {
                URL u;
+               long startTime = System.nanoTime();
 
                try {
                        u = new URL(url);
@@ -70,6 +75,16 @@ public class AltosSiteMapCache extends JLabel {
                        }
                        return false;
                }
+
+               long duration_ms = (System.nanoTime() - startTime) / 1000000;
+               if (duration_ms < google_maps_ratelimit_ms) {
+                       try {
+                               Thread.sleep(google_maps_ratelimit_ms - duration_ms);
+                       } catch (InterruptedException e) {
+                               Thread.currentThread().interrupt();
+                       }
+               }
+
                return true;
        }
 
index fd648abccc2424d5bad08c2ee7c9f85e08796bf7..66399557e6813289da168fd511bcc711a84e442f 100644 (file)
@@ -213,7 +213,7 @@ public class AltosSiteMapPreload extends AltosUIDialog implements ActionListener
        AltosMapPos     lat;
        AltosMapPos     lon;
 
-       final static int        radius = 4;
+       final static int        radius = 5;
        final static int        width = (radius * 2 + 1);
        final static int        height = (radius * 2 + 1);
 
@@ -326,7 +326,7 @@ public class AltosSiteMapPreload extends AltosUIDialog implements ActionListener
 
                pane.setLayout(new GridBagLayout());
 
-               map = new AltosSiteMap(4);
+               map = new AltosSiteMap(radius);
 
                c.fill = GridBagConstraints.BOTH;
                c.anchor = GridBagConstraints.CENTER;
@@ -464,4 +464,4 @@ public class AltosSiteMapPreload extends AltosUIDialog implements ActionListener
                setLocationRelativeTo(owner);
                setVisible(true);
        }
-}
\ No newline at end of file
+}
index 172e6397c6fe9875d193940932e6037c7f10e0f0..7d5b65e17e75aee1dcdfcb84a2a89055087bd2d6 100644 (file)
@@ -22,7 +22,7 @@ import java.awt.image.*;
 import javax.swing.*;
 import java.awt.geom.Point2D;
 import java.awt.geom.Line2D;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosSiteMapTile extends JLayeredPane {
        JLabel mapLabel;
index 9dad8718507dd384c07a59c5506fb4d8234b2cc4..5d4599476ba44bd988e0b57a1f792fe12fd5dd6f 100644 (file)
@@ -22,7 +22,7 @@ import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class AltosUI extends AltosUIFrame {
@@ -560,8 +560,9 @@ public class AltosUI extends AltosUIFrame {
                        AltosUI altosui = new AltosUI();
 
                        java.util.List<AltosDevice> devices = AltosUSBDevice.list(Altos.product_basestation);
-                       for (AltosDevice device : devices)
-                               altosui.telemetry_window(device);
+                       if (devices != null)
+                               for (AltosDevice device : devices)
+                                       altosui.telemetry_window(device);
                } else {
                        int process = process_none;
                        for (int i = 0; i < args.length; i++) {
@@ -573,7 +574,7 @@ public class AltosUI extends AltosUIFrame {
                                        } else {
                                                double lat = Double.parseDouble(args[i+1]);
                                                double lon = Double.parseDouble(args[i+2]);
-                                               AltosSiteMap.prefetchMaps(lat, lon, 5, 5);
+                                               AltosSiteMap.prefetchMaps(lat, lon);
                                                i += 2;
                                        }
                                } else if (args[i].equals("--replay"))
index fb5f8520a2c5039d2f8eef6f31b88009ecb79299..697d9902ff40bc545b48971fcf425b46e76ade25 100644 (file)
@@ -19,7 +19,7 @@ package altosui;
 
 import java.io.File;
 import java.util.prefs.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import javax.swing.filechooser.FileSystemView;
 
 public class AltosUIPreferencesBackend implements AltosPreferencesBackend {
index d664d6e825fe28c556a9b0725952f18fd8686b70..5ff4458434653fef9011845f9a3d9ed6bc2102c7 100644 (file)
@@ -17,7 +17,7 @@
 
 package altosui;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 
 public interface AltosWriter {
index 71e96004169915a7fd7d519e10c91ed4a92f2203..32a3df97ba9187d9704feebca4b22c9b20066742 100644 (file)
@@ -98,7 +98,8 @@ ALTOSUILIB_CLASS=\
        altosuilib_$(ALTOSUILIB_VERSION).jar
 
 LIBALTOS= \
-       libaltos.so \
+       libaltos32.so \
+       libaltos64.so \
        libaltos.dylib \
        altos.dll
 
@@ -164,7 +165,7 @@ TEMPLATE_DOC=\
        $(top_srcdir)/doc/telemetrum-outline.pdf \
        $(top_srcdir)/doc/easymini-outline.pdf \
        $(top_srcdir)/doc/telemega-outline.pdf \
-       $(top_srcdir)/doc/easymini-outline.pdf
+       $(top_srcdir)/doc/telemini.pdf
 
 DOC=$(ALTUSMETRUM_DOC) $(ALTOS_DOC) $(TELEMETRY_DOC) $(TEMPLATE_DOC)
 
@@ -175,7 +176,9 @@ WINDOWS_DIST=Altos-Windows-$(VERSION_DASH).exe
 
 FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS)
 
-LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC)
+LINUX_LIBS=libaltos32.so libaltos64.so
+
+LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC)
 LINUX_EXTRA=altosui-fat
 
 MACOSX_INFO_PLIST=Info.plist
@@ -265,7 +268,11 @@ altosui-jdb: Makefile
        echo 'exec jdb -classpath "classes:./*:../libaltos:$(FREETTS)/freetts.jar:$(JCOMMON)/jcommon.jar:$(JFREECHART)/jfreechart.jar" -Djava.library.path="../libaltos/.libs" altosui/AltosUI "$$@"' >> $@
        chmod +x $@
 
-libaltos.so: build-libaltos
+libaltos32.so: build-libaltos
+       -rm -f "$@"
+       $(LN_S) ../libaltos/.libs/"$@" .
+
+libaltos64.so: build-libaltos
        -rm -f "$@"
        $(LN_S) ../libaltos/.libs/"$@" .
 
@@ -281,7 +288,9 @@ altos64.dll: ../libaltos/altos64.dll
        -rm -f "$@"
        $(LN_S) ../libaltos/"$@" .
 
-../libaltos/.libs/libaltos.so: build-libaltos
+../libaltos/.libs/libaltos64.so: ../libaltos/.libs/libaltos32.so
+
+../libaltos/.libs/libaltos32.so: build-libaltos
 
 ../libaltos/altos.dll: build-altos-dll
 
index 779b0c1279cf6c1b98daa4c6d69393e66bf9e26f..3832e9019dea30de2ddb735f3e75955ce1af1bf6 100644 (file)
@@ -136,6 +136,7 @@ Section "Documentation"
        File "../doc/telemetrum-outline.pdf"
        File "../doc/telemega-outline.pdf"
        File "../doc/easymini-outline.pdf"
+       File "../doc/telemini.pdf"
 SectionEnd
 
 Section "Uninstaller"
index a38cba63e0f7913ce52e7cab49ca1cb4bb88d45e..1638ea290512fdb9d62473e9cd696d6a64686380 100644 (file)
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index 84803c0e916770af06b0fc627e040806f826cfe5..ea4bd00ab6b4874b12355e0de196ac2184a8929c 100644 (file)
@@ -23,7 +23,7 @@ import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
@@ -39,10 +39,12 @@ public class AltosUIEnable extends Container {
 
        Insets  il, ir;
        int     y;
+       int     x;
+
+       static final int max_rows = 14;
 
        class GraphElement implements ActionListener {
                AltosUIGrapher  grapher;
-               JLabel          label;
                JRadioButton    enable;
                String          name;
 
@@ -53,8 +55,7 @@ public class AltosUIEnable extends Container {
                GraphElement (String name, AltosUIGrapher grapher, boolean enabled) {
                        this.name = name;
                        this.grapher = grapher;
-                       label = new JLabel(name);
-                       enable = new JRadioButton("Enable", enabled);
+                       enable = new JRadioButton(name, enabled);
                        grapher.set_enable(enabled);                      
                        enable.addActionListener(this);
                }
@@ -63,18 +64,11 @@ public class AltosUIEnable extends Container {
        public void add(String name, AltosUIGrapher grapher, boolean enabled) {
 
                GraphElement    e = new GraphElement(name, grapher, enabled);
-
-               /* Add label */
                GridBagConstraints c = new GridBagConstraints();
-               c.gridx = 0; c.gridy = y;
-               c.fill = GridBagConstraints.NONE;
-               c.anchor = GridBagConstraints.LINE_START;
-               c.insets = il;
-               add(e.label, c);
 
-               /* Add radio button */
+               /* Add element */
                c = new GridBagConstraints();
-               c.gridx = 1; c.gridy = y;
+               c.gridx = x; c.gridy = y;
                c.fill = GridBagConstraints.HORIZONTAL;
                c.anchor = GridBagConstraints.CENTER;
                c.insets = ir;
@@ -82,19 +76,17 @@ public class AltosUIEnable extends Container {
 
                /* Next row */
                y++;
+               if (y == max_rows) {
+                       x++;
+                       y = 0;
+               }
        }
 
        public void add_units() {
                /* Imperial units setting */
-               /* Add label */
-               GridBagConstraints c = new GridBagConstraints();
-               c.gridx = 0; c.gridy = 1000;
-               c.fill = GridBagConstraints.NONE;
-               c.anchor = GridBagConstraints.LINE_START;
-               c.insets = il;
-               add(new JLabel("Imperial Units"), c);
 
-               JRadioButton imperial_units = new JRadioButton("Enable", AltosUIPreferences.imperial_units());
+               /* Add label */
+               JRadioButton imperial_units = new JRadioButton("Imperial Units", AltosUIPreferences.imperial_units());
                imperial_units.addActionListener(new ActionListener() {
                                public void actionPerformed(ActionEvent e) {
                                        JRadioButton item = (JRadioButton) e.getSource();
@@ -103,8 +95,8 @@ public class AltosUIEnable extends Container {
                                }
                        });
                imperial_units.setToolTipText("Use Imperial units instead of metric");
-               c = new GridBagConstraints();
-               c.gridx = 1; c.gridy = 1000;
+               GridBagConstraints c = new GridBagConstraints();
+               c.gridx = 0; c.gridy = 1000;
                c.fill = GridBagConstraints.NONE;
                c.anchor = GridBagConstraints.LINE_START;
                c.insets = il;
@@ -114,6 +106,7 @@ public class AltosUIEnable extends Container {
        public AltosUIEnable() {
                il = new Insets(4,4,4,4);
                ir = new Insets(4,4,4,4);
+               x = 0;
                y = 0;
                setLayout(new GridBagLayout());
                add_units();
index ef0cc6772daa8e80e8f06d216ddfdabed136c5fe..061a76295a0b0fd5214ada2b6cfee4ea8b489cce 100644 (file)
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index d826072fee0eacd24c07e320a52663c2fbd7781d..23e7d9f09ccdfc39437208b2046f9d68ed4c4d8a 100644 (file)
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index 9fcaf6d4d636979ef4272b1171ff0a982f75a758..76782e2e565743072940d96f63c6f90cbfe9793e 100644 (file)
@@ -20,7 +20,7 @@ package org.altusmetrum.altosuilib_1;
 import java.awt.*;
 import libaltosJNI.*;
 
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosUILib extends AltosLib {
 
@@ -81,18 +81,18 @@ public class AltosUILib extends AltosLib {
        static public boolean initialized = false;
        static public boolean loaded_library = false;
 
+       static final String[] library_names = { "altos", "altos32", "altos64" };
+
        public static boolean load_library() {
                if (!initialized) {
-                       try {
-                               System.loadLibrary("altos");
-                               libaltos.altos_init();
-                               loaded_library = true;
-                       } catch (UnsatisfiedLinkError e) {
+                       for (String name : library_names) {
                                try {
-                                       System.loadLibrary("altos64");
+                                       System.loadLibrary(name);
                                        libaltos.altos_init();
                                        loaded_library = true;
-                               } catch (UnsatisfiedLinkError e2) {
+                                       break;
+                               } catch (UnsatisfiedLinkError e) {
+                                       System.out.printf("Link error %s\n", e.getMessage());
                                        loaded_library = false;
                                }
                        }
index e4262abd3c77c47818301bdae7e6cce3e07ad0a8..ae8eb0344ae6a6e7aa29516731e3520523dcba43 100644 (file)
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index fc14f24b5a3417190ad4445d36f50cb861e386d8..4c995f80848a15bfd7033e64bcaf54df25a0964f 100644 (file)
@@ -21,7 +21,7 @@ import java.io.*;
 import java.util.*;
 import java.awt.Component;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 public class AltosUIPreferences extends AltosPreferences {
 
index 55da8d480c6af10fab511dcbb378e760b4d09b1f..64d3e3dfa8b184d4174670e8f5e2cc1262732f68 100644 (file)
@@ -19,7 +19,7 @@ package org.altusmetrum.altosuilib_1;
 
 import java.io.File;
 import java.util.prefs.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import javax.swing.filechooser.FileSystemView;
 
 public class AltosUIPreferencesBackend implements AltosPreferencesBackend {
index 441eba2b33587c47790f4e21870629f06e7b6b05..1f2a1c3f6a18c528a5ebd70802283ec0e3bfdb17 100644 (file)
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 
 import org.jfree.ui.*;
 import org.jfree.chart.*;
index a8bf8697e5e394c7f70f9aa784d252e1a76f82b7..3880b197f62183aa04e67f7bb12e56cb9d99f4e9 100755 (executable)
@@ -38,7 +38,8 @@ $STMLOAD --raw ../src/telemega-v$VERSION/flash-loader/*.elf || exit 1
 
 sleep 2
 
-$USBLOAD --serial=$SERIAL ../src/telemega-v$VERSION/*.ihx || exit 1
+#$USBLOAD --serial=$SERIAL ../src/telemega-v$VERSION/*.ihx || exit 1
+$USBLOAD --serial=$SERIAL /usr/share/altos/telemega-v$VERSION*.ihx || exit 1
 
 sleep 2
 
index b92e06a9af6d5696b2864a077269379526bf0036..93767fe7924ff3b47298b68b85c659c4bad949d6 100644 (file)
@@ -18,7 +18,7 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([altos], 1.3)
+AC_INIT([altos], 1.3.1)
 AC_CONFIG_SRCDIR([src/core/ao.h])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
@@ -30,7 +30,7 @@ dnl ==========================================================================
 dnl Java library versions
 
 ALTOSUILIB_VERSION=1
-ALTOSLIB_VERSION=2
+ALTOSLIB_VERSION=3
 
 AC_SUBST(ALTOSLIB_VERSION)
 AC_DEFINE(ALTOSLIB_VERSION,$ALTOSLIB_VERSION,[Version of the AltosLib package])
@@ -430,7 +430,58 @@ if test x"$HAVE_STLINK" = "xyes"; then
        AC_DEFINE(HAVE_STLINK,1,[Using STlink library])
 fi
 
-AM_CONDITIONAL([LIBSTLINK], [test x$HAVE_STLINK == xyes])
+AM_CONDITIONAL([LIBSTLINK], [test x$HAVE_STLINK = xyes])
+
+AC_ARG_ENABLE([multi-arch],
+             [AS_HELP_STRING([--enable-multi-arch],
+                             [enable building both i386 and amd64 libraries (default=auto)])],
+             [MULTI_ARCH=$enableval],
+             [MULTI_ARCH=auto])
+
+case x"$MULTI_ARCH" in
+xauto)
+       arch=`uname -m`
+       case x"$arch" in
+       xx86_64|xi*86)
+               save_CFLAGS="$CFLAGS"
+               save_LIBS="$LIBS"
+               LIBS="-lbluetooth"
+               CFLAGS="-m64"
+               AC_MSG_CHECKING([if ]$CC[ ]$CFLAGS[ can link programs])
+               AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
+                               [M64_LINK=yes],
+                               [M64_LINK=no])
+               AC_MSG_RESULT([$M64_LINK])
+               CFLAGS="-m32"
+               AC_MSG_CHECKING([if ]$CC[ ]$CFLAGS[ can link programs])
+               AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
+                               [M32_LINK=yes],
+                               [M32_LINK=no])
+               AC_MSG_RESULT([$M32_LINK])
+               CFLAGS="$save_CFLAGS"
+               LIBS="$save_LIBS"
+               case x"$M64_LINK"x"$M32_LINK" in
+               xyesxyes)
+                       MULTI_ARCH=yes
+                       ;;
+               *)
+                       MULTI_ARCH=no
+                       ;;
+               esac
+               ;;
+       *)
+               MULTI_ARCH=no
+               ;;
+       esac
+       ;;
+xyes|xno)
+       ;;
+*)
+       MULTI_ARCH="no"
+       ;;
+esac
+       
+AM_CONDITIONAL([MULTI_ARCH], [test x$MULTI_ARCH = xyes])
 
 AC_OUTPUT([
 Makefile
@@ -483,6 +534,7 @@ echo "    AVR support.................: ${HAVE_AVR_CC}"
 echo "    Android support.............: ${HAVE_ANDROID_SDK}"
 echo "    STlink support..............: ${HAVE_STLINK}"
 echo "    Local pdclib................: ${HAVE_PDCLIB}"
+echo "    i386 and amd64 libaltos.....: ${MULTI_ARCH}"
 echo ""
 echo "  Java paths"
 echo "    freetts.....................: ${FREETTS}"
index dcdb776345f07fc3988f2e3d8b6562aa001e3b5b..4a7eba6803404cba8a5821c7402b63ca6791af33 100644 (file)
@@ -8,3 +8,5 @@ doc/altos.html
 doc/altos.pdf
 doc/telemetrum-outline.pdf
 doc/telemega-outline.pdf
+doc/easymini-outline.pdf
+doc/telemini.pdf
index bc8dc2a2f408315267f6a10251ccf6b06c6c110c..80310869a4ef4d0b29032999d2328c98904e8401 100644 (file)
@@ -12,7 +12,8 @@ RELNOTES=\
        release-notes-1.1.1.html \
        release-notes-1.2.html \
        release-notes-1.2.1.html \
-       release-notes-1.3.html
+       release-notes-1.3.html \
+       release-notes-1.3.1.html
 
 PICTURES=\
        altosui.png \
index c71e08a7dc2ddec4530fd9dc7909019675bda403..036b0b6177b992de9f0b47937cb6a2d9b25a8053 100644 (file)
@@ -22,7 +22,7 @@
       <surname>Towns</surname>
     </author>
     <copyright>
-      <year>2013</year>
+      <year>2014</year>
       <holder>Bdale Garbee and Keith Packard</holder>
     </copyright>
     <legalnotice>
       </para>
     </legalnotice>
     <revhistory>
+      <revision>
+       <revnumber>1.3.1</revnumber>
+       <date>21 January 2014</date>
+       <revremark>
+         Bug fixes for TeleMega and TeleMetrum v2.0 along with a few
+         small UI improvements.
+       </revremark>
+      </revision>
       <revision>
        <revnumber>1.3</revnumber>
        <date>12 November 2013</date>
@@ -1578,7 +1586,7 @@ NAR #88757, TRA #12200
     <informalfigure>
       <mediaobject>
        <imageobject>
-         <imagedata fileref="altosui.png" width="5.5in"/>
+         <imagedata fileref="altosui.png" width="4.6in"/>
        </imageobject>
       </mediaobject>
     </informalfigure>
@@ -1603,7 +1611,7 @@ NAR #88757, TRA #12200
       <informalfigure>
        <mediaobject>
          <imageobject>
-           <imagedata fileref="device-selection.png" width="3.5in"/>
+           <imagedata fileref="device-selection.png" width="3.1in"/>
          </imageobject>
        </mediaobject>
       </informalfigure>
@@ -1787,10 +1795,10 @@ NAR #88757, TRA #12200
           rocket as it heads towards apogee.
         </para>
         <para>
-          The height, speed and acceleration are shown along with the
-          maximum values for each of them. This allows you to quickly
-          answer the most commonly asked questions you'll hear during
-          flight.
+          The height, speed, acceleration and tilt are shown along
+          with the maximum values for each of them. This allows you to
+          quickly answer the most commonly asked questions you'll hear
+          during flight.
         </para>
         <para>
           The current latitude and longitude reported by the GPS are
@@ -2015,7 +2023,7 @@ NAR #88757, TRA #12200
        <informalfigure>
          <mediaobject>
            <imageobject>
-             <imagedata fileref="graph.png" width="5.5in" scalefit="1"/>
+             <imagedata fileref="graph.png" width="6in" scalefit="1"/>
            </imageobject>
          </mediaobject>
        </informalfigure>
@@ -2037,7 +2045,7 @@ NAR #88757, TRA #12200
        <informalfigure>
          <mediaobject>
            <imageobject>
-             <imagedata fileref="graph-configure.png" width="5.5in" scalefit="1"/>
+             <imagedata fileref="graph-configure.png" width="6in" scalefit="1"/>
            </imageobject>
          </mediaobject>
        </informalfigure>
@@ -2052,7 +2060,7 @@ NAR #88757, TRA #12200
        <informalfigure>
          <mediaobject>
            <imageobject>
-             <imagedata fileref="graph-stats.png" width="5.5in" scalefit="1"/>
+             <imagedata fileref="graph-stats.png" width="6in" scalefit="1"/>
            </imageobject>
          </mediaobject>
        </informalfigure>
@@ -2065,7 +2073,7 @@ NAR #88757, TRA #12200
        <informalfigure>
          <mediaobject>
            <imageobject>
-             <imagedata fileref="graph-map.png" width="5.5in" scalefit="1"/>
+             <imagedata fileref="graph-map.png" width="6in" scalefit="1"/>
            </imageobject>
          </mediaobject>
        </informalfigure>
@@ -2122,7 +2130,7 @@ NAR #88757, TRA #12200
       <informalfigure>
        <mediaobject>
          <imageobject>
-           <imagedata fileref="configure-altimeter.png" width="3in" scalefit="1"/>
+           <imagedata fileref="configure-altimeter.png" width="3.6in" scalefit="1"/>
          </imageobject>
        </mediaobject>
       </informalfigure>
@@ -2379,7 +2387,7 @@ NAR #88757, TRA #12200
       <informalfigure>
        <mediaobject>
          <imageobject>
-           <imagedata fileref="configure-altosui.png" width="2.5in" scalefit="1"/>
+           <imagedata fileref="configure-altosui.png" width="2.4in" scalefit="1"/>
          </imageobject>
        </mediaobject>
       </informalfigure>
@@ -2489,7 +2497,7 @@ NAR #88757, TRA #12200
       <informalfigure>
        <mediaobject>
          <imageobject>
-           <imagedata fileref="configure-groundstation.png" width="3in" scalefit="1"/>
+           <imagedata fileref="configure-groundstation.png" width="3.1in" scalefit="1"/>
          </imageobject>
        </mediaobject>
       </informalfigure>
@@ -2584,7 +2592,7 @@ NAR #88757, TRA #12200
       <informalfigure>
        <mediaobject>
          <imageobject>
-           <imagedata fileref="fire-igniter.png" width="1in" scalefit="1"/>
+           <imagedata fileref="fire-igniter.png" width="1.2in" scalefit="1"/>
          </imageobject>
        </mediaobject>
       </informalfigure>
@@ -2598,8 +2606,8 @@ NAR #88757, TRA #12200
       <para>
        Selecting the 'Fire Igniter' button brings up the usual device
        selection dialog. Pick the desired device. This brings up another 
-       window which shows the current continuity test status for both 
-       apogee and main charges.
+       window which shows the current continuity test status for all
+       of the pyro channels.
       </para>
       <para>
        Next, select the desired igniter to fire. This will enable the
@@ -2618,7 +2626,7 @@ NAR #88757, TRA #12200
       <informalfigure>
        <mediaobject>
          <imageobject>
-           <imagedata fileref="scan-channels.png" width="2.75in" scalefit="1"/>
+           <imagedata fileref="scan-channels.png" width="3.2in" scalefit="1"/>
          </imageobject>
        </mediaobject>
       </informalfigure>
@@ -2636,7 +2644,7 @@ NAR #88757, TRA #12200
       <informalfigure>
        <mediaobject>
          <imageobject>
-           <imagedata fileref="load-maps.png" width="5.5in" scalefit="1"/>
+           <imagedata fileref="load-maps.png" width="5.2in" scalefit="1"/>
          </imageobject>
        </mediaobject>
       </informalfigure>
@@ -4186,11 +4194,12 @@ NAR #88757, TRA #12200
           Then, divide 434.550 MHz by the
           measured frequency and multiply by the current radio cal value show
           in the 'c s' command.  For an unprogrammed board, the default value
-          is 1186611.  Take the resulting integer and program it using the 'c f'
+          is 1186611 for cc1111 based products and 7119667 for cc1120
+         based products.  Take the resulting integer and program it using the 'c f'
           command.  Testing with the 'C' command again should show a carrier
           within a few tens of Hertz of the intended frequency.
           As with all 'c' sub-commands, follow this with a 'c w' to write the
-          change to the parameter block in the on-board DataFlash chip.
+          change to the configuration memory.
         </para>
     <para>
       Note that the 'reboot' command, which is very useful on the altimeters,
@@ -4447,6 +4456,13 @@ NAR #88757, TRA #12200
   </appendix>
   <appendix>
     <title>Release Notes</title>
+    <simplesect>
+      <title>Version 1.3.1</title>
+      <xi:include
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         href="release-notes-1.3.1.xsl"
+         xpointer="xpointer(/article/*)"/>
+    </simplesect>
     <simplesect>
       <title>Version 1.3</title>
       <xi:include
index fd1cd09a303e9f090f7127fc4ed94d1a6f911a5c..6601ecb7d281609e049cbd83c47e0b96f01a0401 100644 (file)
Binary files a/doc/ascent.png and b/doc/ascent.png differ
index 0c479e72ae8bb3c0f4bdea5c278af80bea3d051d..3dd838d490edb75f6549edc3e0feaa8a79cdf167 100644 (file)
Binary files a/doc/descent.png and b/doc/descent.png differ
index 85804573dba0837c80b386c1ad52708908ad58cb..f870c49351fe05c994774894a0c76d1d86ef888d 100644 (file)
Binary files a/doc/fire-igniter.png and b/doc/fire-igniter.png differ
index b588833831b27e467869a9631a4f1f20a828588c..e72b6c5f5e2db2a169c470278acd9283b199ed11 100644 (file)
Binary files a/doc/graph-configure.png and b/doc/graph-configure.png differ
index 7b4f31771e0dd8c1a4d9c660d01f7c68e272a1c9..41eeba22f5b940a91df8b91a4f0fd2739dfd14ca 100644 (file)
Binary files a/doc/landed.png and b/doc/landed.png differ
index a6f142ddff98a5d6cac98243e1e8a1b2ca028a69..701074eaba682e15f5db7d871bbf637e852d0db2 100644 (file)
Binary files a/doc/launch-pad.png and b/doc/launch-pad.png differ
diff --git a/doc/release-notes-1.3.1.xsl b/doc/release-notes-1.3.1.xsl
new file mode 100644 (file)
index 0000000..1ccbfa1
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"/usr/share/xml/docbook/schema/dtd/4.5/docbookx.dtd">
+
+<article>
+  <para>
+    Version 1.3.1 is a minor release. It improves support for TeleMega,
+    TeleMetrum v2.0, TeleMini v2.0 and EasyMini.
+  </para>
+  <para>
+    AltOS Firmware Changes
+    <itemizedlist>
+      <listitem>
+       <para>
+         Improve sensor boot code. If sensors fail to self-test, the
+         device will still boot up and check for pad/idle modes. If
+         in idle mode, the device will warn the user with a distinct
+         beep, if in Pad mode, the unit will operate as best it
+         can. Also, the Z-axis accelerometer now uses the factory
+         calibration values instead of re-calibrating on the pad each
+         time. This avoids accidental boost detect when moving the
+         device around while in Pad mode.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Fix antenna-down mode accelerometer configuration. Antenna
+         down mode wasn't working because the accelerometer
+         calibration values were getting re-computed incorrectly in
+         inverted mode.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Improved APRS mode. Now uses compressed position format for
+         smaller data size, improved precision and to include
+         altitude data as well as latitude and longitude. Also added
+         battery and pyro voltage reports in the APRS comment field
+         so you can confirm that the unit is ready for launch.
+       </para>
+      </listitem>
+    </itemizedlist>
+  </para>
+  <para>
+    AltosUI changes
+    <itemizedlist>
+      <listitem>
+       <para>
+         Display additional TeleMega sensor values in real
+         units. Make all of these values available for
+         plotting. Display TeleMega orientation value in the Ascent
+         and Table tabs.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Support additional TeleMega pyro channels in the Fire
+         Igniter dialog. This lets you do remote testing of all of
+         the channels, rather than just Apogee and Main.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Limit data rate when downloading satellite images from
+         Google to make sure we stay within their limits so that all
+         of the map tiles download successfully.
+       </para>
+      </listitem>
+    </itemizedlist>
+  </para>
+</article>
index a6d3f78ba64672a48e45d8f6be4d3cee80e771ce..e0a99ecced4cd3fee0e730b675cace7a916d6162 100644 (file)
Binary files a/doc/site-map.png and b/doc/site-map.png differ
index 86cb9881c56d09132ffa0d14e96ff17486ba6667..ee61219707f3dba51c83f138e1474ba9f53c9f7c 100644 (file)
Binary files a/doc/table.png and b/doc/table.png differ
diff --git a/doc/telemini.pdf b/doc/telemini.pdf
new file mode 100644 (file)
index 0000000..9d7f023
Binary files /dev/null and b/doc/telemini.pdf differ
index 6d043d602350d967e70c852bf9efb4d404f3962e..20c3d47a316c92d4b3236f1d04c28612b53e68ca 100644 (file)
@@ -9,5 +9,7 @@ classlibaltos.stamp
 libaltos_wrap.c
 libaltosJNI
 cjnitest
+cjnitest32
+cjnitest64
 libaltos.swig
 swig_bindings/
index 831432fc1a8e6e7aec7d12f6f5c64c04d10ed569..969aa8ad95ac483b6967d6df5354d08880a5f997 100644 (file)
@@ -5,8 +5,7 @@ AM_JAVACFLAGS=-target 1.6 -encoding UTF-8 -Xlint:deprecation -source 6
 altoslibdir=$(libdir)/altos
 
 altoslib_LTLIBRARIES=libaltos.la
-
-libaltos_la_LDFLAGS = -version-info 1:0:1
+libaltos_la_LDFLAGS=-version-info 1:0:1
 
 libaltos_la_SOURCES=\
        libaltos.c \
@@ -14,8 +13,35 @@ libaltos_la_SOURCES=\
 
 noinst_PROGRAMS=cjnitest
 
+cjnitest_SOURCES=cjnitest.c
 cjnitest_LDADD=libaltos.la
 
+if MULTI_ARCH
+altoslib_LTLIBRARIES+=libaltos32.la libaltos64.la
+
+libaltos32_la_LDFLAGS=$(libaltos_la_LDFLAGS)
+libaltos64_la_LDFLAGS=$(libaltos_la_LDFLAGS)
+
+libaltos32_la_CFLAGS=-m32 $(AM_CFLAGS)
+libaltos64_la_CFLAGS=-m64 $(AM_CFLAGS)
+
+libaltos32_la_SOURCES=$(libaltos_la_SOURCES)
+libaltos64_la_SOURCES=$(libaltos_la_SOURCES)
+
+noinst_PROGRAMS+=cjnitest32 cjnitest64
+
+cjnitest32_CFLAGS=-m32
+cjnitest64_CFLAGS=-m64
+
+cjnitest32_SOURCES=$(cjnitest_SOURCES)
+cjnitest64_SOURCES=$(cjnitest_SOURCES)
+
+cjnitest32_LDADD=libaltos32.la
+cjnitest64_LDADD=libaltos64.la
+
+endif
+
+
 LIBS=-lbluetooth
 
 HFILES=libaltos.h
index 07806fa4bab465014f33cd7acfd41dabec606f2c..04e9ad3206e5400638a46c44254ca1df1e595e8c 100644 (file)
@@ -20,7 +20,7 @@ package org.altusmetrum.micropeak;
 import java.lang.*;
 import java.io.*;
 import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 class MicroIterator implements Iterator<MicroDataPoint> {
index a9095f9c6bc9ed5da1c5d21b9d9d5a4486f982d0..ec76824d9b816da64a188cd9ac88804fd44146c9 100644 (file)
@@ -23,7 +23,7 @@ import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class MicroDownload extends AltosUIDialog implements Runnable, ActionListener {
index 5af767c6a92a3f5523285001ab649e1b67108497..c170f544a45a08eded6c93524cefd793b5c5ac87 100644 (file)
@@ -23,7 +23,7 @@ import java.util.ArrayList;
 import java.awt.*;
 import javax.swing.*;
 import javax.swing.filechooser.FileNameExtensionFilter;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class MicroExport extends JFileChooser {
index 2b02e20a5d0c9cb9dda54c53eb6243bcbf7da4c7..b6a9d4013756e4aed96786ad829cdec275e2ee8d 100644 (file)
@@ -19,7 +19,7 @@ package org.altusmetrum.micropeak;
 
 import java.io.*;
 import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class MicroFile {
index 3ca128ee97bfddc79cefd3f55ad77d2162b7b528..595d1ff7dfad39df3966af0fbb610268bbdb223a 100644 (file)
@@ -20,7 +20,7 @@ package org.altusmetrum.micropeak;
 import javax.swing.*;
 import javax.swing.filechooser.FileNameExtensionFilter;
 import java.io.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class MicroFileChooser extends JFileChooser {
index fba6290723a10449ab4a3e6119064c550407d6dc..5960fe4dfbfc7cfce2a500bfff951997e0357785 100644 (file)
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 import org.jfree.ui.*;
index 27a8db02a262845ba2fb2feb5c0f3f763a62ccb3..2a8e2ca63c754e0aa8b4d0e193a212bead74de85 100644 (file)
@@ -23,7 +23,7 @@ import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
 import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class MicroPeak extends MicroFrame implements ActionListener, ItemListener {
index 0520fa7145da1edd9ef81bd4e6eef5042d1f0b68..d64da387c27e6530b91f2ae6cafe7f5c4ad687e7 100644 (file)
@@ -20,7 +20,7 @@ package org.altusmetrum.micropeak;
 import java.awt.*;
 import java.io.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class MicroRaw extends JTextArea {
index 1f1ef3cb86df99e779a7fa87ab3ab45548272ad7..0addfa8861c8008eacec07e8abf7bd076aea7908 100644 (file)
@@ -24,7 +24,7 @@ import javax.swing.filechooser.FileNameExtensionFilter;
 import java.io.*;
 import java.util.concurrent.*;
 import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class MicroSave extends JFileChooser {
index 32d944322caf76705fa3b31be602e4a9970d92e8..765525b0959f48caf277ccd401d45d1730997df4 100644 (file)
@@ -18,7 +18,7 @@
 package org.altusmetrum.micropeak;
 
 import java.io.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class MicroStats {
index 4400a317f193d78f1e6a17e439e7f1d0c427cdf9..ea1609ac7fac43ef935bdd7fce910261035b8bd7 100644 (file)
@@ -19,7 +19,7 @@ package org.altusmetrum.micropeak;
 
 import java.awt.*;
 import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
 import org.altusmetrum.altosuilib_1.*;
 
 public class MicroStatsTable extends JComponent implements AltosFontListener {
index 52463f5d3b2f202be30b49b19d35f7601b3518c5..a04174c6ec12b1bf9eec44b796bc6e57112dcdab 100644 (file)
@@ -367,6 +367,7 @@ static uint8_t iv[16];
 void
 ao_aes_set_mode(enum ao_aes_mode mode)
 {
+       (void) mode;
        /* we only do CBC_MAC anyways... */
 }
 
index 0b634a7994dd83ad0361649f66a6463c46645b85..29ad26031d9733cfe7409b31127c06c53698ec41 100644 (file)
@@ -307,6 +307,17 @@ ao_altitude_to_pa(alt_t alt);
 #include <ao_serial.h>
 #endif
 
+/*
+ * ao_convert_volt.c
+ *
+ * Convert ADC readings to decivolts
+ */
+
+int16_t
+ao_battery_decivolt(int16_t adc);
+
+int16_t
+ao_ignite_decivolt(int16_t adc);
 
 /*
  * ao_spi_slave.c
index a30ec64a5e8a9d0c1c4c8ea59d7766e363ae5ea2..4482f673f59c0fdbbe132f0c52bcd89d1095a762 100644 (file)
@@ -353,9 +353,9 @@ ao_config_accel_calibrate_set(void) __reentrant
 {
        int16_t up, down;
 #if HAS_GYRO
-       int16_t accel_along_up, accel_along_down;
-       int16_t accel_across_up, accel_across_down;
-       int16_t accel_through_up, accel_through_down;
+       int16_t accel_along_up = 0, accel_along_down = 0;
+       int16_t accel_across_up = 0, accel_across_down = 0;
+       int16_t accel_through_up = 0, accel_through_down = 0;
 #endif
        
        ao_cmd_decimal();
@@ -390,9 +390,11 @@ ao_config_accel_calibrate_set(void) __reentrant
        ao_config.accel_plus_g = up;
        ao_config.accel_minus_g = down;
 #if HAS_GYRO
-       ao_config.accel_zero_along = (accel_along_up + accel_along_down) / 2;
-       ao_config.accel_zero_across = (accel_across_up + accel_across_down) / 2;
-       ao_config.accel_zero_through = (accel_through_up + accel_through_down) / 2;
+       if (ao_cmd_lex_i == 0) {
+               ao_config.accel_zero_along = (accel_along_up + accel_along_down) / 2;
+               ao_config.accel_zero_across = (accel_across_up + accel_across_down) / 2;
+               ao_config.accel_zero_through = (accel_through_up + accel_through_down) / 2;
+       }
 #endif
        _ao_config_edit_finish();
 }
@@ -512,6 +514,10 @@ ao_config_pad_orientation_show(void) __reentrant
        printf("Pad orientation: %d\n", ao_config.pad_orientation);
 }
 
+#ifndef AO_ACCEL_INVERT
+#define AO_ACCEL_INVERT        0x7fff
+#endif
+
 void
 ao_config_pad_orientation_set(void) __reentrant
 {
@@ -521,10 +527,10 @@ ao_config_pad_orientation_set(void) __reentrant
        _ao_config_edit_start();
        ao_cmd_lex_i &= 1;
        if (ao_config.pad_orientation != ao_cmd_lex_i) {
-               uint16_t t;
+               int16_t t;
                t = ao_config.accel_plus_g;
-               ao_config.accel_plus_g = 0x7fff - ao_config.accel_minus_g;
-               ao_config.accel_minus_g = 0x7fff - t;
+               ao_config.accel_plus_g = AO_ACCEL_INVERT - ao_config.accel_minus_g;
+               ao_config.accel_minus_g = AO_ACCEL_INVERT - t;
        }
        ao_config.pad_orientation = ao_cmd_lex_i;
        _ao_config_edit_finish();
@@ -656,8 +662,10 @@ ao_config_help(void) __reentrant;
 static void
 ao_config_show(void) __reentrant;
 
+#if HAS_EEPROM
 static void
 ao_config_save(void) __reentrant;
+#endif
 
 __code struct ao_config_var ao_config_vars[] = {
 #if HAS_FLIGHT
diff --git a/src/core/ao_convert_volt.c b/src/core/ao_convert_volt.c
new file mode 100644 (file)
index 0000000..8556d42
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright Â© 2014 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#include "ao.h"
+
+#define scale(v,p,m)   ((int32_t) (v) * (AO_ADC_REFERENCE_DV * ((p) + (m))) / (AO_ADC_MAX * (m)))
+
+int16_t
+ao_battery_decivolt(int16_t adc)
+{
+       return scale(adc, AO_BATTERY_DIV_PLUS, AO_BATTERY_DIV_MINUS);
+}
+
+int16_t
+ao_ignite_decivolt(int16_t adc)
+{
+       return scale(adc, AO_IGNITE_DIV_PLUS, AO_IGNITE_DIV_MINUS);
+}
+
index e1d8a1392acc537b1925de297caecf0afac93c3c..c4b062fdb1d0f9f4631354ada9b2baa30df9910a 100644 (file)
@@ -273,14 +273,16 @@ typedef int16_t accel_t;
 
 /* MMA655X is hooked up so that positive values represent negative acceleration */
 
+#define AO_ACCEL_INVERT                4095
+
 #define ao_data_accel(packet)                  ((packet)->mma655x)
 #if AO_MMA655X_INVERT
-#define ao_data_accel_cook(packet)             (4095 - (packet)->mma655x)
+#define ao_data_accel_cook(packet)             (AO_ACCEL_INVERT - (packet)->mma655x)
 #else
 #define ao_data_accel_cook(packet)             ((packet)->mma655x)
 #endif
 #define ao_data_set_accel(packet, accel)       ((packet)->mma655x = (accel))
-#define ao_data_accel_invert(accel)            (4095 - (accel))
+#define ao_data_accel_invert(accel)            (AO_ACCEL_INVERT - (accel))
 
 #endif
 
@@ -288,6 +290,8 @@ typedef int16_t accel_t;
 
 #define HAS_ACCEL      1
 
+#define AO_ACCEL_INVERT                0
+
 typedef int16_t accel_t;
 
 /* MPU6000 is hooked up so that positive y is positive acceleration */
index eedea8f42aba7dd81d4dab571f5116ae90e4a2af..618756c1ce7ea3984959334a7852213c1b6db462 100644 (file)
@@ -31,7 +31,7 @@ void
 ao_fec_dump_bytes(const uint8_t *bytes, uint16_t len, const char *name);
 #endif
 
-static uint16_t inline
+static inline uint16_t
 ao_fec_crc_byte(uint8_t byte, uint16_t crc)
 {
        uint8_t bit;
index 463ff4a2974b38e045fb2214ca9bc163cd490d28..702c340385177df203a000494ad7fef49c190a88 100644 (file)
@@ -46,7 +46,7 @@ __pdata enum ao_flight_state  ao_flight_state;        /* current flight state */
 __pdata uint16_t               ao_boost_tick;          /* time of launch detect */
 __pdata uint16_t               ao_motor_number;        /* number of motors burned so far */
 
-#if HAS_IMU
+#if HAS_SENSOR_ERRORS
 /* Any sensor can set this to mark the flight computer as 'broken' */
 __xdata uint8_t                        ao_sensor_errors;
 #endif
@@ -104,9 +104,6 @@ ao_flight(void)
                            ao_config.accel_minus_g == 0 ||
                            ao_ground_accel < ao_config.accel_plus_g - ACCEL_NOSE_UP ||
                            ao_ground_accel > ao_config.accel_minus_g + ACCEL_NOSE_UP ||
-#if HAS_IMU
-                           ao_sensor_errors ||
-#endif
                            ao_ground_height < -1000 ||
                            ao_ground_height > 7000)
                        {
@@ -152,7 +149,11 @@ ao_flight(void)
 #endif
                        } else {
                                /* Set idle mode */
-                               ao_flight_state = ao_flight_idle;
+                               ao_flight_state = ao_flight_idle;
+#if HAS_SENSOR_ERRORS
+                               if (ao_sensor_errors)
+                                       ao_flight_state = ao_flight_invalid;
+#endif
  
 #if HAS_ACCEL && HAS_RADIO && PACKET_HAS_SLAVE
                                /* Turn on packet system in idle mode on TeleMetrum */
@@ -400,7 +401,7 @@ ao_flight_dump(void)
 #if HAS_ACCEL
        int16_t accel;
 
-       accel = ((ao_ground_accel - ao_sample_accel) * ao_accel_scale) >> 16;
+       accel = ((ao_config.accel_plus_g - ao_sample_accel) * ao_accel_scale) >> 16;
 #endif
 
        printf ("sample:\n");
@@ -442,9 +443,18 @@ ao_gyro_test(void)
        ao_flight_state = ao_flight_idle;
 }
 
+uint8_t ao_orient_test;
+
+static void
+ao_orient_test_select(void)
+{
+       ao_orient_test = !ao_orient_test;
+}
+
 __code struct ao_cmds ao_flight_cmds[] = {
        { ao_flight_dump,       "F\0Dump flight status" },
        { ao_gyro_test,         "G\0Test gyro code" },
+       { ao_orient_test_select,"O\0Test orientation code" },
        { 0, NULL },
 };
 #endif
index c7c02ccf69cc4166e0549513d5d1b02971a4c078..01d21c119538701bccb08de33df65c93180e9ae1 100644 (file)
@@ -41,7 +41,11 @@ extern __pdata enum ao_flight_state  ao_flight_state;
 extern __pdata uint16_t                        ao_boost_tick;
 extern __pdata uint16_t                        ao_motor_number;
 
-#if HAS_IMU
+#if HAS_IMU || HAS_MMA655X
+#define HAS_SENSOR_ERRORS      1
+#endif
+
+#if HAS_SENSOR_ERRORS
 extern __xdata uint8_t                 ao_sensor_errors;
 #endif
 
index d13885dd8cc5581c01d2a15718a730184289bd29..07a2bc5b0ce7790f0c43ed4bcb88e2897ed761ab 100644 (file)
@@ -24,7 +24,6 @@ ao_gps_report_mega(void)
        static __xdata struct ao_log_mega               gps_log;
        static __xdata struct ao_telemetry_location     gps_data;
        static __xdata struct ao_telemetry_satellite    gps_tracking_data;
-       uint8_t date_reported = 0;
        uint8_t new;
        uint8_t c, n, i;
 
index fa03897622da3b462560f49319f4240342b1ee8d..696a833b8147afd45d23dbbba2e9a9b0cdefed2e 100644 (file)
@@ -24,9 +24,8 @@ ao_gps_report_metrum(void)
        static __xdata struct ao_log_metrum             gps_log;
        static __xdata struct ao_telemetry_location     gps_data;
        static __xdata struct ao_telemetry_satellite    gps_tracking_data;
-       uint8_t c, n, i, p, valid, packets;
+       uint8_t c, n, i;
        uint8_t svid;
-       uint8_t date_reported = 0;
        uint8_t new;
 
        for (;;) {
index 9f2ec0a7afc98a972ff020a5ec09df0a80890ac8..823d003c8a0a7574f43859a75de6c2af1ec7c315 100644 (file)
@@ -114,6 +114,8 @@ ao_igniter_fire(enum ao_igniter igniter)
                        ao_delay(AO_IGNITER_FIRE_TIME);
                        AO_IGNITER_SET_MAIN(0);
                        break;
+               default:
+                       break;
                }
                break;
        case AO_IGNITE_MODE_MAIN:
@@ -127,6 +129,8 @@ ao_igniter_fire(enum ao_igniter igniter)
                        ao_delay(AO_IGNITER_FIRE_TIME);
                        AO_IGNITER_SET_MAIN(0);
                        break;
+               default:
+                       break;
                }
                break;
        }
index 7fd4f88992c09035e321b954b616819c85345379..9aea1f14762f6139d9fb8dce932b98a6c946068d 100644 (file)
@@ -166,7 +166,7 @@ ao_kalman_err_accel(void)
 {
        int32_t accel;
 
-       accel = (ao_ground_accel - ao_sample_accel) * ao_accel_scale;
+       accel = (ao_config.accel_plus_g - ao_sample_accel) * ao_accel_scale;
 
        /* Can't use ao_accel here as it is the pre-prediction value still */
        ao_error_a = (accel - ao_k_accel) >> 16;
index 701c81aba7444ba95c8a4ae7203c5fa7683c61dc..20febefe27f2df4693ad4cd02b6f31b96aaa20ea 100644 (file)
@@ -196,7 +196,9 @@ ao_log_full(void)
        return ao_log_current_pos == ao_log_end_pos;
 }
 
+#if HAS_ADC
 static __xdata struct ao_task ao_log_task;
+#endif
 
 void
 ao_log_list(void) __reentrant
index 43441e7a086e30792186ae94a475345660046bfc..91624d980f18b2c636db081668d16ce3f64ea62d 100644 (file)
@@ -81,7 +81,6 @@ void
 ao_log(void)
 {
        __pdata uint16_t        next_sensor, next_other;
-       uint8_t                 i;
 
        ao_storage_setup();
 
index 99a85982042b676115b30dac7a5c1fbdd470fe95..29e3bd9f6d87fcc40dfc570c1a571765aea95552 100644 (file)
@@ -78,7 +78,7 @@ typedef uint8_t check_log_size[1-(256 % sizeof(struct ao_log_mini))] ;
 void
 ao_log(void)
 {
-       __pdata uint16_t        next_sensor, next_other;
+       __pdata uint16_t        next_sensor;
 
        ao_storage_setup();
 
@@ -99,7 +99,7 @@ ao_log(void)
         * when starting up.
         */
        ao_log_data_pos = ao_data_ring_next(ao_data_head);
-       next_other = next_sensor = ao_data_ring[ao_log_data_pos].tick;
+       next_sensor = ao_data_ring[ao_log_data_pos].tick;
        ao_log_state = ao_flight_startup;
        for (;;) {
                /* Write samples to EEPROM */
index a41712d2d3a248c07ff56c1c9cbe229cf3f6d7d9..6f967e6d2201db4d520f5410c33f7a038f00491d 100644 (file)
@@ -41,5 +41,6 @@ ao_sleep(__xdata void *wchan)
 void
 ao_wakeup(__xdata void *wchan)
 {
+       (void) wchan;
        ao_wchan = 0;
 }
index a260aa99f332cbaf7324e7e63f67956fb241719c..e59f5bc4bdbf8881ab1c88a1970127ae687604bc 100644 (file)
@@ -436,7 +436,7 @@ ao_pyro_set(void)
        if (ao_cmd_status != ao_cmd_success)
                return;
        p = ao_cmd_lex_i;
-       if (p < 0 || AO_PYRO_NUM <= p) {
+       if (AO_PYRO_NUM <= p) {
                printf ("invalid pyro channel %d\n", p);
                return;
        }
index 3ca3c313fd7c1826a3c7a9f468adb0fb5677bc52..bff848f6d249fd797bfd02198619e5f366fe68e8 100644 (file)
@@ -21,7 +21,6 @@
 static __xdata uint8_t ao_radio_cmac_mutex;
 __pdata int8_t ao_radio_cmac_rssi;
 static __xdata uint8_t cmac_data[AO_CMAC_MAX_LEN + AO_CMAC_KEY_LEN + 2 + AO_CMAC_KEY_LEN];
-static __pdata uint8_t ao_radio_cmac_len;
 
 static uint8_t
 round_len(uint8_t len)
index adf8399dd702535d960804791669cde9f204a812..34658951724e7166dbc3008a9079a2f7a1df8e59 100644 (file)
@@ -92,6 +92,10 @@ __pdata int32_t      ao_sample_roll_sum;
 static struct ao_quaternion ao_rotation;
 #endif
 
+#if HAS_FLIGHT_DEBUG
+extern uint8_t ao_orient_test;
+#endif
+
 static void
 ao_sample_preflight_add(void)
 {
@@ -159,7 +163,11 @@ ao_sample_preflight_set(void)
         * that as the current rotation vector
         */
        ao_quaternion_vectors_to_rotation(&ao_rotation, &up, &orient);
+#if HAS_FLIGHT_DEBUG
+       if (ao_orient_test)
+               printf("\n\treset\n");
 #endif 
+#endif
        nsamples = 0;
 }
 
@@ -210,6 +218,17 @@ ao_sample_rotate(void)
        rotz = ao_rotation.z * ao_rotation.z - ao_rotation.y * ao_rotation.y - ao_rotation.x * ao_rotation.x + ao_rotation.r * ao_rotation.r;
 
        ao_sample_orient = acosf(rotz) * (float) (180.0/M_PI);
+
+#if HAS_FLIGHT_DEBUG
+       if (ao_orient_test) {
+               printf ("rot %d %d %d orient %d     \r",
+                       (int) (x * 1000),
+                       (int) (y * 1000),
+                       (int) (z * 1000),
+                       ao_sample_orient);
+       }
+#endif
+
 }
 #endif
 
index c118d0077b3485b40577894dda456b0aba901aa6..5a00d825671d7ae35ceee5f1f06ddce0b7f98081 100644 (file)
@@ -24,9 +24,9 @@
 #endif
 
 static __pdata uint16_t ao_telemetry_interval;
-static __pdata uint8_t ao_rdf = 0;
 
 #if HAS_RDF
+static __pdata uint8_t ao_rdf = 0;
 static __pdata uint16_t ao_rdf_time;
 #endif
 
@@ -211,7 +211,6 @@ ao_send_metrum_data(void)
 {
        if (--ao_telemetry_metrum_data_cur <= 0) {
                __xdata struct ao_data *packet = (__xdata struct ao_data *) &ao_data_ring[ao_data_ring_prev(ao_sample_data)];
-               uint8_t i;
 
                telemetry.generic.tick = packet->tick;
                telemetry.generic.type = AO_TELEMETRY_METRUM_DATA;
@@ -473,7 +472,6 @@ ao_telemetry(void)
                        }
                        else
                                time = ao_time();
-               bottom: ;
                }
        }
 }
index 6ab61e6a3018f9d945bce57be25eb5176e251a3c..56d984375ba82f725875cddd1cc921e74c285aa5 100644 (file)
 #endif
 
 #include <ao_aprs.h>
+#include <math.h>
 
 // Public methods, constants, and data structures for each class.
 
@@ -254,9 +255,9 @@ typedef enum
 /// AX.25 compliant packet header that contains destination, station call sign, and path.
 /// 0x76 for SSID-11, 0x78 for SSID-12
 static uint8_t TNC_AX25_HEADER[] = { 
-    'A' << 1, 'P' << 1, 'A' << 1, 'M' << 1, ' ' << 1, ' ' << 1, 0x60, \
-    'N' << 1, '0' << 1, 'C' << 1, 'A' << 1, 'L' << 1, 'L' << 1, 0x78, \
-    'W' << 1, 'I' << 1, 'D' << 1, 'E' << 1, '2' << 1, ' ' << 1, 0x65, \
+    'A' << 1, 'P' << 1, 'A' << 1, 'M' << 1, ' ' << 1, ' ' << 1, 0x60,
+    'N' << 1, '0' << 1, 'C' << 1, 'A' << 1, 'L' << 1, 'L' << 1, 0x78,
+    'W' << 1, 'I' << 1, 'D' << 1, 'E' << 1, '2' << 1, ' ' << 1, 0x65,
     0x03, 0xf0 };
 
 #define TNC_CALLSIGN_OFF       7
@@ -479,6 +480,36 @@ static void tnc1200TimerTick()
     } // END switch
 }
 
+static void tncCompressInt(uint8_t *dest, int32_t value, int len) {
+       int i;
+       for (i = len - 1; i >= 0; i--) {
+               dest[i] = value % 91 + 33;
+               value /= 91;
+       }
+}
+
+#if HAS_ADC
+static int tncComment(uint8_t *buf)
+{
+       struct ao_data packet;
+       
+       ao_arch_critical(ao_data_get(&packet););
+
+       int16_t battery = ao_battery_decivolt(packet.adc.v_batt);
+       int16_t apogee = ao_ignite_decivolt(AO_SENSE_DROGUE(&packet));
+       int16_t main = ao_ignite_decivolt(AO_SENSE_MAIN(&packet));
+
+       return sprintf((char *) buf,
+                      "B:%d.%d A:%d.%d M:%d.%d",
+                      battery/10,
+                      battery % 10,
+                      apogee/10,
+                      apogee%10,
+                      main/10,
+                      main%10);
+}
+#endif
+
 /**
  *   Generate the plain text position packet.
  */
@@ -487,57 +518,45 @@ static int tncPositionPacket(void)
     int32_t    latitude = ao_gps_data.latitude;
     int32_t    longitude = ao_gps_data.longitude;
     int32_t    altitude = ao_gps_data.altitude;
+    uint8_t    *buf;
+
+    if (altitude < 0)
+       altitude = 0;
+    altitude = (altitude * (int32_t) 10000 + (3048/2)) / (int32_t) 3048;
+    
+    buf = tncBuffer;
+    *buf++ = '!';
 
-    uint16_t   lat_deg;
-    uint16_t   lon_deg;
-    uint16_t   lat_min;
-    uint16_t   lat_frac;
-    uint16_t   lon_min;
-    uint16_t   lon_frac;
+    /* Symbol table ID */
+    *buf++ = '/';
 
-    char       lat_sign = 'N', lon_sign = 'E';
+    latitude = ((uint64_t) 380926 * (900000000 - latitude)) / 10000000;
+    longitude = ((uint64_t) 190463 * (1800000000 + longitude)) / 10000000;
 
-    if (latitude < 0) {
-       lat_sign = 'S';
-       latitude = -latitude;
-    }
+#define ALTITUDE_LOG_BASE      0.001998002662673f      /* log(1.002) */
 
-    if (longitude < 0) {
-       lon_sign = 'W';
-       longitude = -longitude;
-    }
+    altitude = logf((float) altitude) * (1/ALTITUDE_LOG_BASE);
 
-    /* Round latitude and longitude by 0.005 minutes */
-    latitude = latitude + 833;
-    if (latitude > 900000000)
-       latitude = 900000000;
-    longitude = longitude + 833;
-    if (longitude > 1800000000)
-           longitude = 1800000000;
-
-    lat_deg = latitude / 10000000;
-    latitude -= lat_deg * 10000000;
-    latitude *= 60;
-    lat_min = latitude / 10000000;
-    latitude -= lat_min * 10000000;
-    lat_frac = latitude / 100000;
-
-    lon_deg = longitude / 10000000;
-    longitude -= lon_deg * 10000000;
-    longitude *= 60;
-    lon_min = longitude / 10000000;
-    longitude -= lon_min * 10000000;
-    lon_frac = longitude / 100000;
+    tncCompressInt(buf, latitude, 4);
+    buf += 4;
+    tncCompressInt(buf, longitude, 4);
+    buf += 4;
 
-    if (altitude < 0)
-       altitude = 0;
+    /* Symbol code */
+    *buf++ = '\'';
 
-    altitude = (altitude * (int32_t) 10000 + (3048/2)) / (int32_t) 3048;
-    
-    return sprintf ((char *) tncBuffer, "=%02u%02u.%02u%c\\%03u%02u.%02u%cO /A=%06u\015",
-                   lat_deg, lat_min, lat_frac, lat_sign,
-                   lon_deg, lon_min, lon_frac, lon_sign,
-                   altitude);
+    tncCompressInt(buf, altitude, 2);
+    buf += 2;
+
+    *buf++ = 33 + ((1 << 5) | (2 << 3));
+
+#if HAS_ADC
+    buf += tncComment(buf);
+#else
+    *buf = '\0';
+#endif
+
+    return buf - tncBuffer;
 }
 
 static int16_t
index 25c0cd5cea66b753813cd566102ce5ba6f7c9da9..cdf073524e1e8f4ffb5f232f255c5ef854de28fe 100644 (file)
@@ -59,6 +59,7 @@ _ao_button_get(struct ao_debounce *debounce)
        case 4: return ao_button_value(4);
 #endif
        }
+       return 0;
 }
 
 static void
index 37d04927a0de0d15a1878a0ce8c1d32220cbae72..312259395236429d5a29f1bb90ddd7f7e0dc628f 100644 (file)
@@ -152,6 +152,7 @@ ao_radio_strobe(uint8_t addr)
        return in;
 }
 
+#if 0
 static uint8_t
 ao_radio_fifo_read(uint8_t *data, uint8_t len)
 {
@@ -166,6 +167,7 @@ ao_radio_fifo_read(uint8_t *data, uint8_t len)
        ao_radio_deselect();
        return status;
 }
+#endif
 
 static uint8_t
 ao_radio_fifo_write_start(void)
@@ -207,11 +209,13 @@ ao_radio_tx_fifo_space(void)
        return CC1120_FIFO_SIZE - ao_radio_reg_read(CC1120_NUM_TXBYTES);
 }
 
+#if 0
 static uint8_t
 ao_radio_status(void)
 {
        return ao_radio_strobe (CC1120_SNOP);
 }
+#endif
 
 void
 ao_radio_recv_abort(void)
@@ -505,7 +509,7 @@ static void
 ao_radio_set_mode(uint16_t new_mode)
 {
        uint16_t changes;
-       int i;
+       unsigned int i;
 
        if (new_mode == ao_radio_mode)
                return;
@@ -559,7 +563,7 @@ static uint8_t      ao_radio_configured = 0;
 static void
 ao_radio_setup(void)
 {
-       int     i;
+       unsigned int    i;
 
        ao_radio_strobe(CC1120_SRES);
 
@@ -751,13 +755,11 @@ static uint8_t    tx_data[(AO_RADIO_MAX_SEND + 4) * 2];
 void
 ao_radio_send(const void *d, uint8_t size)
 {
-       uint8_t         marc_status;
        uint8_t         *e = tx_data;
        uint8_t         encode_len;
        uint8_t         this_len;
        uint8_t         started = 0;
        uint8_t         fifo_space;
-       uint8_t         q;
 
        encode_len = ao_fec_encode(d, size, tx_data);
 
@@ -948,11 +950,9 @@ uint8_t
 ao_radio_recv(__xdata void *d, uint8_t size, uint8_t timeout)
 {
        uint8_t         len;
-       uint16_t        i;
        uint8_t         radio_rssi = 0;
        uint8_t         rssi0;
        uint8_t         ret;
-       static int been_here = 0;
 
        size -= 2;                      /* status bytes */
        if (size > AO_RADIO_MAX_RECV) {
@@ -1334,8 +1334,6 @@ static const struct ao_cmds ao_radio_cmds[] = {
 void
 ao_radio_init(void)
 {
-       int     i;
-
        ao_radio_configured = 0;
        ao_spi_init_cs (AO_CC1120_SPI_CS_PORT, (1 << AO_CC1120_SPI_CS_PIN));
 
index 0fa1e899044a23fae470cbaa7ac1b9a657b84014..f0f72d4d4f294d2ec02fd020827556cc7ced6d1c 100644 (file)
@@ -29,8 +29,6 @@ static uint8_t ao_radio_fifo;         /* fifo drained interrupt received */
 static uint8_t ao_radio_done;          /* tx done interrupt received */
 static uint8_t ao_radio_wake;          /* sleep address for radio interrupts */
 static uint8_t ao_radio_abort;         /* radio operation should abort */
-static uint8_t ao_radio_mcu_wake;      /* MARC status change */
-static uint8_t ao_radio_marcstate;     /* Last read MARC state value */
 
 /* Debugging commands */
 #define CC115L_DEBUG   0
@@ -106,7 +104,6 @@ static uint8_t
 ao_radio_reg_read(uint8_t addr)
 {
        uint8_t data[1];
-       uint8_t d;
 
        data[0] = ((1 << CC115L_READ)  |
                   (0 << CC115L_BURST) |
@@ -123,7 +120,6 @@ static void
 ao_radio_reg_write(uint8_t addr, uint8_t value)
 {
        uint8_t data[2];
-       uint8_t d;
 
        trace_add(trace_write, addr, value, NULL);
        data[0] = ((0 << CC115L_READ)  |
@@ -135,11 +131,11 @@ ao_radio_reg_write(uint8_t addr, uint8_t value)
        ao_radio_deselect();
 }
 
+#if UNUSED
 static void
 ao_radio_burst_read_start (uint16_t addr)
 {
        uint8_t data[1];
-       uint8_t d;
 
        data[0] = ((1 << CC115L_READ)  |
                   (1 << CC115L_BURST) |
@@ -153,6 +149,7 @@ ao_radio_burst_read_stop (void)
 {
        ao_radio_deselect();
 }
+#endif
 
 
 static uint8_t
@@ -200,19 +197,23 @@ ao_radio_tx_fifo_space(void)
        return CC115L_FIFO_SIZE - (ao_radio_reg_read(CC115L_TXBYTES) & CC115L_TXBYTES_NUM_TX_BYTES_MASK);
 }
 
+#if UNUSED
 static uint8_t
 ao_radio_status(void)
 {
        return ao_radio_strobe (CC115L_SNOP);
 }
+#endif
 
 #define ao_radio_rdf_value 0x55
 
+#if UNUSED
 static uint8_t
 ao_radio_get_marcstate(void)
 {
        return ao_radio_reg_read(CC115L_MARCSTATE) & CC115L_MARCSTATE_MASK;
 }
+#endif
          
 static void
 ao_radio_done_isr(void)
@@ -232,11 +233,6 @@ ao_radio_fifo_isr(void)
        ao_wakeup(&ao_radio_wake);
 }
 
-static void
-ao_radio_start_tx(void)
-{
-}
-
 static void
 ao_radio_idle(void)
 {
@@ -401,7 +397,7 @@ static void
 ao_radio_set_mode(uint16_t new_mode)
 {
        uint16_t changes;
-       int i;
+       unsigned int i;
 
        if (new_mode == ao_radio_mode)
                return;
@@ -466,7 +462,7 @@ static uint8_t      ao_radio_configured = 0;
 static void
 ao_radio_setup(void)
 {
-       int     i;
+       unsigned int    i;
 
        ao_radio_strobe(CC115L_SRES);
        ao_delay(AO_MS_TO_TICKS(10));
@@ -568,6 +564,7 @@ ao_radio_tone_run(struct ao_radio_tone *tones, int ntones)
        ao_radio_tone = tones;
        ao_radio_tone_current = 0;
        ao_radio_tone_offset = 0;
+       ao_radio_tone_count = ntones;
        _ao_radio_send_lots(ao_radio_tone_fill, AO_RADIO_MODE_RDF);
        ao_radio_put();
 }
@@ -730,8 +727,6 @@ ao_radio_send_fill(uint8_t *buf, int16_t len)
 void
 ao_radio_send(const void *d, uint8_t size)
 {
-       int i;
-
        ao_radio_get();
        ao_radio_send_len = ao_fec_encode(d, size, tx_data);
        ao_radio_send_buf = tx_data;
@@ -912,7 +907,6 @@ static void ao_radio_packet(void) {
        ao_radio_send(packet, sizeof (packet));
 }
 
-#endif /* CC115L_DEBUG */
 
 #if HAS_APRS
 #include <ao_aprs.h>
@@ -926,6 +920,7 @@ ao_radio_aprs()
        ao_aprs_send();
 }
 #endif
+#endif /* CC115L_DEBUG */
 
 static const struct ao_cmds ao_radio_cmds[] = {
        { ao_radio_test_cmd,    "C <1 start, 0 stop, none both>\0Radio carrier test" },
@@ -943,7 +938,9 @@ static const struct ao_cmds ao_radio_cmds[] = {
 void
 ao_radio_init(void)
 {
+#if 0
        int     i;
+#endif
 
        ao_radio_configured = 0;
        ao_spi_init_cs (AO_CC115L_SPI_CS_PORT, (1 << AO_CC115L_SPI_CS_PIN));
index 0f405253c2991207a021281788e9d50788cec074..570b9e409bbdd7f1245900d383a344d8a4b53a67 100644 (file)
@@ -67,8 +67,8 @@ ao_companion_get_setup(void)
        ao_companion_send_command(AO_COMPANION_SETUP);
        ao_spi_recv(&ao_companion_setup, sizeof (ao_companion_setup), AO_COMPANION_SPI_BUS);
        COMPANION_DESELECT();
-       return (ao_companion_setup.board_id ==
-               (uint16_t) ~ao_companion_setup.board_id_inverse);
+       return ((int16_t) ao_companion_setup.board_id ==
+               (int16_t) (uint16_t) (~ao_companion_setup.board_id_inverse));
 }
 
 static void
index c428125d0760771b73e7264fe3211dc632256676..5c0d286310f2460f1638227f8ddb8bd87303d083 100644 (file)
@@ -30,7 +30,7 @@ uint8_t               ao_event_queue_insert;
 uint8_t                ao_event_queue_remove;
 
 
-uint8_t
+void
 ao_event_get(struct ao_event *ev)
 {
        ao_arch_critical(
index ed9a743329a49dc2cda65fa3b55b38b8fb225f9a..584a845a3e14d8103ab67720d5fc754865ace603 100644 (file)
@@ -29,7 +29,7 @@ struct ao_event {
        int32_t         value;
 };
 
-uint8_t
+void
 ao_event_get(struct ao_event *ev);
 
 void
index 782d03f447e7a79a619b0e79b4814c0fcb4c9ae2..2d217bcf9d392fbd70099beaa3f21eee6ff8f871 100644 (file)
@@ -70,7 +70,6 @@ ao_hmc5883_sample(struct ao_hmc5883_sample *sample)
 {
        uint16_t        *d = (uint16_t *) sample;
        int             i = sizeof (*sample) / 2;
-       uint8_t         single = HMC5883_MODE_SINGLE;
 
        ao_hmc5883_done = 0;
        ao_exti_enable(AO_HMC5883_INT_PORT, AO_HMC5883_INT_PIN);
index 9c35b3240e92e651dbbc51502046cc6e6a137274..acbf589aa4cd0d13054b24d5037804f27689cec5 100644 (file)
@@ -119,7 +119,6 @@ lco_report_cmd(void) __reentrant
 static void
 lco_fire_cmd(void) __reentrant
 {
-       static __xdata struct ao_pad_command    command;
        uint8_t         secs;
        uint8_t         i;
        int8_t          r;
index 99e58b76f872bc014e992ae622242cce1bc80701..a5d28e615234bd509dbca8566c179e200f30d866 100644 (file)
@@ -26,7 +26,6 @@ static __xdata uint8_t                        ao_lco_mutex;
 int8_t
 ao_lco_query(uint16_t box, struct ao_pad_query *query, uint16_t *tick_offset)
 {
-       uint8_t         i;
        int8_t          r;
        uint16_t        sent_time;
 
index ce83a5a32054b4c1dde55dbb7c4060199b3d2c28..c36858add00bd4eb83711665b233d43111857486 100644 (file)
 
 #if HAS_MMA655X
 
-#if 0
-#define PRINTD(...) do { printf ("\r%5u %s: ", ao_tick_count, __func__); printf(__VA_ARGS__); } while(0)
+#define DEBUG          0
+#define DEBUG_LOW      1
+#define DEBUG_HIGH     2
+#if 1
+#define PRINTD(l, ...) do { if (DEBUG & (l)) { printf ("\r%5u %s: ", ao_tick_count, __func__); printf(__VA_ARGS__); flush(); } } while(0)
 #else
-#define PRINTD(...) 
+#define PRINTD(l,...) 
 #endif
 
-static uint8_t mma655x_configured;
-
 uint8_t        ao_mma655x_spi_index = AO_MMA655X_SPI_INDEX;
 
 static void
@@ -53,7 +54,7 @@ ao_mma655x_restart(void) {
        ao_gpio_set(AO_MMA655X_CS_PORT, AO_MMA655X_CS_PIN, AO_MMA655X_CS, 1);
 
        /* Emperical testing on STM32L151 at 32MHz for this delay amount */
-       for (i = 0; i < 9; i++)
+       for (i = 0; i < 10; i++)
                ao_arch_nop();
        ao_gpio_set(AO_MMA655X_CS_PORT, AO_MMA655X_CS_PIN, AO_MMA655X_CS, 0);
 }
@@ -72,15 +73,17 @@ ao_parity(uint8_t v)
        return p;
 }
 
+#if 0
 static void
 ao_mma655x_cmd(uint8_t d[2])
 {
        ao_mma655x_start();
-       PRINTD("\tSEND %02x %02x\n", d[0], d[1]);
+       PRINTD(DEBUG_LOW, "\tSEND %02x %02x\n", d[0], d[1]);
        ao_spi_duplex(d, d, 2, AO_MMA655X_SPI_INDEX);
-       PRINTD("\t\tRECV %02x %02x\n", d[0], d[1]);
+       PRINTD(DEBUG_LOW, "\t\tRECV %02x %02x\n", d[0], d[1]);
        ao_mma655x_stop();
 }
+#endif
 
 static uint8_t
 ao_mma655x_reg_read(uint8_t addr)
@@ -97,6 +100,7 @@ ao_mma655x_reg_read(uint8_t addr)
        d[1] = 0x00;
        ao_spi_duplex(&d, &d, 2, AO_MMA655X_SPI_INDEX);
        ao_mma655x_stop();
+       PRINTD(DEBUG_LOW, "read %x = %x %x\n", addr, d[0], d[1]);
        return d[1];
 }
 
@@ -105,6 +109,7 @@ ao_mma655x_reg_write(uint8_t addr, uint8_t value)
 {
        uint8_t d[2];
 
+       PRINTD(DEBUG_LOW, "write %x %x\n", addr, value);
        addr |= (1 << 6);       /* write mode */
        d[0] = addr | (ao_parity(addr^value) << 7);
        d[1] = value;
@@ -113,8 +118,6 @@ ao_mma655x_reg_write(uint8_t addr, uint8_t value)
        ao_mma655x_stop();
 
        addr &= ~(1 << 6);
-       PRINTD("write %x %x = %x\n",
-              addr, value, ao_mma655x_reg_read(addr));
 }
 
 static uint16_t
@@ -131,14 +134,14 @@ ao_mma655x_value(void)
                (0 << 1) |      /* Arm disabled */
                (1 << 0));      /* Odd parity */
        ao_mma655x_start();
-       PRINTD("value SEND %02x %02x\n", d[0], d[1]);
+       PRINTD(DEBUG_LOW, "value SEND %02x %02x\n", d[0], d[1]);
        ao_spi_send(d, 2, AO_MMA655X_SPI_INDEX);
        ao_mma655x_restart();
        d[0] = 0x80;
        d[1] = 0x00;
        ao_spi_duplex(d, d, 2, AO_MMA655X_SPI_INDEX);
        ao_mma655x_stop();
-       PRINTD("value RECV %02x %02x\n", d[0], d[1]);
+       PRINTD(DEBUG_LOW, "value RECV %02x %02x\n", d[0], d[1]);
 
        v = (uint16_t) d[1] << 2;
        v |= d[0] >> 6;
@@ -148,15 +151,16 @@ ao_mma655x_value(void)
 
 static void
 ao_mma655x_reset(void) {
+       PRINTD(DEBUG_HIGH, "reset\n");
        ao_mma655x_reg_write(AO_MMA655X_DEVCTL,
                             (0 << AO_MMA655X_DEVCTL_RES_1) |
-                            (0 << AO_MMA655X_DEVCTL_RES_1));
+                            (0 << AO_MMA655X_DEVCTL_RES_0));
        ao_mma655x_reg_write(AO_MMA655X_DEVCTL,
                             (1 << AO_MMA655X_DEVCTL_RES_1) |
-                            (1 << AO_MMA655X_DEVCTL_RES_1));
+                            (1 << AO_MMA655X_DEVCTL_RES_0));
        ao_mma655x_reg_write(AO_MMA655X_DEVCTL,
                             (0 << AO_MMA655X_DEVCTL_RES_1) |
-                            (1 << AO_MMA655X_DEVCTL_RES_1));
+                            (1 << AO_MMA655X_DEVCTL_RES_0));
 }
 
 #define DEVCFG_VALUE   (\
@@ -169,54 +173,73 @@ ao_mma655x_reset(void) {
                (0 << AO_MMA655X_AXISCFG_LPF))  /* 100Hz 4-pole filter */
 
 
+#define AO_ST_TRIES    10
+#define AO_ST_DELAY    AO_MS_TO_TICKS(100)
+
 static void
 ao_mma655x_setup(void)
 {
-       uint8_t         v;
        uint16_t        a, a_st;
-       uint8_t         stdefl;
-       uint8_t         i;
+       int16_t         st_change;
+       int             tries;
+       uint8_t         devstat;
+#if 0
        uint8_t s0, s1, s2, s3;
-       uint8_t pn;
        uint32_t        lot;
-       uint16_t        serial;
-
-
-       if (mma655x_configured)
-               return;
-       mma655x_configured = 1;
-       ao_delay(AO_MS_TO_TICKS(10));   /* Top */
-       ao_mma655x_reset();
-       ao_delay(AO_MS_TO_TICKS(10));   /* Top */
-       (void) ao_mma655x_reg_read(AO_MMA655X_DEVSTAT);
-       v = ao_mma655x_reg_read(AO_MMA655X_DEVSTAT);
-
-       /* Configure R/W register values.
-        * Most of them relate to the arming feature, which
-        * we don't use, so the only registers we need to
-        * write are DEVCFG and AXISCFG
-        */
+#endif
 
-       ao_mma655x_reg_write(AO_MMA655X_DEVCFG,
-                            DEVCFG_VALUE | (0 << AO_MMA655X_DEVCFG_ENDINIT));
+       for (tries = 0; tries < AO_ST_TRIES; tries++) {
+               ao_delay(AO_MS_TO_TICKS(10));
+               ao_mma655x_reset();
+               ao_delay(AO_MS_TO_TICKS(10));
 
-       /* Test X axis
-        */
+               devstat = ao_mma655x_reg_read(AO_MMA655X_DEVSTAT);
+               PRINTD(DEBUG_HIGH, "devstat %x\n", devstat);
+
+               if (!(devstat & (1 << AO_MMA655X_DEVSTAT_DEVRES)))
+                       continue;
+
+               /* Configure R/W register values.
+                * Most of them relate to the arming feature, which
+                * we don't use, so the only registers we need to
+                * write are DEVCFG and AXISCFG
+                */
+
+               ao_mma655x_reg_write(AO_MMA655X_DEVCFG,
+                                    DEVCFG_VALUE | (0 << AO_MMA655X_DEVCFG_ENDINIT));
+
+               /* Test X axis
+                */
        
-       ao_mma655x_reg_write(AO_MMA655X_AXISCFG,
-                            AXISCFG_VALUE |
-                            (1 << AO_MMA655X_AXISCFG_ST));
-       a_st = ao_mma655x_value();
+               ao_mma655x_reg_write(AO_MMA655X_AXISCFG,
+                                    AXISCFG_VALUE |
+                                    (1 << AO_MMA655X_AXISCFG_ST));
+               ao_delay(AO_MS_TO_TICKS(10));
+
+               a_st = ao_mma655x_value();
+
+               ao_mma655x_reg_write(AO_MMA655X_AXISCFG,
+                                    AXISCFG_VALUE |
+                                    (0 << AO_MMA655X_AXISCFG_ST));
+
+               ao_delay(AO_MS_TO_TICKS(10));
+
+               a = ao_mma655x_value();
 
-       stdefl = ao_mma655x_reg_read(AO_MMA655X_STDEFL);
+               st_change = a_st - a;
 
-       ao_mma655x_reg_write(AO_MMA655X_AXISCFG,
-                            AXISCFG_VALUE |
-                            (0 << AO_MMA655X_AXISCFG_ST));
-       a = ao_mma655x_value();
+               PRINTD(DEBUG_HIGH, "self test %d normal %d change %d\n", a_st, a, st_change);
+
+               if (AO_ST_MIN <= st_change && st_change <= AO_ST_MAX)
+                       break;
+               ao_delay(AO_ST_DELAY);
+       }
+       if (tries == AO_ST_TRIES)
+               ao_sensor_errors = 1;
 
        ao_mma655x_reg_write(AO_MMA655X_DEVCFG,
                             DEVCFG_VALUE | (1 << AO_MMA655X_DEVCFG_ENDINIT));
+#if 0
        s0 = ao_mma655x_reg_read(AO_MMA655X_SN0);
        s1 = ao_mma655x_reg_read(AO_MMA655X_SN1);
        s2 = ao_mma655x_reg_read(AO_MMA655X_SN2);
@@ -226,6 +249,7 @@ ao_mma655x_setup(void)
        serial = lot & 0x1fff;
        lot >>= 12;
        pn = ao_mma655x_reg_read(AO_MMA655X_PN);
+#endif
 }
 
 uint16_t       ao_mma655x_current;
@@ -259,8 +283,6 @@ static __xdata struct ao_task ao_mma655x_task;
 void
 ao_mma655x_init(void)
 {
-       mma655x_configured = 0;
-
        ao_cmd_register(&ao_mma655x_cmds[0]);
        ao_spi_init_cs(AO_MMA655X_CS_PORT, (1 << AO_MMA655X_CS_PIN));
 
index 2d951e07a4a110b01b2cf87b8ebaa0e66c6c82ce..e57e3377ca152259bb38c8f5bd4b3bd901d0e57c 100644 (file)
 #define AO_MMA655X_COUNT       0x15
 #define AO_MMA655X_OFFCORR     0x16
 
+/*
+ * Range of valid self-test difference from
+ * normal measurement
+ */
+
+#define AO_ST_MIN      300
+#define AO_ST_MAX      800
+
 extern uint16_t        ao_mma655x_current;
 
 void
index f8ce7346c7149d690228c57445607382ce35c05b..c04580277207e9bbe6fd05771a12b8232f8f3ef5 100644 (file)
@@ -21,7 +21,6 @@
 
 #if HAS_MPU6000
 
-static uint8_t ao_mpu6000_wake;
 static uint8_t ao_mpu6000_configured;
 
 #ifndef AO_MPU6000_I2C_INDEX
@@ -133,7 +132,7 @@ ao_mpu6000_gyro(int16_t v)
 #endif
 
 static uint8_t
-ao_mpu6000_accel_check(int16_t normal, int16_t test, char *which)
+ao_mpu6000_accel_check(int16_t normal, int16_t test)
 {
        int16_t diff = test - normal;
 
@@ -147,7 +146,7 @@ ao_mpu6000_accel_check(int16_t normal, int16_t test, char *which)
 }
 
 static uint8_t
-ao_mpu6000_gyro_check(int16_t normal, int16_t test, char *which)
+ao_mpu6000_gyro_check(int16_t normal, int16_t test)
 {
        int16_t diff = test - normal;
 
@@ -293,13 +292,13 @@ _ao_mpu6000_setup(void)
                ao_delay(AO_MS_TO_TICKS(200));
                _ao_mpu6000_sample(&normal_mode);
        
-               errors += ao_mpu6000_accel_check(normal_mode.accel_x, test_mode.accel_x, "x");
-               errors += ao_mpu6000_accel_check(normal_mode.accel_y, test_mode.accel_y, "y");
-               errors += ao_mpu6000_accel_check(normal_mode.accel_z, test_mode.accel_z, "z");
+               errors += ao_mpu6000_accel_check(normal_mode.accel_x, test_mode.accel_x);
+               errors += ao_mpu6000_accel_check(normal_mode.accel_y, test_mode.accel_y);
+               errors += ao_mpu6000_accel_check(normal_mode.accel_z, test_mode.accel_z);
 
-               errors += ao_mpu6000_gyro_check(normal_mode.gyro_x, test_mode.gyro_x, "x");
-               errors += ao_mpu6000_gyro_check(normal_mode.gyro_y, test_mode.gyro_y, "y");
-               errors += ao_mpu6000_gyro_check(normal_mode.gyro_z, test_mode.gyro_z, "z");
+               errors += ao_mpu6000_gyro_check(normal_mode.gyro_x, test_mode.gyro_x);
+               errors += ao_mpu6000_gyro_check(normal_mode.gyro_y, test_mode.gyro_y);
+               errors += ao_mpu6000_gyro_check(normal_mode.gyro_z, test_mode.gyro_z);
                if (!errors)
                        break;
        }
index 3d55cf67c4c735af6a9178d36037a353880ddbdb..fecb9135d6824f4067de9b95acb3c15b7f44471f 100644 (file)
@@ -4,7 +4,7 @@ endif
 
 include $(TOPDIR)/Makedefs
 
-vpath % $(TOPDIR)/lpc:$(TOPDIR)/product:$(TOPDIR)/drivers:$(TOPDIR)/core:$(TOPDIR)/util:$(TOPDIR)/kalman:$(TOPDIR/aes):$(TOPDIR)
+vpath % $(TOPDIR)/lpc:$(TOPDIR)/product:$(TOPDIR)/drivers:$(TOPDIR)/core:$(TOPDIR)/util:$(TOPDIR)/kalman:$(TOPDIR/aes):$(TOPDIR):$(TOPDIR)/math
 vpath make-altitude $(TOPDIR)/util
 vpath make-kalman $(TOPDIR)/util
 vpath kalman.5c $(TOPDIR)/kalman
@@ -26,8 +26,11 @@ endif
 ELFTOHEX=$(TOPDIR)/../ao-tools/ao-elftohex/ao-elftohex
 CC=$(ARM_CC)
 
-AO_CFLAGS=-I. -I$(TOPDIR)/lpc -I$(TOPDIR)/core -I$(TOPDIR)/drivers -I$(TOPDIR)/product -I$(TOPDIR) $(PDCLIB_INCLUDES) 
-LPC_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m0 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS)
+WARN_FLAGS=-Wall -Wextra -Werror
+
+AO_CFLAGS=-I. -I$(TOPDIR)/lpc -I$(TOPDIR)/core -I$(TOPDIR)/drivers -I$(TOPDIR)/product -I$(TOPDIR) -I$(TOPDIR)/math -I$(TOPDIR) $(PDCLIB_INCLUDES) 
+LPC_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m0 -mthumb\
+       -ffreestanding -nostdlib $(AO_CFLAGS) $(WARN_FLAGS)
 
 NICKLE=nickle
 
index 7005f86e62a9d4c51743316b666847e07ba75d19..e1aae0e484d5c726910185e5c15907c41a5932f6 100644 (file)
@@ -149,8 +149,10 @@ static void
 ao_adc_dump(void) __reentrant
 {
        struct ao_data  packet;
+#ifndef AO_ADC_DUMP
        int16_t *d;
        uint8_t i;
+#endif
 
        ao_data_get(&packet);
 #ifdef AO_ADC_DUMP
index 588cf58c5c7ee81688031002e31717ae5352423d..941aa965dde3d7b8c7723c6aad94e16544dd31a9 100644 (file)
@@ -91,7 +91,7 @@ ao_exti_setup (uint8_t port, uint8_t pin, uint8_t mode, void (*callback)(void))
        if (pint == LPC_NUM_PINT)
                ao_panic(AO_PANIC_EXTI);
 
-       if (!mode & AO_EXTI_PIN_NOCONFIGURE)
+       if (!(mode & AO_EXTI_PIN_NOCONFIGURE))
                ao_enable_input(port, pin, mode);
 
        ao_arch_block_interrupts();
index a889137cbb7a4e1f84437f601d76e78f8cc22ce8..e72b8286634adfbb0fe3b8e3f97bcfbbf2c92d3e 100644 (file)
@@ -21,8 +21,6 @@ static uint8_t                ao_spi_mutex[LPC_NUM_SPI];
 
 static struct lpc_ssp * const ao_lpc_ssp[LPC_NUM_SPI] = { &lpc_ssp0, &lpc_ssp1 };
 
-static uint8_t spi_dev_null;
-
 #define tx_busy(lpc_ssp) (lpc_ssp->sr & ((1 << LPC_SSP_SR_BSY) | (1 << LPC_SSP_SR_TNF))) != (1 << LPC_SSP_SR_TNF)
 #define rx_busy(lpc_ssp) (lpc_ssp->sr & ((1 << LPC_SSP_SR_BSY) | (1 << LPC_SSP_SR_RNE))) != (1 << LPC_SSP_SR_RNE)
 
index 686dc3a4bd8019d6c2e44251c1bbb10a01f586be..d02ccdd6a5cbe06ab4ab74f951765b9e66dd0f73 100644 (file)
@@ -111,7 +111,6 @@ static uint8_t      ao_usb_in_pending;
 static uint8_t ao_usb_out_avail;
 static uint8_t ao_usb_running;
 static uint8_t ao_usb_configuration;
-static uint8_t ueienx_0;
 
 #define AO_USB_EP0_GOT_RESET   1
 #define AO_USB_EP0_GOT_SETUP   2
@@ -246,11 +245,13 @@ ao_usb_epn_in(uint8_t n)
        return &lpc_usb_endpoint.epn[n-1].in[0];
 }
 
+#if UNUSED
 static void
 ao_usb_set_epn_in(uint8_t n, uint8_t *addr, uint16_t nbytes)
 {
        ao_usb_set_ep(ao_usb_epn_in(n), addr, nbytes);
 }
+#endif
 
 static void
 ao_usb_set_epn_out(uint8_t n, uint8_t *addr, uint16_t nbytes)
@@ -633,11 +634,12 @@ ao_usb_ep0_handle(uint8_t receive)
        }
 }
 
-static uint16_t        control_count;
+#if USB_DEBUG
 static uint16_t int_count;
 static uint16_t        in_count;
 static uint16_t        out_count;
 static uint16_t        reset_count;
+#endif
 
 void
 lpc_usb_irq_isr(void)
@@ -665,7 +667,9 @@ lpc_usb_irq_isr(void)
 
        /* Handle OUT packets */
        if (intstat & (1 << LPC_USB_INT_EPOUT(AO_USB_OUT_EP))) {
+#if USB_DEBUG
                ++out_count;
+#endif
                _rx_dbg1("RX ISR", *ao_usb_epn_out(AO_USB_OUT_EP));
                ao_usb_out_avail = 1;
                _rx_dbg0("out avail set");
@@ -675,7 +679,9 @@ lpc_usb_irq_isr(void)
 
        /* Handle IN packets */
        if (intstat & (1 << LPC_USB_INT_EPIN(AO_USB_IN_EP))) {
+#if USB_DEBUG
                ++in_count;
+#endif
                _tx_dbg1("TX ISR", *ao_usb_epn_in(AO_USB_IN_EP));
                ao_usb_in_pending = 0;
                ao_wakeup(&ao_usb_in_pending);
index 3300c86f1d942f9a9ea03e47b70cd39cee4882ee..9408ceab1ab7d76ab71037f3c009f7b3ab53d716 100644 (file)
@@ -120,7 +120,7 @@ extern struct lpc_ioconf lpc_ioconf;
 #define  LPC_IOCONF_FUNC_PIO0_3                0
 #define  LPC_IOCONF_FUNC_USB_VBUS      1
 
-/* PIO0_4
+/* PIO0_4 */
 #define  LPC_IOCONF_FUNC_PIO0_4                0
 #define  LPC_IOCONF_FUNC_I2C_SCL       1
 
diff --git a/src/math/ef_log.c b/src/math/ef_log.c
new file mode 100644 (file)
index 0000000..619fe90
--- /dev/null
@@ -0,0 +1,92 @@
+/* ef_log.c -- float version of e_log.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice 
+ * is preserved.
+ * ====================================================
+ */
+
+#include "fdlibm.h"
+
+#ifdef __STDC__
+static const float
+#else
+static float
+#endif
+ln2_hi =   6.9313812256e-01,   /* 0x3f317180 */
+ln2_lo =   9.0580006145e-06,   /* 0x3717f7d1 */
+two25 =    3.355443200e+07,    /* 0x4c000000 */
+Lg1 = 6.6666668653e-01,        /* 3F2AAAAB */
+Lg2 = 4.0000000596e-01,        /* 3ECCCCCD */
+Lg3 = 2.8571429849e-01, /* 3E924925 */
+Lg4 = 2.2222198546e-01, /* 3E638E29 */
+Lg5 = 1.8183572590e-01, /* 3E3A3325 */
+Lg6 = 1.5313838422e-01, /* 3E1CD04F */
+Lg7 = 1.4798198640e-01; /* 3E178897 */
+
+#ifdef __STDC__
+static const float zero   =  0.0;
+#else
+static float zero   =  0.0;
+#endif
+
+#ifdef __STDC__
+       float __ieee754_logf(float x)
+#else
+       float __ieee754_logf(x)
+       float x;
+#endif
+{
+       float hfsq,f,s,z,R,w,t1,t2,dk;
+       __int32_t k,ix,i,j;
+
+       GET_FLOAT_WORD(ix,x);
+
+       k=0;
+       if (FLT_UWORD_IS_ZERO(ix&0x7fffffff))
+           return -two25/zero;         /* log(+-0)=-inf */
+        if (ix<0) return (x-x)/zero;   /* log(-#) = NaN */
+       if (!FLT_UWORD_IS_FINITE(ix)) return x+x;
+       if (FLT_UWORD_IS_SUBNORMAL(ix)) {
+           k -= 25; x *= two25; /* subnormal number, scale up x */
+           GET_FLOAT_WORD(ix,x);
+       } 
+       k += (ix>>23)-127;
+       ix &= 0x007fffff;
+       i = (ix+(0x95f64<<3))&0x800000;
+       SET_FLOAT_WORD(x,ix|(i^0x3f800000));    /* normalize x or x/2 */
+       k += (i>>23);
+       f = x-(float)1.0;
+       if((0x007fffff&(15+ix))<16) {   /* |f| < 2**-20 */
+           if(f==zero) { if(k==0) return zero;  else {dk=(float)k;
+                                return dk*ln2_hi+dk*ln2_lo;}}
+           R = f*f*((float)0.5-(float)0.33333333333333333*f);
+           if(k==0) return f-R; else {dk=(float)k;
+                    return dk*ln2_hi-((R-dk*ln2_lo)-f);}
+       }
+       s = f/((float)2.0+f); 
+       dk = (float)k;
+       z = s*s;
+       i = ix-(0x6147a<<3);
+       w = z*z;
+       j = (0x6b851<<3)-ix;
+       t1= w*(Lg2+w*(Lg4+w*Lg6)); 
+       t2= z*(Lg1+w*(Lg3+w*(Lg5+w*Lg7))); 
+       i |= j;
+       R = t2+t1;
+       if(i>0) {
+           hfsq=(float)0.5*f*f;
+           if(k==0) return f-(hfsq-s*(hfsq+R)); else
+                    return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f);
+       } else {
+           if(k==0) return f-s*(f-R); else
+                    return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f);
+       }
+}
index f1191d09f82850926f15ab39b8bec89549db4ad2..3e58f8091079fc9b9a298f7588f25f418a342ebb 100644 (file)
@@ -142,7 +142,7 @@ pio2_3t =  6.1232342629e-17; /* 0x248d3132 */
            fn = (float)n;
            r  = t-fn*pio2_1;
            w  = fn*pio2_1t;    /* 1st round good to 40 bit */
-           if(n<32&&(ix&0xffffff00)!=npio2_hw[n-1]) {  
+           if(n<32&&(ix&(__int32_t)0xffffff00)!=npio2_hw[n-1]) {       
                y[0] = r-w;     /* quick check no cancellation */
            } else {
                __uint32_t high;
index 821619ad835101d70e68e8f28bab9cba8f26ea4f..ee9fcb220dd54240053549dbc6d3965126ddc306 100644 (file)
@@ -19,6 +19,7 @@
 
 #define __ieee754_acosf acosf
 #define __ieee754_sqrtf sqrtf
+#define __ieee754_logf logf
 
 /* REDHAT LOCAL: Include files.  */
 #include <math.h>
index fd543bc218cba9f016a4b88133cc3fbc110a3e9c..97dd74cf28ce653dda9b059d8b0a8bbee772da40 100644 (file)
@@ -34,4 +34,6 @@ float scalbnf(float x, int n);
 
 float copysignf(float x, float y);
 
+float logf(float x);
+
 #endif
index 4cfbf75fde3d15c38b7b8ab0809bb9a85abfc3d8..6cb308e1fa5ee580656af86757ddbcf9c4bcd97f 100644 (file)
@@ -24,6 +24,7 @@
 void
 ao_panic(uint8_t reason)
 {
+       (void) reason;
 }
 
 void
index 9adcfeb3c2bb76fc3969986a6ce3bf33171c8640..42adfd0923b3ddc04f7ccab0d0a50e7756e7a850 100644 (file)
@@ -24,8 +24,11 @@ include $(TOPDIR)/Makedefs
 CC=$(ARM_CC)
 LIBS=$(PDCLIB_LIBS_M3) -lgcc
 
+WARN_FLAGS=-Wall -Wextra -Werror
+
 AO_CFLAGS=-I. -I../stm -I../core -I../drivers -I../math -I.. $(PDCLIB_INCLUDES)
-STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS)
+STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb \
+       -ffreestanding -nostdlib $(AO_CFLAGS) $(WARN_FLAGS)
 
 LDFLAGS=-L../stm -Wl,-Taltos.ld
 
index 53f19b406d20a884f6c33b6219b2dc55f10e9b76..53d4b8c3f64ece0d2e0126cbd37846de6d8fe071 100644 (file)
@@ -41,6 +41,7 @@ static uint8_t                        ao_adc_ready;
  */
 static void ao_adc_done(int index)
 {
+       (void) index;
        AO_DATA_PRESENT(AO_DATA_ADC);
        ao_dma_done_transfer(STM_DMA_INDEX(STM_DMA_CHANNEL_ADC1));
        if (ao_data_present == AO_DATA_ALL) {
@@ -109,8 +110,10 @@ static void
 ao_adc_dump(void) __reentrant
 {
        struct ao_data  packet;
-       int16_t *d;
+#ifndef AO_ADC_DUMP
        uint8_t i;
+       int16_t *d;
+#endif
 
        ao_data_get(&packet);
 #ifdef AO_ADC_DUMP
index 42fe727a84139d0ff47351681c868f81240ab435..76fa91947bd619d1884cbda63de15b94cd14db7e 100644 (file)
@@ -135,6 +135,9 @@ extern const uint32_t       ao_radio_cal;
 void
 ao_adc_init();
 
+/* ADC maximum reported value */
+#define AO_ADC_MAX                     4095
+
 #define AO_BOOT_APPLICATION_BASE       ((uint32_t *) 0x08001000)
 #define AO_BOOT_LOADER_BASE            ((uint32_t *) 0x0)
 #define HAS_BOOT_LOADER                        1
index c1dcdf85303a84f0a7541023f7bca684fdaba037..35958cf845632e37cb9c21781e7af057bd0bf173 100644 (file)
@@ -119,6 +119,8 @@ ao_exti_setup (struct stm_gpio *gpio, uint8_t pin, uint8_t mode, void (*callback
 
 void
 ao_exti_set_mode(struct stm_gpio *gpio, uint8_t pin, uint8_t mode) {
+       (void) gpio;
+
        uint32_t        mask = 1 << pin;
        
        if (mode & AO_EXTI_MODE_RISING)
@@ -133,12 +135,14 @@ ao_exti_set_mode(struct stm_gpio *gpio, uint8_t pin, uint8_t mode) {
 
 void
 ao_exti_set_callback(struct stm_gpio *gpio, uint8_t pin, void (*callback)()) {
+       (void) gpio;
        ao_exti_callback[pin] = callback;
 }
 
 void
 ao_exti_enable(struct stm_gpio *gpio, uint8_t pin) {
        uint32_t        mask = (1 << pin);
+       (void) gpio;
        stm_exti.pr = mask;
        stm_exti.imr |= (1 << pin);
 }
@@ -146,6 +150,7 @@ ao_exti_enable(struct stm_gpio *gpio, uint8_t pin) {
 void
 ao_exti_disable(struct stm_gpio *gpio, uint8_t pin) {
        uint32_t        mask = (1 << pin);
+       (void) gpio;
        stm_exti.imr &= ~mask;
        stm_exti.pr = mask;
 }
index 809b5c6fcf72eac1993e96741f46b60ab955c303..1c90cdb85c19193f223acaf40b970c9cfc74a267 100644 (file)
@@ -185,7 +185,6 @@ uint8_t
 ao_i2c_start(uint8_t index, uint16_t addr)
 {
        struct stm_i2c  *stm_i2c = ao_i2c_stm_info[index].stm_i2c;
-       uint32_t        sr1, sr2;
        int             t;
 
        ao_i2c_state[index] = I2C_IDLE;
@@ -239,10 +238,7 @@ uint8_t
 ao_i2c_send(void *block, uint16_t len, uint8_t index, uint8_t stop)
 {
        struct stm_i2c  *stm_i2c = ao_i2c_stm_info[index].stm_i2c;
-       uint8_t         *b = block;
-       uint32_t        sr1;
        uint8_t         tx_dma_index = ao_i2c_stm_info[index].tx_dma_index;
-       int             t;
 
        /* Clear any pending ADDR bit */
        (void) stm_i2c->sr2;
@@ -304,8 +300,6 @@ uint8_t
 ao_i2c_recv(void *block, uint16_t len, uint8_t index, uint8_t stop)
 {
        struct stm_i2c  *stm_i2c = ao_i2c_stm_info[index].stm_i2c;
-       uint8_t         *b = block;
-       int             t;
        uint8_t         ret = TRUE;
 
        if (len == 0)
index 47ea374ed6070303b5b306db6cb1719e825ea891..95af53d1b1aacc5cc1a612416385a6af5f927ae3 100644 (file)
@@ -346,8 +346,7 @@ static const struct ao_cmds ao_lcd_stm_cmds[] = {
 void
 ao_lcd_stm_init(void)
 {
-       int s, c;
-       int r;
+       unsigned int s, c;
        uint32_t        csr;
 
        stm_rcc.ahbenr |= ((AO_LCD_STM_USES_GPIOA << STM_RCC_AHBENR_GPIOAEN) |
index f7dd029ddce6c4087d5d5034177fe5c89543bf19..f8a0c25e97eb6632eb72ea2d1f3b8fae3e28ca31 100644 (file)
@@ -20,7 +20,7 @@
 
 void   ao_profile_init();
 
-static uint32_t inline ao_profile_tick(void) {
+static inline uint32_t ao_profile_tick(void) {
        uint16_t        hi, lo, second_hi;
 
        do {
index 980224425e57c9483f39dcd55195938943aca05d..962ff2c66eb00f48854f9274f585ee85b152e426 100644 (file)
@@ -97,7 +97,6 @@ ao_spi_slave_send(void *block, uint16_t len)
        ao_dma_done_transfer(miso_dma_index);
 }
 
-
 uint8_t
 ao_spi_slave_recv(void *block, uint16_t len)
 {
@@ -153,6 +152,7 @@ ao_spi_slave_recv(void *block, uint16_t len)
 
        ao_dma_done_transfer(mosi_dma_index);
        ao_dma_done_transfer(miso_dma_index);
+       return 1;
 }
 
 static void
index 28a9f9f3e4643beac09b0db8a0dcf6e56c348fc9..27b82357843d3d278b815165b99ecfdc97555f2a 100644 (file)
@@ -119,7 +119,6 @@ static uint8_t      ao_usb_in_pending;
 static uint8_t ao_usb_out_avail;
 static uint8_t ao_usb_running;
 static uint8_t ao_usb_configuration;
-static uint8_t ueienx_0;
 
 #define AO_USB_EP0_GOT_RESET   1
 #define AO_USB_EP0_GOT_SETUP   2
@@ -313,7 +312,6 @@ ao_usb_init_ep(uint8_t ep, uint32_t addr, uint32_t type, uint32_t stat_rx, uint3
 static void
 ao_usb_set_ep0(void)
 {
-       uint32_t                epr;
        int                     e;
 
        ao_usb_sram_addr = 0;
@@ -356,8 +354,6 @@ ao_usb_set_ep0(void)
 static void
 ao_usb_set_configuration(void)
 {
-       uint32_t                epr;
-
        debug ("ao_usb_set_configuration\n");
 
        /* Set up the INT end point */
index ff3f53366904d277e4e4a3fc9a7d07fb048c35c3..302f4d2451bf6fd762a544b257ab38cc0c93b7df 100644 (file)
@@ -52,7 +52,7 @@ stm_moder_set(struct stm_gpio *gpio, int pin, vuint32_t value) {
                       value << STM_MODER_SHIFT(pin));
 }
        
-static inline vuint32_t
+static inline uint32_t
 stm_moder_get(struct stm_gpio *gpio, int pin) {
        return (gpio->moder >> STM_MODER_SHIFT(pin)) & STM_MODER_MASK;
 }
@@ -69,7 +69,7 @@ stm_otyper_set(struct stm_gpio *gpio, int pin, vuint32_t value) {
                        value << STM_OTYPER_SHIFT(pin));
 }
        
-static inline vuint32_t
+static inline uint32_t
 stm_otyper_get(struct stm_gpio *gpio, int pin) {
        return (gpio->otyper >> STM_OTYPER_SHIFT(pin)) & STM_OTYPER_MASK;
 }
@@ -88,7 +88,7 @@ stm_ospeedr_set(struct stm_gpio *gpio, int pin, vuint32_t value) {
                       value << STM_OSPEEDR_SHIFT(pin));
 }
        
-static inline vuint32_t
+static inline uint32_t
 stm_ospeedr_get(struct stm_gpio *gpio, int pin) {
        return (gpio->ospeedr >> STM_OSPEEDR_SHIFT(pin)) & STM_OSPEEDR_MASK;
 }
index bb9c8c640c0dc473d6e633366a93ae0038029051..5aad32b542a149fea83742928e8a708e5a739032 100644 (file)
@@ -19,6 +19,9 @@ INC = \
        Makefile
 
 
+MATH_SRC=\
+       ef_log.c
+
 ALTOS_SRC = \
        ao_interrupt.c \
        ao_boot_chain.c \
@@ -47,6 +50,7 @@ ALTOS_SRC = \
        ao_log.c \
        ao_log_mega.c \
        ao_gps_report_mega.c \
+       $(MATH_SRC) \
        $(SAMPLE_PROFILE)
 
 PRODUCT=TeleGPS-v0.3
index e8d16ca93cfdaf24b0c9a237b2f407571bb0899e..0bbb76f10218d651cc53d6b8ac5b88978c4ad626 100644 (file)
@@ -37,7 +37,6 @@ static uint8_t        ao_lco_debug;
 #define AO_LCO_BOX_DIGIT_10    2
 
 static uint8_t ao_lco_min_box, ao_lco_max_box;
-static uint8_t ao_lco_mutex;
 static uint8_t ao_lco_pad;
 static uint8_t ao_lco_box;
 static uint8_t ao_lco_armed;
@@ -281,12 +280,9 @@ static void
 ao_lco_igniter_status(void)
 {
        uint8_t         c;
-       uint16_t        delay;
 
        for (;;) {
-//             ao_alarm(delay);
                ao_sleep(&ao_pad_query);
-//             ao_clear_alarm();
                if (!ao_lco_valid) {
                        ao_led_on(AO_LED_RED);
                        ao_led_off(AO_LED_GREEN|AO_LED_AMBER);
index 0145f49c5f45ad063a6f45da19a0614fb93e3554..28ed7c98e93194b5b804995a68da732a906aac37 100644 (file)
@@ -58,7 +58,8 @@ MATH_SRC=\
        sf_sin.c \
        sf_fabs.c \
        sf_floor.c \
-       sf_scalbn.c
+       sf_scalbn.c \
+       ef_log.c
 
 ALTOS_SRC = \
        ao_boot_chain.c \
@@ -99,6 +100,7 @@ ALTOS_SRC = \
        ao_i2c_stm.c \
        ao_mpu6000.c \
        ao_convert_pa.c \
+       ao_convert_volt.c \
        ao_log.c \
        ao_log_mega.c \
        ao_sample.c \
index daeb9f1741d0e08aa6de2be1274dd8ac135a60a1..db397c669927630357a2103837df52f9627f84ba 100644 (file)
@@ -249,6 +249,23 @@ struct ao_adc {
 #define AO_ADC_SQ8             AO_ADC_V_PBATT
 #define AO_ADC_SQ9             AO_ADC_TEMP
 
+/*
+ * Voltage divider on ADC battery sampler
+ */
+#define AO_BATTERY_DIV_PLUS    56      /* 5.6k */
+#define AO_BATTERY_DIV_MINUS   100     /* 10k */
+
+/*
+ * Voltage divider on ADC igniter samplers
+ */
+#define AO_IGNITE_DIV_PLUS     100     /* 100k */
+#define AO_IGNITE_DIV_MINUS    27      /* 27k */
+
+/*
+ * ADC reference in decivolts
+ */
+#define AO_ADC_REFERENCE_DV    33
+
 /*
  * Pressure sensor settings
  */
index 543f7e748faf92814896a2abcb63e9152c445a48..7a0c1195d534fb682a4715922ca000a5724c926d 100644 (file)
@@ -59,7 +59,8 @@ MATH_SRC=\
        sf_fabs.c \
        sf_floor.c \
        sf_scalbn.c \
-       sf_sin.c
+       sf_sin.c \
+       ef_log.c
 
 ALTOS_SRC = \
        ao_boot_chain.c \
@@ -100,6 +101,7 @@ ALTOS_SRC = \
        ao_i2c_stm.c \
        ao_mpu6000.c \
        ao_convert_pa.c \
+       ao_convert_volt.c \
        ao_log.c \
        ao_log_mega.c \
        ao_sample.c \
index 95644dae03a1611b9e00197a980fa48e2af82f65..fe97c684114f947cc6fab805298cb4b223013d17 100644 (file)
@@ -249,6 +249,23 @@ struct ao_adc {
 #define AO_ADC_SQ8             AO_ADC_V_PBATT
 #define AO_ADC_SQ9             AO_ADC_TEMP
 
+/*
+ * Voltage divider on ADC battery sampler
+ */
+#define AO_BATTERY_DIV_PLUS    56      /* 5.6k */
+#define AO_BATTERY_DIV_MINUS   100     /* 10k */
+
+/*
+ * Voltage divider on ADC igniter samplers
+ */
+#define AO_IGNITE_DIV_PLUS     100     /* 100k */
+#define AO_IGNITE_DIV_MINUS    27      /* 27k */
+
+/*
+ * ADC reference in decivolts
+ */
+#define AO_ADC_REFERENCE_DV    33
+
 /*
  * Pressure sensor settings
  */
index cebc9cabc762dba5253470617b0cda9d3c676b1e..83a364dcbdd4ea3d526352146919e76287a13aec 100644 (file)
@@ -37,6 +37,9 @@ INC = \
 #STACK_GUARD=ao_mpu_stm.c
 #STACK_GUARD_DEF=-DHAS_STACK_GUARD=1
 
+MATH_SRC=\
+       ef_log.c
+
 ALTOS_SRC = \
        ao_boot_chain.c \
        ao_interrupt.c \
@@ -73,6 +76,7 @@ ALTOS_SRC = \
        ao_eeprom_stm.c \
        ao_report.c \
        ao_convert_pa.c \
+       ao_convert_volt.c \
        ao_log.c \
        ao_log_metrum.c \
        ao_sample.c \
@@ -83,6 +87,7 @@ ALTOS_SRC = \
        ao_packet.c \
        ao_companion.c \
        ao_aprs.c \
+       $(MATH_SRC) \
        $(PROFILE) \
        $(SAMPLE_PROFILE) \
        $(STACK_GUARD)
index 02f0f5e3efecc9b3648f02f7b0ecc61b9a937016..1b5cedc743607418fbef6e5a6d2d6ef60f895f8e 100644 (file)
@@ -189,6 +189,23 @@ struct ao_adc {
 #define AO_ADC_SQ3             AO_ADC_V_BATT
 #define AO_ADC_SQ4             AO_ADC_TEMP
 
+/*
+ * Voltage divider on ADC battery sampler
+ */
+#define AO_BATTERY_DIV_PLUS    56      /* 5.6k */
+#define AO_BATTERY_DIV_MINUS   100     /* 10k */
+
+/*
+ * Voltage divider on ADC igniter samplers
+ */
+#define AO_IGNITE_DIV_PLUS     100     /* 100k */
+#define AO_IGNITE_DIV_MINUS    27      /* 27k */
+
+/*
+ * ADC reference in decivolts
+ */
+#define AO_ADC_REFERENCE_DV    33
+
 /*
  * GPS
  */