diff -Nru altos-1.3/ChangeLog altos-1.3.1/ChangeLog --- altos-1.3/ChangeLog 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/ChangeLog 2014-01-23 03:53:03.000000000 +0000 @@ -1,3 +1,605 @@ +commit 200137060651f48c99276c8feb0e15980a9b46be +Author: Bdale Garbee +Date: Wed Jan 22 20:52:09 2014 -0700 + + update copyright date on main documentation file + +commit 63171339c03cf9bf3d691511889223bf43024124 +Author: Keith Packard +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 + +commit e6a73d6cbe149a930f8c4e2dac655bc3f6270013 +Author: Keith Packard +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 + +commit e61c02b51e069aa58b36f59b9ca8e7c8284bc93a +Author: Keith Packard +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 + +commit 42922b40fc695bdaa92e3fb0b41a248f7df918d0 +Author: Keith Packard +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 + +commit f118e33416e45ea9a2b5ede4157bd8b58ddb6ebb +Author: Keith Packard +Date: Tue Jan 21 21:37:18 2014 -0800 + + altosuilib: Remove some spurious debug printfs + + Signed-off-by: Keith Packard + +commit 677fcafd3816b6d8d86b2dc41b840d97b5ccbf07 +Author: Keith Packard +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 + +commit 13cf4000bd53ac4af66231d56e24c9eb11178a5f +Merge: 7a8551f 99fedbf +Author: Keith Packard +Date: Tue Jan 21 20:59:06 2014 -0800 + + Merge remote-tracking branch 'origin/master' + +commit 99fedbf0ed42a5d4fa80f094576ca0260040ef5e +Author: Bdale Garbee +Date: Tue Jan 21 21:31:25 2014 -0700 + + set version to 1.3.1 for release + +commit 7a8551fe8e5f0a90cbc494842715a96f08c11900 +Author: Anthony Towns +Date: Mon Jan 20 19:38:21 2014 +1000 + + altosui: rate limit map downloads + +commit 0faa098f05d43eefc1fa54462401171fca5034cb +Author: Anthony Towns +Date: Mon Jan 20 05:10:58 2014 +1000 + + altosui: --fetchmaps gets same number of maps as GUI + +commit aab5873c87d6ecfe0854751746f80d4bc7ebeffa +Author: Anthony Towns +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 +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 + +commit 2b891115c95453d9002d8ef307a27e14eda145a5 +Author: Bdale Garbee +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 +Date: Fri Jan 17 20:47:16 2014 -0700 + + use firmware in /usr/share/altos for production flashing + +commit cfcb127b248b62231049b6b50cf9b7edc2731f0a +Author: Keith Packard +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 + +commit 9001d5780a41986017bd3bbc7f8c5556b116c351 +Author: Keith Packard +Date: Wed Jan 15 12:42:59 2014 -0800 + + Ignore 32 and 64 bit cjnitest apps + +commit c743eaa060080a7bd236466b93cff3abc96f405b +Author: Keith Packard +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 + +commit cc06242e882cba462791962c199b7c89e79adc65 +Author: Keith Packard +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 + +commit 9d812b3db418fd9816731b761a0853eb38f5a265 +Author: Keith Packard +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 + +commit f560d5063b1339dbfb3e6723cfadb7b4c5eace25 +Author: Keith Packard +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 + +commit 06ffd8022ff5ac74274c9839d42c0c47274cb8b9 +Author: Keith Packard +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 + +commit 8bff2822c242d2878b408b9c0d8a7647108ea4b1 +Author: Keith Packard +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 + +commit 95d77eaff708397d8b1e29904dc47d8ea09e8754 +Author: Keith Packard +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 + +commit b15bd24bbe48e338497c6257f5fe2c7fd1cbffbb +Author: Keith Packard +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 + +commit c35ea586b9e792c45b287924fd256928308d9a36 +Author: Keith Packard +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 + +commit afc16e805145c3e9ab4ba948f9ab1d9aa2b27afb +Author: Keith Packard +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 + +commit 9877f6b880a0e89fbfbf1a39ded94bdc1891f3d9 +Author: Keith Packard +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 + +commit aa01f06acfbf029958a55f68175b6868817b333f +Author: Keith Packard +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 + +commit bbc4940730e6b431f1b9ccd9bbaf9faa0ffb2b1f +Author: Keith Packard +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 + +commit 053d092b3dca4ebb98e97ec0fe24f5f5e1c31f88 +Author: Keith Packard +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 + +commit 081455dcba860f3e4df8cd66f3fe686b204034ad +Author: Keith Packard +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 + +commit 9cf9a67f937185c0c0bb5b2bae4f420755965799 +Author: Keith Packard +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 + +commit 9289200ccb661b10ff892760ecbc752c7745de6b +Author: Keith Packard +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 + +commit 16b37b49985daf21ebb93b3d6ae64af67533be22 +Author: Keith Packard +Date: Fri Dec 20 23:02:51 2013 -0800 + + altos: Turn on warnings for LPC products too + + Signed-off-by: Keith Packard + +commit f578d9455eec9ea0eccd2d5e21349e274ea4281a +Author: Keith Packard +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 + +commit 14790172e02d4e1624c35797f87ffd94345d54ff +Author: Keith Packard +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 + +commit 48f996a9d65631238b4de446530f31f83acb99f5 +Author: Keith Packard +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 + +commit e11fcc299f4a1a0461a3442ca13f8984d76c30ff +Author: Keith Packard +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 + +commit 4ed108fb86676daea17264d7159c2cff9ea7a6e4 +Author: Keith Packard +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 + +commit 1406a5b0721a135913a9801e9eea9e91f0a536b4 +Author: Keith Packard +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 + +commit 316d898715746a379068ac8511692bdb9da14b39 +Author: Keith Packard +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 + +commit 5c9172ba5681ff93d63c9c263a453d0025170045 +Author: Keith Packard +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 + +commit db8f3426ac1cf756a2e4974ca61a5ae9048c80ce +Author: Keith Packard +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 + +commit b31b4622d5bd92c0cc0851818f5b595dbdb60ead +Author: Keith Packard +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 + +commit 755082d36231c1b247bc0e1f13919dd9b5c362a8 +Author: Keith Packard +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 + +commit 758acb92cccbe4b64a35a1883b42713738c90630 +Author: Keith Packard +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 + +commit c8b27410e45cc3d80ad4b896bffe70e9aec5e3aa +Author: Keith Packard +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 + +commit 2a912dcde191e2f750845c464611641a5abdc28a +Author: Keith Packard +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 + +commit b89fb51a963635e2effe3a31f803bfc29c2c46b7 +Author: Keith Packard +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 + +commit 8e5f3b922100f9de54b9650df14749e81b1a6562 +Author: Keith Packard +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 + +commit f65880cf5bfcba5005c32db2b300448e585f3e45 +Author: Keith Packard +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 + +commit 796cb90e3241103f79ae12565cf6f0dad21cb57c +Author: Keith Packard +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 + +commit 91bcfae2e64ecb2e7de1292b264910382b635aea +Author: Keith Packard +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 + +commit 2ad31bad20b20615e9d8b29088e2488fddc81ac9 +Author: Mike Beattie +Date: Fri Dec 20 15:06:37 2013 +1300 + + altosdroid: improve build system dependencies + + Signed-off-by: Mike Beattie + +commit 0e3b3ce66035e8a90fd708d9a4bc01370174c9eb +Author: Mike Beattie +Date: Fri Dec 20 15:06:07 2013 +1300 + + altosdroid: update to latest google play services + + Signed-off-by: Mike Beattie + +commit 96f2ae5fc0d3bf88704d2ae1b4df5dc6aefc523b +Author: Mike Beattie +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 + +commit ac12e77e3dffc9e9ddb1578a38b32783ad64e940 +Author: Bdale Garbee +Date: Thu Dec 19 03:22:21 2013 -0700 + + updated notes from 1.3 release + +commit 27528961457865acc3a38b822268df6d7cb86cfd +Merge: 4006eff a31629d +Author: Bdale Garbee +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 +Date: Thu Dec 19 01:58:24 2013 -0700 + + fix missing newline at end of src/test/Makefile + +commit a31629dfceb5e9cf1d5c654b8bd87d575f73c34b +Author: Keith Packard +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 + +commit bc3610d8cecbfed40c62d4dcb93fc9a4d2a7c9e3 +Author: Bdale Garbee +Date: Thu Dec 19 01:29:55 2013 -0700 + + update ChangeLog from git + commit 701c26ed85c28ac59e338975f2a6ba6bd25f6493 Author: Keith Packard Date: Thu Dec 19 00:16:16 2013 -0800 diff -Nru altos-1.3/Releasing altos-1.3.1/Releasing --- altos-1.3/Releasing 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/Releasing 2014-01-23 03:53:03.000000000 +0000 @@ -18,13 +18,13 @@ - if this is an x.y release, then: git checkout -b branch- git tag -a + - edit .git/gbp.conf to use branch- as upstream + - if this is an x.y.z release, then: git checkout branch- # the x.y parts only git merge master git tag -a # full x.y.z version - - edit .git/gbp.conf to use branch- as upstream if needed - git checkout debian git merge branch- @@ -35,9 +35,10 @@ git commit -n debian/changelog -m "update changelog for Debian build" - if this is a -1 release, then - git-buildpackage --git-no-pristine-tar --git-submodules + git-buildpackage --git-no-pristine-tar --git-submodules \ + --git-upstream-branch=branch- pristine-tar commit \ - ../build-area/altos/altos_.orig.tar.gz \ + ../build-area/altos_.orig.tar.gz \ branch- else if this is not a -1 release git-buildpackage --git-submodules @@ -57,16 +58,20 @@ - copy the relevant release notes file from doc/ to /home/bdale/web/altusmetrum/AltOS/releases/ - - go edit ~/web/altusmetrum/AltOS/releases/.mdwn to include - release date and explicit ref to dir contents so the AltOS page - shows versioned links, commit and push + - create /home/bdale/web/altusmetrum/MicroPeak/releases/, + and move the MicroPeak installers from AltOS/releases to there + + - go edit ~/web/altusmetrum/AltOS/releases/.mdwn and + /home/bdale/web/altusmetrum/MicroPeak/releases/.mdwn, to + include release date and explicit ref to dir contents so the + web pages shows versioned links, commit and push (cd doc ; make publish) this pushes fresh documents to the web site sudo debian/rules clean - git push origin master branch-1.1 debian + git push origin master branch- debian git push --tags push commits and leave the build tree in an uncluttered state diff -Nru altos-1.3/altosdroid/AndroidManifest.xml altos-1.3.1/altosdroid/AndroidManifest.xml --- altos-1.3/altosdroid/AndroidManifest.xml 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/AndroidManifest.xml 2014-01-23 03:53:03.000000000 +0000 @@ -17,7 +17,7 @@ --> @@ -32,6 +32,7 @@ + @@ -58,5 +59,7 @@ + diff -Nru altos-1.3/altosdroid/Makefile.am altos-1.3.1/altosdroid/Makefile.am --- altos-1.3/altosdroid/Makefile.am 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/Makefile.am 2014-01-23 03:53:03.000000000 +0000 @@ -29,7 +29,7 @@ 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 @@ 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-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 diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/AltosBluetooth.java 2014-01-23 03:53:03.000000000 +0000 @@ -31,7 +31,7 @@ //import android.os.Message; import android.util.Log; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; public class AltosBluetooth extends AltosLink { diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java 2014-01-23 03:53:03.000000000 +0000 @@ -49,7 +49,7 @@ import android.app.AlertDialog; import android.location.Location; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; public class AltosDroid extends FragmentActivity { // Debugging diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferences.java 2014-01-23 03:53:03.000000000 +0000 @@ -23,7 +23,7 @@ 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"; diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/AltosVoice.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ import android.speech.tts.TextToSpeech; import android.speech.tts.TextToSpeech.OnInitListener; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; public class AltosVoice { diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TabAscent.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TabDescent.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TabDescent.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TabDescent.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TabDescent.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TabLanded.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TabLanded.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TabLanded.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TabLanded.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TabMap.java 2014-01-23 03:53:03.000000000 +0000 @@ -19,7 +19,7 @@ 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; diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TabPad.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryLogger.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryReader.java 2014-01-23 03:53:03.000000000 +0000 @@ -25,7 +25,7 @@ import android.util.Log; import android.os.Handler; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; public class TelemetryReader extends Thread { diff -Nru altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java --- altos-1.3/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosdroid/src/org/altusmetrum/AltosDroid/TelemetryService.java 2014-01-23 03:53:03.000000000 +0000 @@ -44,7 +44,7 @@ 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 { diff -Nru altos-1.3/altoslib/AltosAccel.java altos-1.3.1/altoslib/AltosAccel.java --- altos-1.3/altoslib/AltosAccel.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosAccel.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosCRCException.java altos-1.3.1/altoslib/AltosCRCException.java --- altos-1.3/altoslib/AltosCRCException.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosCRCException.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosCompanion.java altos-1.3.1/altoslib/AltosCompanion.java --- altos-1.3/altoslib/AltosCompanion.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosCompanion.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosConfigData.java altos-1.3.1/altoslib/AltosConfigData.java --- altos-1.3/altoslib/AltosConfigData.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosConfigData.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosConfigValues.java altos-1.3.1/altoslib/AltosConfigValues.java --- altos-1.3/altoslib/AltosConfigValues.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosConfigValues.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 */ diff -Nru altos-1.3/altoslib/AltosConvert.java altos-1.3.1/altoslib/AltosConvert.java --- altos-1.3/altoslib/AltosConvert.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosConvert.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 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"); diff -Nru altos-1.3/altoslib/AltosDebug.java altos-1.3.1/altoslib/AltosDebug.java --- altos-1.3/altoslib/AltosDebug.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosDebug.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosDistance.java altos-1.3.1/altoslib/AltosDistance.java --- altos-1.3/altoslib/AltosDistance.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosDistance.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosEeprom.java altos-1.3.1/altoslib/AltosEeprom.java --- altos-1.3/altoslib/AltosEeprom.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEeprom.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosEepromChunk.java altos-1.3.1/altoslib/AltosEepromChunk.java --- altos-1.3/altoslib/AltosEepromChunk.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromChunk.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosEepromDownload.java altos-1.3.1/altoslib/AltosEepromDownload.java --- altos-1.3/altoslib/AltosEepromDownload.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromDownload.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosEepromFile.java altos-1.3.1/altoslib/AltosEepromFile.java --- altos-1.3/altoslib/AltosEepromFile.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromFile.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosEepromHeader.java altos-1.3.1/altoslib/AltosEepromHeader.java --- altos-1.3/altoslib/AltosEepromHeader.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromHeader.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosEepromIterable.java altos-1.3.1/altoslib/AltosEepromIterable.java --- altos-1.3/altoslib/AltosEepromIterable.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromIterable.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosEepromList.java altos-1.3.1/altoslib/AltosEepromList.java --- altos-1.3/altoslib/AltosEepromList.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromList.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosEepromLog.java altos-1.3.1/altoslib/AltosEepromLog.java --- altos-1.3/altoslib/AltosEepromLog.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromLog.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosEepromMega.java altos-1.3.1/altoslib/AltosEepromMega.java --- altos-1.3/altoslib/AltosEepromMega.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromMega.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 @@ 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.gyro_x = gyro_x(); - imu.gyro_y = gyro_y(); - imu.gyro_z = gyro_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 = 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; diff -Nru altos-1.3/altoslib/AltosEepromMetrum2.java altos-1.3.1/altoslib/AltosEepromMetrum2.java --- altos-1.3/altoslib/AltosEepromMetrum2.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromMetrum2.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosEepromMini.java altos-1.3.1/altoslib/AltosEepromMini.java --- altos-1.3/altoslib/AltosEepromMini.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromMini.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosEepromMonitor.java altos-1.3.1/altoslib/AltosEepromMonitor.java --- altos-1.3/altoslib/AltosEepromMonitor.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromMonitor.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosEepromTM.java altos-1.3.1/altoslib/AltosEepromTM.java --- altos-1.3/altoslib/AltosEepromTM.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromTM.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosEepromTm.java altos-1.3.1/altoslib/AltosEepromTm.java --- altos-1.3/altoslib/AltosEepromTm.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosEepromTm.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosFile.java altos-1.3.1/altoslib/AltosFile.java --- altos-1.3/altoslib/AltosFile.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosFile.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosFlash.java altos-1.3.1/altoslib/AltosFlash.java --- altos-1.3/altoslib/AltosFlash.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosFlash.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosFlashListener.java altos-1.3.1/altoslib/AltosFlashListener.java --- altos-1.3/altoslib/AltosFlashListener.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosFlashListener.java 2014-01-23 03:53:03.000000000 +0000 @@ -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); diff -Nru altos-1.3/altoslib/AltosFlightReader.java altos-1.3.1/altoslib/AltosFlightReader.java --- altos-1.3/altoslib/AltosFlightReader.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosFlightReader.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosFrequency.java altos-1.3.1/altoslib/AltosFrequency.java --- altos-1.3/altoslib/AltosFrequency.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosFrequency.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosGPS.java altos-1.3.1/altoslib/AltosGPS.java --- altos-1.3/altoslib/AltosGPS.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosGPS.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosGPSSat.java altos-1.3.1/altoslib/AltosGPSSat.java --- altos-1.3/altoslib/AltosGPSSat.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosGPSSat.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosGreatCircle.java altos-1.3.1/altoslib/AltosGreatCircle.java --- altos-1.3/altoslib/AltosGreatCircle.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosGreatCircle.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosHeight.java altos-1.3.1/altoslib/AltosHeight.java --- altos-1.3/altoslib/AltosHeight.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosHeight.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosHexfile.java altos-1.3.1/altoslib/AltosHexfile.java --- altos-1.3/altoslib/AltosHexfile.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosHexfile.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosHexsym.java altos-1.3.1/altoslib/AltosHexsym.java --- altos-1.3/altoslib/AltosHexsym.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosHexsym.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosIMU.java altos-1.3.1/altoslib/AltosIMU.java --- altos-1.3/altoslib/AltosIMU.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosIMU.java 2014-01-23 03:53:03.000000000 +0000 @@ -15,18 +15,30 @@ * 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 int gyro_x; - public int gyro_y; - public int gyro_z; + public double accel_x; + public double accel_y; + public double accel_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 @@ 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; } diff -Nru altos-1.3/altoslib/AltosIdle.java altos-1.3.1/altoslib/AltosIdle.java --- altos-1.3/altoslib/AltosIdle.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosIdle.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosIdleFetch.java altos-1.3.1/altoslib/AltosIdleFetch.java --- altos-1.3/altoslib/AltosIdleFetch.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosIdleFetch.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosIdleMonitor.java altos-1.3.1/altoslib/AltosIdleMonitor.java --- altos-1.3/altoslib/AltosIdleMonitor.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosIdleMonitor.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosIdleMonitorListener.java altos-1.3.1/altoslib/AltosIdleMonitorListener.java --- altos-1.3/altoslib/AltosIdleMonitorListener.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosIdleMonitorListener.java 2014-01-23 03:53:03.000000000 +0000 @@ -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); diff -Nru altos-1.3/altoslib/AltosIgnite.java altos-1.3.1/altoslib/AltosIgnite.java --- altos-1.3/altoslib/AltosIgnite.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosIgnite.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 @@ AltosLink link; boolean remote; boolean link_started; - - public final static int None = 0; - public final static int Apogee = 1; - public final static int Main = 2; + boolean have_npyro = false; + int npyro; + AltosConfigData config_data; + + 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 @@ } */ - 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 @@ 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 status() throws InterruptedException, TimeoutException { + HashMap status = new HashMap(); + 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 @@ 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 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(); diff -Nru altos-1.3/altoslib/AltosLib.java altos-1.3.1/altoslib/AltosLib.java --- altos-1.3/altoslib/AltosLib.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosLib.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosLine.java altos-1.3.1/altoslib/AltosLine.java --- altos-1.3/altoslib/AltosLine.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosLine.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosLink.java altos-1.3.1/altoslib/AltosLink.java --- altos-1.3/altoslib/AltosLink.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosLink.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosListenerState.java altos-1.3.1/altoslib/AltosListenerState.java --- altos-1.3/altoslib/AltosListenerState.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosListenerState.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosLog.java altos-1.3.1/altoslib/AltosLog.java --- altos-1.3/altoslib/AltosLog.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosLog.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosMag.java altos-1.3.1/altoslib/AltosMag.java --- altos-1.3/altoslib/AltosMag.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosMag.java 2014-01-23 03:53:03.000000000 +0000 @@ -15,14 +15,20 @@ * 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 @@ 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; } diff -Nru altos-1.3/altoslib/AltosMma655x.java altos-1.3.1/altoslib/AltosMma655x.java --- altos-1.3/altoslib/AltosMma655x.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosMma655x.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosMs5607.java altos-1.3.1/altoslib/AltosMs5607.java --- altos-1.3/altoslib/AltosMs5607.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosMs5607.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosNoSymbol.java altos-1.3.1/altoslib/AltosNoSymbol.java --- altos-1.3/altoslib/AltosNoSymbol.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosNoSymbol.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 -Nru altos-1.3/altoslib/AltosOrient.java altos-1.3.1/altoslib/AltosOrient.java --- altos-1.3/altoslib/AltosOrient.java 1970-01-01 00:00:00.000000000 +0000 +++ altos-1.3.1/altoslib/AltosOrient.java 2014-01-23 03:53:03.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * Copyright © 2013 Keith Packard + * + * 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 diff -Nru altos-1.3/altoslib/AltosParse.java altos-1.3.1/altoslib/AltosParse.java --- altos-1.3/altoslib/AltosParse.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosParse.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosPreferences.java altos-1.3.1/altoslib/AltosPreferences.java --- altos-1.3/altoslib/AltosPreferences.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosPreferences.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosPreferencesBackend.java altos-1.3.1/altoslib/AltosPreferencesBackend.java --- altos-1.3/altoslib/AltosPreferencesBackend.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosPreferencesBackend.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosProgrammer.java altos-1.3.1/altoslib/AltosProgrammer.java --- altos-1.3/altoslib/AltosProgrammer.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosProgrammer.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosPyro.java altos-1.3.1/altoslib/AltosPyro.java --- altos-1.3/altoslib/AltosPyro.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosPyro.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosReplayReader.java altos-1.3.1/altoslib/AltosReplayReader.java --- altos-1.3/altoslib/AltosReplayReader.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosReplayReader.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosRomconfig.java altos-1.3.1/altoslib/AltosRomconfig.java --- altos-1.3/altoslib/AltosRomconfig.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosRomconfig.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosSelfFlash.java altos-1.3.1/altoslib/AltosSelfFlash.java --- altos-1.3/altoslib/AltosSelfFlash.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosSelfFlash.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosSensorEMini.java altos-1.3.1/altoslib/AltosSensorEMini.java --- altos-1.3/altoslib/AltosSensorEMini.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosSensorEMini.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosSensorMM.java altos-1.3.1/altoslib/AltosSensorMM.java --- altos-1.3/altoslib/AltosSensorMM.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosSensorMM.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosSensorMega.java altos-1.3.1/altoslib/AltosSensorMega.java --- altos-1.3/altoslib/AltosSensorMega.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosSensorMega.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosSensorMetrum.java altos-1.3.1/altoslib/AltosSensorMetrum.java --- altos-1.3/altoslib/AltosSensorMetrum.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosSensorMetrum.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosSensorTM.java altos-1.3.1/altoslib/AltosSensorTM.java --- altos-1.3/altoslib/AltosSensorTM.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosSensorTM.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosSensorTMini.java altos-1.3.1/altoslib/AltosSensorTMini.java --- altos-1.3/altoslib/AltosSensorTMini.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosSensorTMini.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosSpeed.java altos-1.3.1/altoslib/AltosSpeed.java --- altos-1.3/altoslib/AltosSpeed.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosSpeed.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosState.java altos-1.3.1/altoslib/AltosState.java --- altos-1.3/altoslib/AltosState.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosState.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 @@ 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 @@ pressure = new AltosPressure(); speed = new AltosSpeed(); acceleration = new AltosAccel(); + orient = new AltosValue(); temperature = AltosLib.MISSING; battery_voltage = AltosLib.MISSING; @@ -621,6 +636,7 @@ pressure.finish_update(); speed.finish_update(); acceleration.finish_update(); + orient.finish_update(); kalman_height.finish_update(); kalman_speed.finish_update(); @@ -665,6 +681,7 @@ 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 @@ } 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 @@ 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 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) { diff -Nru altos-1.3/altoslib/AltosStateIterable.java altos-1.3.1/altoslib/AltosStateIterable.java --- altos-1.3/altoslib/AltosStateIterable.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosStateIterable.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosStateUpdate.java altos-1.3.1/altoslib/AltosStateUpdate.java --- altos-1.3/altoslib/AltosStateUpdate.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosStateUpdate.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosTelemetry.java altos-1.3.1/altoslib/AltosTelemetry.java --- altos-1.3/altoslib/AltosTelemetry.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetry.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosTelemetryConfiguration.java altos-1.3.1/altoslib/AltosTelemetryConfiguration.java --- altos-1.3/altoslib/AltosTelemetryConfiguration.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryConfiguration.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosTelemetryFile.java altos-1.3.1/altoslib/AltosTelemetryFile.java --- altos-1.3/altoslib/AltosTelemetryFile.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryFile.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosTelemetryIterable.java altos-1.3.1/altoslib/AltosTelemetryIterable.java --- altos-1.3/altoslib/AltosTelemetryIterable.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryIterable.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosTelemetryLegacy.java altos-1.3.1/altoslib/AltosTelemetryLegacy.java --- altos-1.3/altoslib/AltosTelemetryLegacy.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryLegacy.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosTelemetryLocation.java altos-1.3.1/altoslib/AltosTelemetryLocation.java --- altos-1.3/altoslib/AltosTelemetryLocation.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryLocation.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosTelemetryMap.java altos-1.3.1/altoslib/AltosTelemetryMap.java --- altos-1.3/altoslib/AltosTelemetryMap.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryMap.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosTelemetryMegaData.java altos-1.3.1/altoslib/AltosTelemetryMegaData.java --- altos-1.3/altoslib/AltosTelemetryMegaData.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryMegaData.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosTelemetryMegaSensor.java altos-1.3.1/altoslib/AltosTelemetryMegaSensor.java --- altos-1.3/altoslib/AltosTelemetryMegaSensor.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryMegaSensor.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 @@ 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 @@ 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.gyro_x = gyro_x; - imu.gyro_y = gyro_y; - imu.gyro_z = gyro_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 = 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; } diff -Nru altos-1.3/altoslib/AltosTelemetryMetrumData.java altos-1.3.1/altoslib/AltosTelemetryMetrumData.java --- altos-1.3/altoslib/AltosTelemetryMetrumData.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryMetrumData.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosTelemetryMetrumSensor.java altos-1.3.1/altoslib/AltosTelemetryMetrumSensor.java --- altos-1.3/altoslib/AltosTelemetryMetrumSensor.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryMetrumSensor.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosTelemetryMini.java altos-1.3.1/altoslib/AltosTelemetryMini.java --- altos-1.3/altoslib/AltosTelemetryMini.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryMini.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosTelemetryRaw.java altos-1.3.1/altoslib/AltosTelemetryRaw.java --- altos-1.3/altoslib/AltosTelemetryRaw.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryRaw.java 2014-01-23 03:53:03.000000000 +0000 @@ -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) { diff -Nru altos-1.3/altoslib/AltosTelemetryReader.java altos-1.3.1/altoslib/AltosTelemetryReader.java --- altos-1.3/altoslib/AltosTelemetryReader.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryReader.java 2014-01-23 03:53:03.000000000 +0000 @@ -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.*; diff -Nru altos-1.3/altoslib/AltosTelemetrySatellite.java altos-1.3.1/altoslib/AltosTelemetrySatellite.java --- altos-1.3/altoslib/AltosTelemetrySatellite.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetrySatellite.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosTelemetrySensor.java altos-1.3.1/altoslib/AltosTelemetrySensor.java --- altos-1.3/altoslib/AltosTelemetrySensor.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetrySensor.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosTelemetryStandard.java altos-1.3.1/altoslib/AltosTelemetryStandard.java --- altos-1.3/altoslib/AltosTelemetryStandard.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTelemetryStandard.java 2014-01-23 03:53:03.000000000 +0000 @@ -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; diff -Nru altos-1.3/altoslib/AltosTemperature.java altos-1.3.1/altoslib/AltosTemperature.java --- altos-1.3/altoslib/AltosTemperature.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosTemperature.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosUnits.java altos-1.3.1/altoslib/AltosUnits.java --- altos-1.3/altoslib/AltosUnits.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosUnits.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altoslib/AltosUnitsListener.java altos-1.3.1/altoslib/AltosUnitsListener.java --- altos-1.3/altoslib/AltosUnitsListener.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/AltosUnitsListener.java 2014-01-23 03:53:03.000000000 +0000 @@ -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); diff -Nru altos-1.3/altoslib/Makefile.am altos-1.3.1/altoslib/Makefile.am --- altos-1.3/altoslib/Makefile.am 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altoslib/Makefile.am 2014-01-23 03:53:03.000000000 +0000 @@ -70,6 +70,7 @@ AltosMma655x.java \ AltosMs5607.java \ AltosNoSymbol.java \ + AltosOrient.java \ AltosParse.java \ AltosPreferences.java \ AltosPreferencesBackend.java \ diff -Nru altos-1.3/altosui/Altos.java altos-1.3.1/altosui/Altos.java --- altos-1.3/altosui/Altos.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/Altos.java 2014-01-23 03:53:03.000000000 +0000 @@ -20,7 +20,7 @@ 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 { diff -Nru altos-1.3/altosui/AltosAscent.java altos-1.3.1/altosui/AltosAscent.java --- altos-1.3/altosui/AltosAscent.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosAscent.java 2014-01-23 03:53:03.000000000 +0000 @@ -19,7 +19,7 @@ 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 @@ 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 @@ height.reset(); speed.reset(); accel.reset(); + orient.reset(); } public void set_font() { @@ -354,6 +366,7 @@ height.set_font(); speed.set_font(); accel.set_font(); + orient.set_font(); } public void show(AltosState state, AltosListenerState listener_state) { @@ -375,6 +388,7 @@ 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 @@ * 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++); } } diff -Nru altos-1.3/altosui/AltosBTKnown.java altos-1.3.1/altosui/AltosBTKnown.java --- altos-1.3/altosui/AltosBTKnown.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosBTKnown.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altosui/AltosCSV.java altos-1.3.1/altosui/AltosCSV.java --- altos-1.3/altosui/AltosCSV.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosCSV.java 2014-01-23 03:53:03.000000000 +0000 @@ -19,7 +19,7 @@ import java.io.*; import java.util.*; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; public class AltosCSV implements AltosWriter { File name; diff -Nru altos-1.3/altosui/AltosCSVUI.java altos-1.3.1/altosui/AltosCSVUI.java --- altos-1.3/altosui/AltosCSVUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosCSVUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ 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 diff -Nru altos-1.3/altosui/AltosCompanionInfo.java altos-1.3.1/altosui/AltosCompanionInfo.java --- altos-1.3/altosui/AltosCompanionInfo.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosCompanionInfo.java 2014-01-23 03:53:03.000000000 +0000 @@ -19,7 +19,7 @@ import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; public class AltosCompanionInfo extends JTable { private AltosFlightInfoTableModel model; diff -Nru altos-1.3/altosui/AltosConfig.java altos-1.3.1/altosui/AltosConfig.java --- altos-1.3/altosui/AltosConfig.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosConfig.java 2014-01-23 03:53:03.000000000 +0000 @@ -22,7 +22,7 @@ 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 { diff -Nru altos-1.3/altosui/AltosConfigFreqUI.java altos-1.3.1/altosui/AltosConfigFreqUI.java --- altos-1.3/altosui/AltosConfigFreqUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosConfigFreqUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ 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 { diff -Nru altos-1.3/altosui/AltosConfigPyroUI.java altos-1.3.1/altosui/AltosConfigPyroUI.java --- altos-1.3/altosui/AltosConfigPyroUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosConfigPyroUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,12 +21,12 @@ 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 @@ 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 @@ 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 @@ } } + /* 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 @@ 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); } diff -Nru altos-1.3/altosui/AltosConfigTD.java altos-1.3.1/altosui/AltosConfigTD.java --- altos-1.3/altosui/AltosConfigTD.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosConfigTD.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ 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 { diff -Nru altos-1.3/altosui/AltosConfigTDUI.java altos-1.3.1/altosui/AltosConfigTDUI.java --- altos-1.3/altosui/AltosConfigTDUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosConfigTDUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ 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 diff -Nru altos-1.3/altosui/AltosConfigUI.java altos-1.3.1/altosui/AltosConfigUI.java --- altos-1.3/altosui/AltosConfigUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosConfigUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ 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 diff -Nru altos-1.3/altosui/AltosDataChooser.java altos-1.3.1/altosui/AltosDataChooser.java --- altos-1.3/altosui/AltosDataChooser.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosDataChooser.java 2014-01-23 03:53:03.000000000 +0000 @@ -20,7 +20,7 @@ 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 { diff -Nru altos-1.3/altosui/AltosDescent.java altos-1.3.1/altosui/AltosDescent.java --- altos-1.3/altosui/AltosDescent.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosDescent.java 2014-01-23 03:53:03.000000000 +0000 @@ -19,7 +19,7 @@ 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; diff -Nru altos-1.3/altosui/AltosDisplayThread.java altos-1.3.1/altosui/AltosDisplayThread.java --- altos-1.3/altosui/AltosDisplayThread.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosDisplayThread.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ import javax.swing.*; import java.io.*; import java.text.*; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; public class AltosDisplayThread extends Thread { diff -Nru altos-1.3/altosui/AltosEepromDelete.java altos-1.3.1/altosui/AltosEepromDelete.java --- altos-1.3/altosui/AltosEepromDelete.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosEepromDelete.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ 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; diff -Nru altos-1.3/altosui/AltosEepromManage.java altos-1.3.1/altosui/AltosEepromManage.java --- altos-1.3/altosui/AltosEepromManage.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosEepromManage.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ 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 { diff -Nru altos-1.3/altosui/AltosEepromMonitorUI.java altos-1.3.1/altosui/AltosEepromMonitorUI.java --- altos-1.3/altosui/AltosEepromMonitorUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosEepromMonitorUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ 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; diff -Nru altos-1.3/altosui/AltosEepromSelect.java altos-1.3.1/altosui/AltosEepromSelect.java --- altos-1.3/altosui/AltosEepromSelect.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosEepromSelect.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ 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 { diff -Nru altos-1.3/altosui/AltosFlashUI.java altos-1.3.1/altosui/AltosFlashUI.java --- altos-1.3/altosui/AltosFlashUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosFlashUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -23,7 +23,7 @@ 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 diff -Nru altos-1.3/altosui/AltosFlightDisplay.java altos-1.3.1/altosui/AltosFlightDisplay.java --- altos-1.3/altosui/AltosFlightDisplay.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosFlightDisplay.java 2014-01-23 03:53:03.000000000 +0000 @@ -17,7 +17,7 @@ package altosui; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; public interface AltosFlightDisplay { void reset(); diff -Nru altos-1.3/altosui/AltosFlightStats.java altos-1.3.1/altosui/AltosFlightStats.java --- altos-1.3/altosui/AltosFlightStats.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosFlightStats.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 @@ 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 @@ 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 @@ 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) { diff -Nru altos-1.3/altosui/AltosFlightStatsTable.java altos-1.3.1/altosui/AltosFlightStatsTable.java --- altos-1.3/altosui/AltosFlightStatsTable.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosFlightStatsTable.java 2014-01-23 03:53:03.000000000 +0000 @@ -19,7 +19,7 @@ import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; public class AltosFlightStatsTable extends JComponent { GridBagLayout layout; diff -Nru altos-1.3/altosui/AltosFlightStatus.java altos-1.3.1/altosui/AltosFlightStatus.java --- altos-1.3/altosui/AltosFlightStatus.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosFlightStatus.java 2014-01-23 03:53:03.000000000 +0000 @@ -19,7 +19,7 @@ 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; diff -Nru altos-1.3/altosui/AltosFlightStatusTableModel.java altos-1.3.1/altosui/AltosFlightStatusTableModel.java --- altos-1.3/altosui/AltosFlightStatusTableModel.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosFlightStatusTableModel.java 2014-01-23 03:53:03.000000000 +0000 @@ -27,7 +27,7 @@ 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 = { diff -Nru altos-1.3/altosui/AltosFlightStatusUpdate.java altos-1.3.1/altosui/AltosFlightStatusUpdate.java --- altos-1.3/altosui/AltosFlightStatusUpdate.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosFlightStatusUpdate.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altosui/AltosFlightUI.java altos-1.3.1/altosui/AltosFlightUI.java --- altos-1.3/altosui/AltosFlightUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosFlightUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ 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 { diff -Nru altos-1.3/altosui/AltosFreqList.java altos-1.3.1/altosui/AltosFreqList.java --- altos-1.3/altosui/AltosFreqList.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosFreqList.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/altosui/AltosGraph.java altos-1.3.1/altosui/AltosGraph.java --- altos-1.3/altosui/AltosGraph.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosGraph.java 2014-01-23 03:53:03.000000000 +0000 @@ -22,7 +22,7 @@ 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 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 @@ 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 @@ 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 @@ 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 diff -Nru altos-1.3/altosui/AltosGraphDataPoint.java altos-1.3.1/altosui/AltosGraphDataPoint.java --- altos-1.3/altosui/AltosGraphDataPoint.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosGraphDataPoint.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 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 @@ 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); diff -Nru altos-1.3/altosui/AltosGraphDataSet.java altos-1.3.1/altosui/AltosGraphDataSet.java --- altos-1.3/altosui/AltosGraphDataSet.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosGraphDataSet.java 2014-01-23 03:53:03.000000000 +0000 @@ -20,7 +20,7 @@ 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 { diff -Nru altos-1.3/altosui/AltosGraphUI.java altos-1.3.1/altosui/AltosGraphUI.java --- altos-1.3/altosui/AltosGraphUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosGraphUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -9,7 +9,7 @@ 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; diff -Nru altos-1.3/altosui/AltosIdleMonitorUI.java altos-1.3.1/altosui/AltosIdleMonitorUI.java --- altos-1.3/altosui/AltosIdleMonitorUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosIdleMonitorUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -24,7 +24,7 @@ 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 @@ 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 @@ 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 @@ 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); diff -Nru altos-1.3/altosui/AltosIgniteUI.java altos-1.3.1/altosui/AltosIgniteUI.java --- altos-1.3/altosui/AltosIgniteUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosIgniteUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -22,8 +22,9 @@ 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 @@ 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 @@ LinkedBlockingQueue command_queue; + LinkedBlockingQueue 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 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 @@ String reply = null; if (command.equals("get_status")) { - apogee_status = ignite.status(AltosIgnite.Apogee); - main_status = ignite.status(AltosIgnite.Main); + HashMap 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 IgniteHandler(JFrame in_owner) { + public IgniteHandler(JFrame in_owner, AltosLink in_link) { owner = in_owner; + link = in_link; } } @@ -170,16 +229,15 @@ 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 @@ } } + 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 @@ } } + 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 @@ } void close() { - send_command("quit"); - timer.stop(); + if (opened) { + send_command("quit"); + timer.stop(); + } setVisible(false); dispose(); } @@ -247,10 +330,12 @@ 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 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 @@ 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 @@ private boolean open() { command_queue = new LinkedBlockingQueue(); + reply_queue = new LinkedBlockingQueue(); + 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 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 @@ 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 @@ 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 @@ 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"); diff -Nru altos-1.3/altosui/AltosInfoTable.java altos-1.3.1/altosui/AltosInfoTable.java --- altos-1.3/altosui/AltosInfoTable.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosInfoTable.java 2014-01-23 03:53:03.000000000 +0000 @@ -20,7 +20,7 @@ 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 @@ 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 @@ 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) diff -Nru altos-1.3/altosui/AltosKML.java altos-1.3.1/altosui/AltosKML.java --- altos-1.3/altosui/AltosKML.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosKML.java 2014-01-23 03:53:03.000000000 +0000 @@ -18,7 +18,7 @@ package altosui; import java.io.*; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; public class AltosKML implements AltosWriter { diff -Nru altos-1.3/altosui/AltosLanded.java altos-1.3.1/altosui/AltosLanded.java --- altos-1.3/altosui/AltosLanded.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosLanded.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ 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; diff -Nru altos-1.3/altosui/AltosPad.java altos-1.3.1/altosui/AltosPad.java --- altos-1.3/altosui/AltosPad.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosPad.java 2014-01-23 03:53:03.000000000 +0000 @@ -19,7 +19,7 @@ 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; diff -Nru altos-1.3/altosui/AltosRomconfigUI.java altos-1.3.1/altosui/AltosRomconfigUI.java --- altos-1.3/altosui/AltosRomconfigUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosRomconfigUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -20,7 +20,7 @@ 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 @@ 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 @@ 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 */ diff -Nru altos-1.3/altosui/AltosScanUI.java altos-1.3.1/altosui/AltosScanUI.java --- altos-1.3/altosui/AltosScanUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosScanUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -25,7 +25,7 @@ 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 { diff -Nru altos-1.3/altosui/AltosSerial.java altos-1.3.1/altosui/AltosSerial.java --- altos-1.3/altosui/AltosSerial.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosSerial.java 2014-01-23 03:53:03.000000000 +0000 @@ -25,7 +25,7 @@ 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.*; diff -Nru altos-1.3/altosui/AltosSiteMap.java altos-1.3.1/altosui/AltosSiteMap.java --- altos-1.3/altosui/AltosSiteMap.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosSiteMap.java 2014-01-23 03:53:03.000000000 +0000 @@ -23,7 +23,7 @@ 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 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); diff -Nru altos-1.3/altosui/AltosSiteMapCache.java altos-1.3.1/altosui/AltosSiteMapCache.java --- altos-1.3/altosui/AltosSiteMapCache.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosSiteMapCache.java 2014-01-23 03:53:03.000000000 +0000 @@ -25,8 +25,13 @@ 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 @@ } 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; } diff -Nru altos-1.3/altosui/AltosSiteMapPreload.java altos-1.3.1/altosui/AltosSiteMapPreload.java --- altos-1.3/altosui/AltosSiteMapPreload.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosSiteMapPreload.java 2014-01-23 03:53:03.000000000 +0000 @@ -213,7 +213,7 @@ 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 @@ pane.setLayout(new GridBagLayout()); - map = new AltosSiteMap(4); + map = new AltosSiteMap(radius); c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.CENTER; @@ -464,4 +464,4 @@ setLocationRelativeTo(owner); setVisible(true); } -} \ No newline at end of file +} diff -Nru altos-1.3/altosui/AltosSiteMapTile.java altos-1.3.1/altosui/AltosSiteMapTile.java --- altos-1.3/altosui/AltosSiteMapTile.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosSiteMapTile.java 2014-01-23 03:53:03.000000000 +0000 @@ -22,7 +22,7 @@ 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; diff -Nru altos-1.3/altosui/AltosUI.java altos-1.3.1/altosui/AltosUI.java --- altos-1.3/altosui/AltosUI.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosUI.java 2014-01-23 03:53:03.000000000 +0000 @@ -22,7 +22,7 @@ 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 @@ AltosUI altosui = new AltosUI(); java.util.List 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 @@ } 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")) diff -Nru altos-1.3/altosui/AltosUIPreferencesBackend.java altos-1.3.1/altosui/AltosUIPreferencesBackend.java --- altos-1.3/altosui/AltosUIPreferencesBackend.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosUIPreferencesBackend.java 2014-01-23 03:53:03.000000000 +0000 @@ -19,7 +19,7 @@ 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 { diff -Nru altos-1.3/altosui/AltosWriter.java altos-1.3.1/altosui/AltosWriter.java --- altos-1.3/altosui/AltosWriter.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/AltosWriter.java 2014-01-23 03:53:03.000000000 +0000 @@ -17,7 +17,7 @@ package altosui; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; public interface AltosWriter { diff -Nru altos-1.3/altosui/Makefile.am altos-1.3.1/altosui/Makefile.am --- altos-1.3/altosui/Makefile.am 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/Makefile.am 2014-01-23 03:53:03.000000000 +0000 @@ -98,7 +98,8 @@ altosuilib_$(ALTOSUILIB_VERSION).jar LIBALTOS= \ - libaltos.so \ + libaltos32.so \ + libaltos64.so \ libaltos.dylib \ altos.dll @@ -164,7 +165,7 @@ $(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 @@ 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 @@ 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 @@ -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 diff -Nru altos-1.3/altosui/altos-windows.nsi.in altos-1.3.1/altosui/altos-windows.nsi.in --- altos-1.3/altosui/altos-windows.nsi.in 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosui/altos-windows.nsi.in 2014-01-23 03:53:03.000000000 +0000 @@ -136,6 +136,7 @@ File "../doc/telemetrum-outline.pdf" File "../doc/telemega-outline.pdf" File "../doc/easymini-outline.pdf" + File "../doc/telemini.pdf" SectionEnd Section "Uninstaller" diff -Nru altos-1.3/altosuilib/AltosUIAxis.java altos-1.3.1/altosuilib/AltosUIAxis.java --- altos-1.3/altosuilib/AltosUIAxis.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosuilib/AltosUIAxis.java 2014-01-23 03:53:03.000000000 +0000 @@ -22,7 +22,7 @@ import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; import org.jfree.ui.*; import org.jfree.chart.*; diff -Nru altos-1.3/altosuilib/AltosUIEnable.java altos-1.3.1/altosuilib/AltosUIEnable.java --- altos-1.3/altosuilib/AltosUIEnable.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosuilib/AltosUIEnable.java 2014-01-23 03:53:03.000000000 +0000 @@ -23,7 +23,7 @@ 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 @@ 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 @@ 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 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 @@ /* 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 @@ } }); 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 AltosUIEnable() { il = new Insets(4,4,4,4); ir = new Insets(4,4,4,4); + x = 0; y = 0; setLayout(new GridBagLayout()); add_units(); diff -Nru altos-1.3/altosuilib/AltosUIGraph.java altos-1.3.1/altosuilib/AltosUIGraph.java --- altos-1.3/altosuilib/AltosUIGraph.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosuilib/AltosUIGraph.java 2014-01-23 03:53:03.000000000 +0000 @@ -22,7 +22,7 @@ import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; import org.jfree.ui.*; import org.jfree.chart.*; diff -Nru altos-1.3/altosuilib/AltosUIGrapher.java altos-1.3.1/altosuilib/AltosUIGrapher.java --- altos-1.3/altosuilib/AltosUIGrapher.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosuilib/AltosUIGrapher.java 2014-01-23 03:53:03.000000000 +0000 @@ -22,7 +22,7 @@ import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; import org.jfree.ui.*; import org.jfree.chart.*; diff -Nru altos-1.3/altosuilib/AltosUILib.java altos-1.3.1/altosuilib/AltosUILib.java --- altos-1.3/altosuilib/AltosUILib.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosuilib/AltosUILib.java 2014-01-23 03:53:03.000000000 +0000 @@ -20,7 +20,7 @@ import java.awt.*; import libaltosJNI.*; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; public class AltosUILib extends AltosLib { @@ -81,18 +81,18 @@ 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; } } diff -Nru altos-1.3/altosuilib/AltosUIMarker.java altos-1.3.1/altosuilib/AltosUIMarker.java --- altos-1.3/altosuilib/AltosUIMarker.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosuilib/AltosUIMarker.java 2014-01-23 03:53:03.000000000 +0000 @@ -22,7 +22,7 @@ import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; import org.jfree.ui.*; import org.jfree.chart.*; diff -Nru altos-1.3/altosuilib/AltosUIPreferences.java altos-1.3.1/altosuilib/AltosUIPreferences.java --- altos-1.3/altosuilib/AltosUIPreferences.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosuilib/AltosUIPreferences.java 2014-01-23 03:53:03.000000000 +0000 @@ -21,7 +21,7 @@ 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 { diff -Nru altos-1.3/altosuilib/AltosUIPreferencesBackend.java altos-1.3.1/altosuilib/AltosUIPreferencesBackend.java --- altos-1.3/altosuilib/AltosUIPreferencesBackend.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosuilib/AltosUIPreferencesBackend.java 2014-01-23 03:53:03.000000000 +0000 @@ -19,7 +19,7 @@ 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 { diff -Nru altos-1.3/altosuilib/AltosUISeries.java altos-1.3.1/altosuilib/AltosUISeries.java --- altos-1.3/altosuilib/AltosUISeries.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/altosuilib/AltosUISeries.java 2014-01-23 03:53:03.000000000 +0000 @@ -22,7 +22,7 @@ import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; import org.jfree.ui.*; import org.jfree.chart.*; diff -Nru altos-1.3/ao-bringup/turnon_telemega altos-1.3.1/ao-bringup/turnon_telemega --- altos-1.3/ao-bringup/turnon_telemega 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/ao-bringup/turnon_telemega 2014-01-23 03:53:03.000000000 +0000 @@ -38,7 +38,8 @@ 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 diff -Nru altos-1.3/configure.ac altos-1.3.1/configure.ac --- altos-1.3/configure.ac 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/configure.ac 2014-01-23 03:53:03.000000000 +0000 @@ -18,7 +18,7 @@ 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 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 @@ 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 " 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}" diff -Nru altos-1.3/debian/changelog altos-1.3.1/debian/changelog --- altos-1.3/debian/changelog 2013-12-19 09:11:15.000000000 +0000 +++ altos-1.3.1/debian/changelog 2014-01-23 03:57:04.000000000 +0000 @@ -1,3 +1,73 @@ +altos (1.3.1-1) unstable; urgency=medium + + [ Bdale Garbee ] + * updated notes from 1.3 release + * use firmware in /usr/share/altos for production flashing + * set version to 1.3.0.2 for test flights this weekend + * set version to 1.3.1 for release + * update copyright date on main documentation file + * freshen ChangeLog for release + + [ Mike Beattie ] + * altosdroid: force older jarsigner signing algorithm for java 1.7 + * altosdroid: update to latest google play services + * altosdroid: improve build system dependencies + + [ Keith Packard ] + * altoslib: Convert IMU and Mag sensor values to useful units + * altoslib: Fetch 'orient' value from Mega Sensor packet + * altosuilib: Rearrange graph enable buttons + * altosui: Add imu and mag sensor values to plots + * altoslib: Bump library version + * altos: Execute self-test on MMA655X part + * altos: 3-axis accel calibration was invalid in explicit accel cal mode + * altos: Complain about sensor self-test errors only in idle mode + * altos: mma655x also needs ao_sensor_errors + * altos: Clean up some minor warnings from -Wall + * altos: Turn on -Wall for stm compiles + * altos: Clean up -Wextra warnings + * altos: unsigned value in ao_pyro_set checked for negative value + * altos: Add default button return value from ao_button_get + * altos/stm: Turn on -Wextra + * altos: Clean up warnings for LPC products + * altos: cc115l driver tone_run wasn't recording number of tones + * altos: lpc exti setup was incorrectly testing mode + * altos/lpc: Missing */ in definition of PIO0_4 + * altos: Turn on warnings for LPC products too + * altos: Turn on -Werror for STM and LPC builds + * altosui: Switch from radio buttons to check boxes in pyro config. Add close + * altosui: Extend Fire Igniter to additional channels + * altoslib: Add AltosOrient class and max_orient() + * altosui: Add orient to ascent and info table views + * altosui: Adjust info table column width + * altosui: Switch Graph to AltosOrient type + * altos: Add 'O' command for TeleMega orient testing + * altos: Flip acceleration data consistently for orientation changes + * altosui: Handle a missing libaltos when starting up + * Bump version to 1.3.9.1 + * libaltos: Build -m64 and -m32 for fat tarball when possible + * altosui: Require both libaltos32 and libaltos64 for fat Linux tarball + * doc: Ship telemini outline as pdf file too + * altos: Switch APRS to compressed position format + * altos: Use factory calibration for all acceleration computations + * altos: Report battery, apogee and main voltages over APRS + * Ignore 32 and 64 bit cjnitest apps + * altos: Add missing ADC divider values for Tmega v1.0 + * altosui: Make romconfig serial and radio cal fields 8 digits wide + * altoslib: Fetch target device config for Fire Igniter npyro value + * altosuilib: Remove some spurious debug printfs + * altosui: Handle already-opened link in IgniteUI + * altosui: Handle serial-port startup errors in idle-monitor + * doc: Fix image widths to make them all scale the same amount + * doc: Update for 1.3.1 + + [ Anthony Towns ] + * AltosSiteMapPreload: only load 49 maps + * altosui: --fetchmaps gets same number of maps as GUI + * altosui: rate limit map downloads + + -- Bdale Garbee Wed, 22 Jan 2014 20:56:31 -0700 + altos (1.3-1) unstable; urgency=low [ Keith Packard ] diff -Nru altos-1.3/debian/docs altos-1.3.1/debian/docs --- altos-1.3/debian/docs 2013-12-19 09:11:15.000000000 +0000 +++ altos-1.3.1/debian/docs 2014-01-23 03:57:04.000000000 +0000 @@ -8,3 +8,5 @@ doc/altos.pdf doc/telemetrum-outline.pdf doc/telemega-outline.pdf +doc/easymini-outline.pdf +doc/telemini.pdf diff -Nru altos-1.3/doc/Makefile altos-1.3.1/doc/Makefile --- altos-1.3/doc/Makefile 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/doc/Makefile 2014-01-23 03:53:03.000000000 +0000 @@ -12,7 +12,8 @@ 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 \ diff -Nru altos-1.3/doc/altusmetrum.xsl altos-1.3.1/doc/altusmetrum.xsl --- altos-1.3/doc/altusmetrum.xsl 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/doc/altusmetrum.xsl 2014-01-23 03:53:03.000000000 +0000 @@ -22,7 +22,7 @@ Towns - 2013 + 2014 Bdale Garbee and Keith Packard @@ -36,6 +36,14 @@ + 1.3.1 + 21 January 2014 + + Bug fixes for TeleMega and TeleMetrum v2.0 along with a few + small UI improvements. + + + 1.3 12 November 2013 @@ -1578,7 +1586,7 @@ - + @@ -1603,7 +1611,7 @@ - + @@ -1787,10 +1795,10 @@ rocket as it heads towards apogee. - 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. The current latitude and longitude reported by the GPS are @@ -2015,7 +2023,7 @@ - + @@ -2037,7 +2045,7 @@ - + @@ -2052,7 +2060,7 @@ - + @@ -2065,7 +2073,7 @@ - + @@ -2122,7 +2130,7 @@ - + @@ -2379,7 +2387,7 @@ - + @@ -2489,7 +2497,7 @@ - + @@ -2584,7 +2592,7 @@ - + @@ -2598,8 +2606,8 @@ 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. Next, select the desired igniter to fire. This will enable the @@ -2618,7 +2626,7 @@ - + @@ -2636,7 +2644,7 @@ - + @@ -4186,11 +4194,12 @@ 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. Note that the 'reboot' command, which is very useful on the altimeters, @@ -4448,6 +4457,13 @@ Release Notes + Version 1.3.1 + + + Version 1.3 + + +
+ + Version 1.3.1 is a minor release. It improves support for TeleMega, + TeleMetrum v2.0, TeleMini v2.0 and EasyMini. + + + AltOS Firmware Changes + + + + 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. + + + + + 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. + + + + + 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. + + + + + + AltosUI changes + + + + 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. + + + + + 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. + + + + + 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. + + + + +
Binary files /tmp/jvfAtj0wE0/altos-1.3/doc/site-map.png and /tmp/XbHi5Xm3tQ/altos-1.3.1/doc/site-map.png differ Binary files /tmp/jvfAtj0wE0/altos-1.3/doc/table.png and /tmp/XbHi5Xm3tQ/altos-1.3.1/doc/table.png differ Binary files /tmp/jvfAtj0wE0/altos-1.3/doc/telemini.pdf and /tmp/XbHi5Xm3tQ/altos-1.3.1/doc/telemini.pdf differ diff -Nru altos-1.3/libaltos/.gitignore altos-1.3.1/libaltos/.gitignore --- altos-1.3/libaltos/.gitignore 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/libaltos/.gitignore 2014-01-23 03:53:03.000000000 +0000 @@ -9,5 +9,7 @@ libaltos_wrap.c libaltosJNI cjnitest +cjnitest32 +cjnitest64 libaltos.swig swig_bindings/ diff -Nru altos-1.3/libaltos/Makefile.am altos-1.3.1/libaltos/Makefile.am --- altos-1.3/libaltos/Makefile.am 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/libaltos/Makefile.am 2014-01-23 03:53:03.000000000 +0000 @@ -5,8 +5,7 @@ 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 @@ 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 diff -Nru altos-1.3/micropeak/MicroData.java altos-1.3.1/micropeak/MicroData.java --- altos-1.3/micropeak/MicroData.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/micropeak/MicroData.java 2014-01-23 03:53:03.000000000 +0000 @@ -20,7 +20,7 @@ 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 { diff -Nru altos-1.3/micropeak/MicroDownload.java altos-1.3.1/micropeak/MicroDownload.java --- altos-1.3/micropeak/MicroDownload.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/micropeak/MicroDownload.java 2014-01-23 03:53:03.000000000 +0000 @@ -23,7 +23,7 @@ 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 { diff -Nru altos-1.3/micropeak/MicroExport.java altos-1.3.1/micropeak/MicroExport.java --- altos-1.3/micropeak/MicroExport.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/micropeak/MicroExport.java 2014-01-23 03:53:03.000000000 +0000 @@ -23,7 +23,7 @@ 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 { diff -Nru altos-1.3/micropeak/MicroFile.java altos-1.3.1/micropeak/MicroFile.java --- altos-1.3/micropeak/MicroFile.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/micropeak/MicroFile.java 2014-01-23 03:53:03.000000000 +0000 @@ -19,7 +19,7 @@ import java.io.*; import java.util.*; -import org.altusmetrum.altoslib_2.*; +import org.altusmetrum.altoslib_3.*; import org.altusmetrum.altosuilib_1.*; public class MicroFile { diff -Nru altos-1.3/micropeak/MicroFileChooser.java altos-1.3.1/micropeak/MicroFileChooser.java --- altos-1.3/micropeak/MicroFileChooser.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/micropeak/MicroFileChooser.java 2014-01-23 03:53:03.000000000 +0000 @@ -20,7 +20,7 @@ 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 { diff -Nru altos-1.3/micropeak/MicroGraph.java altos-1.3.1/micropeak/MicroGraph.java --- altos-1.3/micropeak/MicroGraph.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/micropeak/MicroGraph.java 2014-01-23 03:53:03.000000000 +0000 @@ -22,7 +22,7 @@ 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.*; diff -Nru altos-1.3/micropeak/MicroPeak.java altos-1.3.1/micropeak/MicroPeak.java --- altos-1.3/micropeak/MicroPeak.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/micropeak/MicroPeak.java 2014-01-23 03:53:03.000000000 +0000 @@ -23,7 +23,7 @@ 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 { diff -Nru altos-1.3/micropeak/MicroRaw.java altos-1.3.1/micropeak/MicroRaw.java --- altos-1.3/micropeak/MicroRaw.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/micropeak/MicroRaw.java 2014-01-23 03:53:03.000000000 +0000 @@ -20,7 +20,7 @@ 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 { diff -Nru altos-1.3/micropeak/MicroSave.java altos-1.3.1/micropeak/MicroSave.java --- altos-1.3/micropeak/MicroSave.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/micropeak/MicroSave.java 2014-01-23 03:53:03.000000000 +0000 @@ -24,7 +24,7 @@ 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 { diff -Nru altos-1.3/micropeak/MicroStats.java altos-1.3.1/micropeak/MicroStats.java --- altos-1.3/micropeak/MicroStats.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/micropeak/MicroStats.java 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/micropeak/MicroStatsTable.java altos-1.3.1/micropeak/MicroStatsTable.java --- altos-1.3/micropeak/MicroStatsTable.java 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/micropeak/MicroStatsTable.java 2014-01-23 03:53:03.000000000 +0000 @@ -19,7 +19,7 @@ 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 { diff -Nru altos-1.3/src/aes/ao_aes.c altos-1.3.1/src/aes/ao_aes.c --- altos-1.3/src/aes/ao_aes.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/aes/ao_aes.c 2014-01-23 03:53:03.000000000 +0000 @@ -367,6 +367,7 @@ void ao_aes_set_mode(enum ao_aes_mode mode) { + (void) mode; /* we only do CBC_MAC anyways... */ } diff -Nru altos-1.3/src/core/ao.h altos-1.3.1/src/core/ao.h --- altos-1.3/src/core/ao.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao.h 2014-01-23 03:53:03.000000000 +0000 @@ -307,6 +307,17 @@ #include #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 diff -Nru altos-1.3/src/core/ao_config.c altos-1.3.1/src/core/ao_config.c --- altos-1.3/src/core/ao_config.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_config.c 2014-01-23 03:53:03.000000000 +0000 @@ -353,9 +353,9 @@ { 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_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 @@ 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_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 @@ 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 -Nru altos-1.3/src/core/ao_convert_volt.c altos-1.3.1/src/core/ao_convert_volt.c --- altos-1.3/src/core/ao_convert_volt.c 1970-01-01 00:00:00.000000000 +0000 +++ altos-1.3.1/src/core/ao_convert_volt.c 2014-01-23 03:53:03.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright © 2014 Keith Packard + * + * 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); +} + diff -Nru altos-1.3/src/core/ao_data.h altos-1.3.1/src/core/ao_data.h --- altos-1.3/src/core/ao_data.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_data.h 2014-01-23 03:53:03.000000000 +0000 @@ -273,14 +273,16 @@ /* 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 @@ #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 */ diff -Nru altos-1.3/src/core/ao_fec.h altos-1.3.1/src/core/ao_fec.h --- altos-1.3/src/core/ao_fec.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_fec.h 2014-01-23 03:53:03.000000000 +0000 @@ -31,7 +31,7 @@ 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; diff -Nru altos-1.3/src/core/ao_flight.c altos-1.3.1/src/core/ao_flight.c --- altos-1.3/src/core/ao_flight.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_flight.c 2014-01-23 03:53:03.000000000 +0000 @@ -46,7 +46,7 @@ __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_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 @@ #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 @@ #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_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 diff -Nru altos-1.3/src/core/ao_flight.h altos-1.3.1/src/core/ao_flight.h --- altos-1.3/src/core/ao_flight.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_flight.h 2014-01-23 03:53:03.000000000 +0000 @@ -41,7 +41,11 @@ 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 diff -Nru altos-1.3/src/core/ao_gps_report_mega.c altos-1.3.1/src/core/ao_gps_report_mega.c --- altos-1.3/src/core/ao_gps_report_mega.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_gps_report_mega.c 2014-01-23 03:53:03.000000000 +0000 @@ -24,7 +24,6 @@ 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; diff -Nru altos-1.3/src/core/ao_gps_report_metrum.c altos-1.3.1/src/core/ao_gps_report_metrum.c --- altos-1.3/src/core/ao_gps_report_metrum.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_gps_report_metrum.c 2014-01-23 03:53:03.000000000 +0000 @@ -24,9 +24,8 @@ 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 (;;) { diff -Nru altos-1.3/src/core/ao_ignite.c altos-1.3.1/src/core/ao_ignite.c --- altos-1.3/src/core/ao_ignite.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_ignite.c 2014-01-23 03:53:03.000000000 +0000 @@ -114,6 +114,8 @@ 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_delay(AO_IGNITER_FIRE_TIME); AO_IGNITER_SET_MAIN(0); break; + default: + break; } break; } diff -Nru altos-1.3/src/core/ao_kalman.c altos-1.3.1/src/core/ao_kalman.c --- altos-1.3/src/core/ao_kalman.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_kalman.c 2014-01-23 03:53:03.000000000 +0000 @@ -166,7 +166,7 @@ { 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; diff -Nru altos-1.3/src/core/ao_log.c altos-1.3.1/src/core/ao_log.c --- altos-1.3/src/core/ao_log.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_log.c 2014-01-23 03:53:03.000000000 +0000 @@ -196,7 +196,9 @@ 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 diff -Nru altos-1.3/src/core/ao_log_metrum.c altos-1.3.1/src/core/ao_log_metrum.c --- altos-1.3/src/core/ao_log_metrum.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_log_metrum.c 2014-01-23 03:53:03.000000000 +0000 @@ -81,7 +81,6 @@ ao_log(void) { __pdata uint16_t next_sensor, next_other; - uint8_t i; ao_storage_setup(); diff -Nru altos-1.3/src/core/ao_log_mini.c altos-1.3.1/src/core/ao_log_mini.c --- altos-1.3/src/core/ao_log_mini.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_log_mini.c 2014-01-23 03:53:03.000000000 +0000 @@ -78,7 +78,7 @@ void ao_log(void) { - __pdata uint16_t next_sensor, next_other; + __pdata uint16_t next_sensor; ao_storage_setup(); @@ -99,7 +99,7 @@ * 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 */ diff -Nru altos-1.3/src/core/ao_notask.c altos-1.3.1/src/core/ao_notask.c --- altos-1.3/src/core/ao_notask.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_notask.c 2014-01-23 03:53:03.000000000 +0000 @@ -41,5 +41,6 @@ void ao_wakeup(__xdata void *wchan) { + (void) wchan; ao_wchan = 0; } diff -Nru altos-1.3/src/core/ao_pyro.c altos-1.3.1/src/core/ao_pyro.c --- altos-1.3/src/core/ao_pyro.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_pyro.c 2014-01-23 03:53:03.000000000 +0000 @@ -436,7 +436,7 @@ 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; } diff -Nru altos-1.3/src/core/ao_radio_cmac.c altos-1.3.1/src/core/ao_radio_cmac.c --- altos-1.3/src/core/ao_radio_cmac.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_radio_cmac.c 2014-01-23 03:53:03.000000000 +0000 @@ -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) diff -Nru altos-1.3/src/core/ao_sample.c altos-1.3.1/src/core/ao_sample.c --- altos-1.3/src/core/ao_sample.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_sample.c 2014-01-23 03:53:03.000000000 +0000 @@ -92,6 +92,10 @@ 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 @@ * 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 @@ 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 diff -Nru altos-1.3/src/core/ao_telemetry.c altos-1.3.1/src/core/ao_telemetry.c --- altos-1.3/src/core/ao_telemetry.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/core/ao_telemetry.c 2014-01-23 03:53:03.000000000 +0000 @@ -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 @@ { 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 @@ } else time = ao_time(); - bottom: ; } } } diff -Nru altos-1.3/src/drivers/ao_aprs.c altos-1.3.1/src/drivers/ao_aprs.c --- altos-1.3/src/drivers/ao_aprs.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_aprs.c 2014-01-23 03:53:03.000000000 +0000 @@ -144,6 +144,7 @@ #endif #include +#include // Public methods, constants, and data structures for each class. @@ -254,9 +255,9 @@ /// 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 @@ } // 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 @@ int32_t latitude = ao_gps_data.latitude; int32_t longitude = ao_gps_data.longitude; int32_t altitude = ao_gps_data.altitude; - - uint16_t lat_deg; - uint16_t lon_deg; - uint16_t lat_min; - uint16_t lat_frac; - uint16_t lon_min; - uint16_t lon_frac; - - char lat_sign = 'N', lon_sign = 'E'; - - if (latitude < 0) { - lat_sign = 'S'; - latitude = -latitude; - } - - if (longitude < 0) { - lon_sign = 'W'; - longitude = -longitude; - } - - /* 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; + uint8_t *buf; if (altitude < 0) altitude = 0; - 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); + buf = tncBuffer; + *buf++ = '!'; + + /* Symbol table ID */ + *buf++ = '/'; + + latitude = ((uint64_t) 380926 * (900000000 - latitude)) / 10000000; + longitude = ((uint64_t) 190463 * (1800000000 + longitude)) / 10000000; + +#define ALTITUDE_LOG_BASE 0.001998002662673f /* log(1.002) */ + + altitude = logf((float) altitude) * (1/ALTITUDE_LOG_BASE); + + tncCompressInt(buf, latitude, 4); + buf += 4; + tncCompressInt(buf, longitude, 4); + buf += 4; + + /* Symbol code */ + *buf++ = '\''; + + 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 diff -Nru altos-1.3/src/drivers/ao_button.c altos-1.3.1/src/drivers/ao_button.c --- altos-1.3/src/drivers/ao_button.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_button.c 2014-01-23 03:53:03.000000000 +0000 @@ -59,6 +59,7 @@ case 4: return ao_button_value(4); #endif } + return 0; } static void diff -Nru altos-1.3/src/drivers/ao_cc1120.c altos-1.3.1/src/drivers/ao_cc1120.c --- altos-1.3/src/drivers/ao_cc1120.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_cc1120.c 2014-01-23 03:53:03.000000000 +0000 @@ -152,6 +152,7 @@ return in; } +#if 0 static uint8_t ao_radio_fifo_read(uint8_t *data, uint8_t len) { @@ -166,6 +167,7 @@ ao_radio_deselect(); return status; } +#endif static uint8_t ao_radio_fifo_write_start(void) @@ -207,11 +209,13 @@ 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 @@ 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 void ao_radio_setup(void) { - int i; + unsigned int i; ao_radio_strobe(CC1120_SRES); @@ -751,13 +755,11 @@ 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 @@ 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 @@ 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)); diff -Nru altos-1.3/src/drivers/ao_cc115l.c altos-1.3.1/src/drivers/ao_cc115l.c --- altos-1.3/src/drivers/ao_cc115l.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_cc115l.c 2014-01-23 03:53:03.000000000 +0000 @@ -29,8 +29,6 @@ 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 @@ 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 @@ 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_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_deselect(); } +#endif static uint8_t @@ -200,19 +197,23 @@ 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) @@ -233,11 +234,6 @@ } static void -ao_radio_start_tx(void) -{ -} - -static void ao_radio_idle(void) { ao_radio_pa_off(); @@ -401,7 +397,7 @@ 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 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 = 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 @@ 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 @@ ao_radio_send(packet, sizeof (packet)); } -#endif /* CC115L_DEBUG */ #if HAS_APRS #include @@ -926,6 +920,7 @@ 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 @@ 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)); diff -Nru altos-1.3/src/drivers/ao_companion.c altos-1.3.1/src/drivers/ao_companion.c --- altos-1.3/src/drivers/ao_companion.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_companion.c 2014-01-23 03:53:03.000000000 +0000 @@ -67,8 +67,8 @@ 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 diff -Nru altos-1.3/src/drivers/ao_event.c altos-1.3.1/src/drivers/ao_event.c --- altos-1.3/src/drivers/ao_event.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_event.c 2014-01-23 03:53:03.000000000 +0000 @@ -30,7 +30,7 @@ uint8_t ao_event_queue_remove; -uint8_t +void ao_event_get(struct ao_event *ev) { ao_arch_critical( diff -Nru altos-1.3/src/drivers/ao_event.h altos-1.3.1/src/drivers/ao_event.h --- altos-1.3/src/drivers/ao_event.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_event.h 2014-01-23 03:53:03.000000000 +0000 @@ -29,7 +29,7 @@ int32_t value; }; -uint8_t +void ao_event_get(struct ao_event *ev); void diff -Nru altos-1.3/src/drivers/ao_hmc5883.c altos-1.3.1/src/drivers/ao_hmc5883.c --- altos-1.3/src/drivers/ao_hmc5883.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_hmc5883.c 2014-01-23 03:53:03.000000000 +0000 @@ -70,7 +70,6 @@ { 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); diff -Nru altos-1.3/src/drivers/ao_lco_cmd.c altos-1.3.1/src/drivers/ao_lco_cmd.c --- altos-1.3/src/drivers/ao_lco_cmd.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_lco_cmd.c 2014-01-23 03:53:03.000000000 +0000 @@ -119,7 +119,6 @@ static void lco_fire_cmd(void) __reentrant { - static __xdata struct ao_pad_command command; uint8_t secs; uint8_t i; int8_t r; diff -Nru altos-1.3/src/drivers/ao_lco_func.c altos-1.3.1/src/drivers/ao_lco_func.c --- altos-1.3/src/drivers/ao_lco_func.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_lco_func.c 2014-01-23 03:53:03.000000000 +0000 @@ -26,7 +26,6 @@ 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; diff -Nru altos-1.3/src/drivers/ao_mma655x.c altos-1.3.1/src/drivers/ao_mma655x.c --- altos-1.3/src/drivers/ao_mma655x.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_mma655x.c 2014-01-23 03:53:03.000000000 +0000 @@ -20,14 +20,15 @@ #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_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 @@ 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 @@ 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 @@ { 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_stop(); addr &= ~(1 << 6); - PRINTD("write %x %x = %x\n", - addr, value, ao_mma655x_reg_read(addr)); } static uint16_t @@ -131,14 +134,14 @@ (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 @@ 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 @@ (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; +#endif + 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)); + + 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 + */ - 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 - */ + ao_mma655x_reg_write(AO_MMA655X_DEVCFG, + DEVCFG_VALUE | (0 << AO_MMA655X_DEVCFG_ENDINIT)); - ao_mma655x_reg_write(AO_MMA655X_DEVCFG, - DEVCFG_VALUE | (0 << AO_MMA655X_DEVCFG_ENDINIT)); - - /* Test X axis - */ + /* Test X axis + */ - ao_mma655x_reg_write(AO_MMA655X_AXISCFG, - AXISCFG_VALUE | - (1 << AO_MMA655X_AXISCFG_ST)); - a_st = ao_mma655x_value(); - - stdefl = ao_mma655x_reg_read(AO_MMA655X_STDEFL); - - ao_mma655x_reg_write(AO_MMA655X_AXISCFG, - AXISCFG_VALUE | - (0 << AO_MMA655X_AXISCFG_ST)); - a = 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(); + + st_change = a_st - a; + + 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 @@ serial = lot & 0x1fff; lot >>= 12; pn = ao_mma655x_reg_read(AO_MMA655X_PN); +#endif } uint16_t ao_mma655x_current; @@ -259,8 +283,6 @@ 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)); diff -Nru altos-1.3/src/drivers/ao_mma655x.h altos-1.3.1/src/drivers/ao_mma655x.h --- altos-1.3/src/drivers/ao_mma655x.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_mma655x.h 2014-01-23 03:53:03.000000000 +0000 @@ -78,6 +78,14 @@ #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 diff -Nru altos-1.3/src/drivers/ao_mpu6000.c altos-1.3.1/src/drivers/ao_mpu6000.c --- altos-1.3/src/drivers/ao_mpu6000.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/drivers/ao_mpu6000.c 2014-01-23 03:53:03.000000000 +0000 @@ -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 @@ #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 @@ } 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_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_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_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); + 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; } diff -Nru altos-1.3/src/lpc/Makefile-lpc.defs altos-1.3.1/src/lpc/Makefile-lpc.defs --- altos-1.3/src/lpc/Makefile-lpc.defs 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/lpc/Makefile-lpc.defs 2014-01-23 03:53:03.000000000 +0000 @@ -4,7 +4,7 @@ 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 @@ 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 diff -Nru altos-1.3/src/lpc/ao_adc_lpc.c altos-1.3.1/src/lpc/ao_adc_lpc.c --- altos-1.3/src/lpc/ao_adc_lpc.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/lpc/ao_adc_lpc.c 2014-01-23 03:53:03.000000000 +0000 @@ -149,8 +149,10 @@ 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 diff -Nru altos-1.3/src/lpc/ao_exti_lpc.c altos-1.3.1/src/lpc/ao_exti_lpc.c --- altos-1.3/src/lpc/ao_exti_lpc.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/lpc/ao_exti_lpc.c 2014-01-23 03:53:03.000000000 +0000 @@ -91,7 +91,7 @@ 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(); diff -Nru altos-1.3/src/lpc/ao_spi_lpc.c altos-1.3.1/src/lpc/ao_spi_lpc.c --- altos-1.3/src/lpc/ao_spi_lpc.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/lpc/ao_spi_lpc.c 2014-01-23 03:53:03.000000000 +0000 @@ -21,8 +21,6 @@ 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) diff -Nru altos-1.3/src/lpc/ao_usb_lpc.c altos-1.3.1/src/lpc/ao_usb_lpc.c --- altos-1.3/src/lpc/ao_usb_lpc.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/lpc/ao_usb_lpc.c 2014-01-23 03:53:03.000000000 +0000 @@ -111,7 +111,6 @@ 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 @@ 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 @@ } } -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 @@ /* 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 @@ /* 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); diff -Nru altos-1.3/src/lpc/lpc.h altos-1.3.1/src/lpc/lpc.h --- altos-1.3/src/lpc/lpc.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/lpc/lpc.h 2014-01-23 03:53:03.000000000 +0000 @@ -120,7 +120,7 @@ #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 -Nru altos-1.3/src/math/ef_log.c altos-1.3.1/src/math/ef_log.c --- altos-1.3/src/math/ef_log.c 1970-01-01 00:00:00.000000000 +0000 +++ altos-1.3.1/src/math/ef_log.c 2014-01-23 03:53:03.000000000 +0000 @@ -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); + } +} diff -Nru altos-1.3/src/math/ef_rem_pio2.c altos-1.3.1/src/math/ef_rem_pio2.c --- altos-1.3/src/math/ef_rem_pio2.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/math/ef_rem_pio2.c 2014-01-23 03:53:03.000000000 +0000 @@ -142,7 +142,7 @@ 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; diff -Nru altos-1.3/src/math/fdlibm.h altos-1.3.1/src/math/fdlibm.h --- altos-1.3/src/math/fdlibm.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/math/fdlibm.h 2014-01-23 03:53:03.000000000 +0000 @@ -19,6 +19,7 @@ #define __ieee754_acosf acosf #define __ieee754_sqrtf sqrtf +#define __ieee754_logf logf /* REDHAT LOCAL: Include files. */ #include diff -Nru altos-1.3/src/math/math.h altos-1.3.1/src/math/math.h --- altos-1.3/src/math/math.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/math/math.h 2014-01-23 03:53:03.000000000 +0000 @@ -34,4 +34,6 @@ float copysignf(float x, float y); +float logf(float x); + #endif diff -Nru altos-1.3/src/product/ao_flash_task.c altos-1.3.1/src/product/ao_flash_task.c --- altos-1.3/src/product/ao_flash_task.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/product/ao_flash_task.c 2014-01-23 03:53:03.000000000 +0000 @@ -24,6 +24,7 @@ void ao_panic(uint8_t reason) { + (void) reason; } void diff -Nru altos-1.3/src/stm/Makefile.defs altos-1.3.1/src/stm/Makefile.defs --- altos-1.3/src/stm/Makefile.defs 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/stm/Makefile.defs 2014-01-23 03:53:03.000000000 +0000 @@ -24,8 +24,11 @@ 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 diff -Nru altos-1.3/src/stm/ao_adc_stm.c altos-1.3.1/src/stm/ao_adc_stm.c --- altos-1.3/src/stm/ao_adc_stm.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/stm/ao_adc_stm.c 2014-01-23 03:53:03.000000000 +0000 @@ -41,6 +41,7 @@ */ 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 @@ 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 diff -Nru altos-1.3/src/stm/ao_arch.h altos-1.3.1/src/stm/ao_arch.h --- altos-1.3/src/stm/ao_arch.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/stm/ao_arch.h 2014-01-23 03:53:03.000000000 +0000 @@ -135,6 +135,9 @@ 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 diff -Nru altos-1.3/src/stm/ao_exti_stm.c altos-1.3.1/src/stm/ao_exti_stm.c --- altos-1.3/src/stm/ao_exti_stm.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/stm/ao_exti_stm.c 2014-01-23 03:53:03.000000000 +0000 @@ -119,6 +119,8 @@ 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 @@ 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 @@ 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; } diff -Nru altos-1.3/src/stm/ao_i2c_stm.c altos-1.3.1/src/stm/ao_i2c_stm.c --- altos-1.3/src/stm/ao_i2c_stm.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/stm/ao_i2c_stm.c 2014-01-23 03:53:03.000000000 +0000 @@ -185,7 +185,6 @@ 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 @@ 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 @@ 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) diff -Nru altos-1.3/src/stm/ao_lcd_stm.c altos-1.3.1/src/stm/ao_lcd_stm.c --- altos-1.3/src/stm/ao_lcd_stm.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/stm/ao_lcd_stm.c 2014-01-23 03:53:03.000000000 +0000 @@ -346,8 +346,7 @@ 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) | diff -Nru altos-1.3/src/stm/ao_profile.h altos-1.3.1/src/stm/ao_profile.h --- altos-1.3/src/stm/ao_profile.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/stm/ao_profile.h 2014-01-23 03:53:03.000000000 +0000 @@ -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 { diff -Nru altos-1.3/src/stm/ao_spi_stm_slave.c altos-1.3.1/src/stm/ao_spi_stm_slave.c --- altos-1.3/src/stm/ao_spi_stm_slave.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/stm/ao_spi_stm_slave.c 2014-01-23 03:53:03.000000000 +0000 @@ -97,7 +97,6 @@ ao_dma_done_transfer(miso_dma_index); } - uint8_t ao_spi_slave_recv(void *block, uint16_t len) { @@ -153,6 +152,7 @@ ao_dma_done_transfer(mosi_dma_index); ao_dma_done_transfer(miso_dma_index); + return 1; } static void diff -Nru altos-1.3/src/stm/ao_usb_stm.c altos-1.3.1/src/stm/ao_usb_stm.c --- altos-1.3/src/stm/ao_usb_stm.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/stm/ao_usb_stm.c 2014-01-23 03:53:03.000000000 +0000 @@ -119,7 +119,6 @@ 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 @@ static void ao_usb_set_ep0(void) { - uint32_t epr; int e; ao_usb_sram_addr = 0; @@ -356,8 +354,6 @@ static void ao_usb_set_configuration(void) { - uint32_t epr; - debug ("ao_usb_set_configuration\n"); /* Set up the INT end point */ diff -Nru altos-1.3/src/stm/stm32l.h altos-1.3.1/src/stm/stm32l.h --- altos-1.3/src/stm/stm32l.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/stm/stm32l.h 2014-01-23 03:53:03.000000000 +0000 @@ -52,7 +52,7 @@ 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 @@ 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 @@ 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; } diff -Nru altos-1.3/src/telegps-v0.3/Makefile altos-1.3.1/src/telegps-v0.3/Makefile --- altos-1.3/src/telegps-v0.3/Makefile 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/telegps-v0.3/Makefile 2014-01-23 03:53:03.000000000 +0000 @@ -19,6 +19,9 @@ Makefile +MATH_SRC=\ + ef_log.c + ALTOS_SRC = \ ao_interrupt.c \ ao_boot_chain.c \ @@ -47,6 +50,7 @@ ao_log.c \ ao_log_mega.c \ ao_gps_report_mega.c \ + $(MATH_SRC) \ $(SAMPLE_PROFILE) PRODUCT=TeleGPS-v0.3 diff -Nru altos-1.3/src/telelco-v0.2/ao_lco.c altos-1.3.1/src/telelco-v0.2/ao_lco.c --- altos-1.3/src/telelco-v0.2/ao_lco.c 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/telelco-v0.2/ao_lco.c 2014-01-23 03:53:03.000000000 +0000 @@ -37,7 +37,6 @@ #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 @@ 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); diff -Nru altos-1.3/src/telemega-v0.1/Makefile altos-1.3.1/src/telemega-v0.1/Makefile --- altos-1.3/src/telemega-v0.1/Makefile 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/telemega-v0.1/Makefile 2014-01-23 03:53:03.000000000 +0000 @@ -58,7 +58,8 @@ 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 @@ 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 \ diff -Nru altos-1.3/src/telemega-v0.1/ao_pins.h altos-1.3.1/src/telemega-v0.1/ao_pins.h --- altos-1.3/src/telemega-v0.1/ao_pins.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/telemega-v0.1/ao_pins.h 2014-01-23 03:53:03.000000000 +0000 @@ -250,6 +250,23 @@ #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 */ #define HAS_MS5607 1 diff -Nru altos-1.3/src/telemega-v1.0/Makefile altos-1.3.1/src/telemega-v1.0/Makefile --- altos-1.3/src/telemega-v1.0/Makefile 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/telemega-v1.0/Makefile 2014-01-23 03:53:03.000000000 +0000 @@ -59,7 +59,8 @@ 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 @@ 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 \ diff -Nru altos-1.3/src/telemega-v1.0/ao_pins.h altos-1.3.1/src/telemega-v1.0/ao_pins.h --- altos-1.3/src/telemega-v1.0/ao_pins.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/telemega-v1.0/ao_pins.h 2014-01-23 03:53:03.000000000 +0000 @@ -250,6 +250,23 @@ #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 */ #define HAS_MS5607 1 diff -Nru altos-1.3/src/telemetrum-v2.0/Makefile altos-1.3.1/src/telemetrum-v2.0/Makefile --- altos-1.3/src/telemetrum-v2.0/Makefile 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/telemetrum-v2.0/Makefile 2014-01-23 03:53:03.000000000 +0000 @@ -37,6 +37,9 @@ #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 @@ 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 @@ ao_packet.c \ ao_companion.c \ ao_aprs.c \ + $(MATH_SRC) \ $(PROFILE) \ $(SAMPLE_PROFILE) \ $(STACK_GUARD) diff -Nru altos-1.3/src/telemetrum-v2.0/ao_pins.h altos-1.3.1/src/telemetrum-v2.0/ao_pins.h --- altos-1.3/src/telemetrum-v2.0/ao_pins.h 2013-12-19 09:00:10.000000000 +0000 +++ altos-1.3.1/src/telemetrum-v2.0/ao_pins.h 2014-01-23 03:53:03.000000000 +0000 @@ -190,6 +190,23 @@ #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 */