+commit 200137060651f48c99276c8feb0e15980a9b46be
+Author: Bdale Garbee <bdale@gag.com>
+Date: Wed Jan 22 20:52:09 2014 -0700
+
+ update copyright date on main documentation file
+
+commit 63171339c03cf9bf3d691511889223bf43024124
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Jan 21 23:02:27 2014 -0800
+
+ doc: Update for 1.3.1
+
+ Add 1.3.1 release notes. Update screen shots. Document new functionality
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit e6a73d6cbe149a930f8c4e2dac655bc3f6270013
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Jan 21 23:01:28 2014 -0800
+
+ doc: Fix image widths to make them all scale the same amount
+
+ Hand-compute scale factors so that all images are presented at the
+ same relative size as they would be on the screen.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit e61c02b51e069aa58b36f59b9ca8e7c8284bc93a
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Jan 21 22:13:01 2014 -0800
+
+ altosui: Handle serial-port startup errors in idle-monitor
+
+ Trap exceptions during idle monitor startup and report them.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 42922b40fc695bdaa92e3fb0b41a248f7df918d0
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Jan 21 22:01:39 2014 -0800
+
+ altosui: Handle already-opened link in IgniteUI
+
+ Must run the link open from the UI thread so that we can put up the
+ in-use dialog immdiately; otherwise the UI thread is blocked which
+ means the dialog never appears and the app appears to hang.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit f118e33416e45ea9a2b5ede4157bd8b58ddb6ebb
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Jan 21 21:37:18 2014 -0800
+
+ altosuilib: Remove some spurious debug printfs
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 677fcafd3816b6d8d86b2dc41b840d97b5ccbf07
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Jan 21 21:34:58 2014 -0800
+
+ altoslib: Fetch target device config for Fire Igniter npyro value
+
+ The code was using the AltosLink config_data, which is always the
+ locally connected device's configuration. When using the packet link,
+ that's not terribly useful when asking how many extra pyro channels
+ are available.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 13cf4000bd53ac4af66231d56e24c9eb11178a5f
+Merge: 7a8551f 99fedbf
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Jan 21 20:59:06 2014 -0800
+
+ Merge remote-tracking branch 'origin/master'
+
+commit 99fedbf0ed42a5d4fa80f094576ca0260040ef5e
+Author: Bdale Garbee <bdale@gag.com>
+Date: Tue Jan 21 21:31:25 2014 -0700
+
+ set version to 1.3.1 for release
+
+commit 7a8551fe8e5f0a90cbc494842715a96f08c11900
+Author: Anthony Towns <aj@erisian.com.au>
+Date: Mon Jan 20 19:38:21 2014 +1000
+
+ altosui: rate limit map downloads
+
+commit 0faa098f05d43eefc1fa54462401171fca5034cb
+Author: Anthony Towns <aj@erisian.com.au>
+Date: Mon Jan 20 05:10:58 2014 +1000
+
+ altosui: --fetchmaps gets same number of maps as GUI
+
+commit aab5873c87d6ecfe0854751746f80d4bc7ebeffa
+Author: Anthony Towns <aj@erisian.com.au>
+Date: Mon Jan 20 04:52:43 2014 +1000
+
+ AltosSiteMapPreload: only load 49 maps
+
+ Google Static Maps API limits queries to 50 maps per IP per minute,
+ so querying a 7x7 array instead of a 9x9 array seems more likely to
+ work well.
+
+commit 7f9cda0e2531a7bba7f1b4e3b7212a62b5bec1ed
+Author: Keith Packard <keithp@keithp.com>
+Date: Sun Jan 19 00:17:06 2014 -0800
+
+ altosui: Make romconfig serial and radio cal fields 8 digits wide
+
+ This ensure that they are wide enough to show a cc1120 calibration
+ value, which is 7 digits.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 2b891115c95453d9002d8ef307a27e14eda145a5
+Author: Bdale Garbee <bdale@gag.com>
+Date: Fri Jan 17 20:55:45 2014 -0700
+
+ set version to 1.3.0.2 for test flights this weekend
+
+commit c33ec8207c0e5d4c855e87b2746371b19d437f7d
+Author: Bdale Garbee <bdale@gag.com>
+Date: Fri Jan 17 20:47:16 2014 -0700
+
+ use firmware in /usr/share/altos for production flashing
+
+commit cfcb127b248b62231049b6b50cf9b7edc2731f0a
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Jan 15 13:28:16 2014 -0800
+
+ altos: Add missing ADC divider values for Tmega v1.0
+
+ Somehow I left these out of the previous commit
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 9001d5780a41986017bd3bbc7f8c5556b116c351
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Jan 15 12:42:59 2014 -0800
+
+ Ignore 32 and 64 bit cjnitest apps
+
+commit c743eaa060080a7bd236466b93cff3abc96f405b
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Jan 15 12:40:26 2014 -0800
+
+ altos: Report battery, apogee and main voltages over APRS
+
+ This makes APRS more usable when you mute the RF audio on the HT.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit cc06242e882cba462791962c199b7c89e79adc65
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Jan 14 23:29:59 2014 -0800
+
+ altos: Use factory calibration for all acceleration computations
+
+ The ground acceleration value will vary depending on the tilt angle of
+ the airframe, which will result in incorrect acceleration computations
+ during flight. This also avoids accidental boost detect when moving
+ the airframe around in pad mode.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 9d812b3db418fd9816731b761a0853eb38f5a265
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Jan 14 23:21:40 2014 -0800
+
+ altos: Switch APRS to compressed position format
+
+ This provides lat/lon/alt in fewer bytes while improving precision.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit f560d5063b1339dbfb3e6723cfadb7b4c5eace25
+Author: Keith Packard <keithp@keithp.com>
+Date: Tue Jan 14 23:18:40 2014 -0800
+
+ doc: Ship telemini outline as pdf file too
+
+ Build telemini.pdf from telemini.svg and include it in all of the
+ released packages.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 06ffd8022ff5ac74274c9839d42c0c47274cb8b9
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Jan 1 22:08:13 2014 -0800
+
+ altosui: Require both libaltos32 and libaltos64 for fat Linux tarball
+
+ No sense shipping a broken tarball ever
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 8bff2822c242d2878b408b9c0d8a7647108ea4b1
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Jan 1 22:02:56 2014 -0800
+
+ libaltos: Build -m64 and -m32 for fat tarball when possible
+
+ Check to see if we can compile libaltos for both 32 bit and 64 bit
+ systems, and then use those when generating the linux tarball.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 95d77eaff708397d8b1e29904dc47d8ea09e8754
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Jan 1 22:02:04 2014 -0800
+
+ Bump version to 1.3.9.1
+
+ Lots of new features; let's not release with 1.3 set
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit b15bd24bbe48e338497c6257f5fe2c7fd1cbffbb
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Jan 1 22:00:24 2014 -0800
+
+ altosui: Handle a missing libaltos when starting up
+
+ Skip a null list of devices when figuring out what to open monitor
+ windows for during startup.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit c35ea586b9e792c45b287924fd256928308d9a36
+Author: Keith Packard <keithp@keithp.com>
+Date: Wed Jan 1 21:12:20 2014 -0800
+
+ altos: Flip acceleration data consistently for orientation changes
+
+ Must flip the acceleration calibration data using the same function as
+ flipping the actual acceleration data or the calibration will no
+ longer be valid after changing orientation. For the MMA655x, this
+ means using 4095 in both places, rather than using 0x7fff for the
+ calibration data changes and 4095 for the data value changes. For the
+ MPU6000, this means using 0 in both places.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit afc16e805145c3e9ab4ba948f9ab1d9aa2b27afb
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Dec 28 10:18:53 2013 -0800
+
+ altos: Add 'O' command for TeleMega orient testing
+
+ Only present when HAS_FLIGHT_DEBUG is enabled, this command lets the
+ user check the orientation tracking code by showing the current
+ orientation and when the calibration values are reset.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 9877f6b880a0e89fbfbf1a39ded94bdc1891f3d9
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Dec 28 10:17:37 2013 -0800
+
+ altosui: Switch Graph to AltosOrient type
+
+ The graph was using a private class for orient type, use the altoslib one
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit aa01f06acfbf029958a55f68175b6868817b333f
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Dec 28 10:16:24 2013 -0800
+
+ altosui: Adjust info table column width
+
+ Make sure the info table can show a full longitude value
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit bbc4940730e6b431f1b9ccd9bbaf9faa0ffb2b1f
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Dec 28 10:15:26 2013 -0800
+
+ altosui: Add orient to ascent and info table views
+
+ This adds 'tilt angle' to both ascent and info table views
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 053d092b3dca4ebb98e97ec0fe24f5f5e1c31f88
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Dec 28 10:13:05 2013 -0800
+
+ altoslib: Add AltosOrient class and max_orient()
+
+ This adds the class necessary to put orient into a UI.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 081455dcba860f3e4df8cd66f3fe686b204034ad
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Dec 21 08:56:00 2013 -0800
+
+ altosui: Extend Fire Igniter to additional channels
+
+ This lets the UI test fire other pyro channels on TeleMega
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 9cf9a67f937185c0c0bb5b2bae4f420755965799
+Author: Keith Packard <keithp@keithp.com>
+Date: Sat Dec 21 06:46:46 2013 -0800
+
+ altosui: Switch from radio buttons to check boxes in pyro config. Add close
+
+ First of (we hope) many review comments from Troj.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 9289200ccb661b10ff892760ecbc752c7745de6b
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 23:04:43 2013 -0800
+
+ altos: Turn on -Werror for STM and LPC builds
+
+ Now that the build completes with no warnings, make future warnings
+ into errors.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 16b37b49985daf21ebb93b3d6ae64af67533be22
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 23:02:51 2013 -0800
+
+ altos: Turn on warnings for LPC products too
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit f578d9455eec9ea0eccd2d5e21349e274ea4281a
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 23:02:21 2013 -0800
+
+ altos/lpc: Missing */ in definition of PIO0_4
+
+ Would maek using these values pretty hard.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 14790172e02d4e1624c35797f87ffd94345d54ff
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 23:00:43 2013 -0800
+
+ altos: lpc exti setup was incorrectly testing mode
+
+ Check for NOCONFIGURE bit was missing parens
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 48f996a9d65631238b4de446530f31f83acb99f5
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 22:59:42 2013 -0800
+
+ altos: cc115l driver tone_run wasn't recording number of tones
+
+ This would prevent the cc115l driver from ever sending tones.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit e11fcc299f4a1a0461a3442ca13f8984d76c30ff
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 22:58:10 2013 -0800
+
+ altos: Clean up warnings for LPC products
+
+ Unused varibles, functions and parameters.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 4ed108fb86676daea17264d7159c2cff9ea7a6e4
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 22:45:56 2013 -0800
+
+ altos/stm: Turn on -Wextra
+
+ All of the warnings for STM projects are cleaned up now
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 1406a5b0721a135913a9801e9eea9e91f0a536b4
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 22:45:01 2013 -0800
+
+ altos: Add default button return value from ao_button_get
+
+ This "can't" happen, but it's not unreasonable to have a default
+ return value.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 316d898715746a379068ac8511692bdb9da14b39
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 22:44:20 2013 -0800
+
+ altos: unsigned value in ao_pyro_set checked for negative value
+
+ No sense checking unsigned values for less than zero.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 5c9172ba5681ff93d63c9c263a453d0025170045
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 22:43:18 2013 -0800
+
+ altos: Clean up -Wextra warnings
+
+ Unused variables, mismatching signed/unsigned and a few other misc
+ warnings.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit db8f3426ac1cf756a2e4974ca61a5ae9048c80ce
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 22:21:23 2013 -0800
+
+ altos: Turn on -Wall for stm compiles
+
+ The warnings are all cleaned up now, leave this on by default
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit b31b4622d5bd92c0cc0851818f5b595dbdb60ead
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 22:15:25 2013 -0800
+
+ altos: Clean up some minor warnings from -Wall
+
+ Unused variables, functions and labels, missing enums in switch.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 755082d36231c1b247bc0e1f13919dd9b5c362a8
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 22:13:32 2013 -0800
+
+ altos: mma655x also needs ao_sensor_errors
+
+ TeleMetrum has an MMA655X but no IMU, so it needs an explicit addition
+ for sensor errors.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 758acb92cccbe4b64a35a1883b42713738c90630
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 22:08:11 2013 -0800
+
+ altos: Complain about sensor self-test errors only in idle mode
+
+ When the accelerometer says to go into pad mode, don't look for other
+ sensor self test errors. Only look for sensor self test errors to
+ choose between idle and invalid mode. This will prevent minor sensor
+ self test errors from letting the rocket fly safely.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit c8b27410e45cc3d80ad4b896bffe70e9aec5e3aa
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 22:06:52 2013 -0800
+
+ altos: 3-axis accel calibration was invalid in explicit accel cal mode
+
+ When explicit Z-axis accel calibration values were provided to the 'c
+ a' command, the 3-axis accelerometer calibration values would get set
+ to uninitialized values. Not so helpful.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 2a912dcde191e2f750845c464611641a5abdc28a
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 22:04:53 2013 -0800
+
+ altos: Execute self-test on MMA655X part
+
+ This doesn't check for fine calibration, just makes sure the part is
+ within the broad tolerances specified by the manufacturer. The subtle fix
+ here was actually getting reset working -- there was a typo in the
+ bitpattern definition which caused the reset to fail, making it hard
+ to self-test the part, as self-test is only valid before the part is running.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit b89fb51a963635e2effe3a31f803bfc29c2c46b7
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 19:44:38 2013 -0800
+
+ altoslib: Bump library version
+
+ Prepare for next release by making sure we notice that the API/ABI for
+ this library has changed.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 8e5f3b922100f9de54b9650df14749e81b1a6562
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 19:40:31 2013 -0800
+
+ altosui: Add imu and mag sensor values to plots
+
+ Makes for a lot of potential graph elements.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit f65880cf5bfcba5005c32db2b300448e585f3e45
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 19:39:40 2013 -0800
+
+ altosuilib: Rearrange graph enable buttons
+
+ Eliminate separate 'enable' radio button, provide for multiple columns
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 796cb90e3241103f79ae12565cf6f0dad21cb57c
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 19:38:29 2013 -0800
+
+ altoslib: Fetch 'orient' value from Mega Sensor packet
+
+ The mega sensor packet had a spare byte to hold the current
+ orientation value.
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 91bcfae2e64ecb2e7de1292b264910382b635aea
+Author: Keith Packard <keithp@keithp.com>
+Date: Fri Dec 20 19:37:08 2013 -0800
+
+ altoslib: Convert IMU and Mag sensor values to useful units
+
+ Convert from raw sensor values to metric units
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 2ad31bad20b20615e9d8b29088e2488fddc81ac9
+Author: Mike Beattie <mike@ethernal.org>
+Date: Fri Dec 20 15:06:37 2013 +1300
+
+ altosdroid: improve build system dependencies
+
+ Signed-off-by: Mike Beattie <mike@ethernal.org>
+
+commit 0e3b3ce66035e8a90fd708d9a4bc01370174c9eb
+Author: Mike Beattie <mike@ethernal.org>
+Date: Fri Dec 20 15:06:07 2013 +1300
+
+ altosdroid: update to latest google play services
+
+ Signed-off-by: Mike Beattie <mike@ethernal.org>
+
+commit 96f2ae5fc0d3bf88704d2ae1b4df5dc6aefc523b
+Author: Mike Beattie <mike@ethernal.org>
+Date: Fri Dec 20 15:05:42 2013 +1300
+
+ altosdroid: force older jarsigner signing algorithm for java 1.7
+
+ (increment versionCode, re-upload to Play Store)
+
+ Signed-off-by: Mike Beattie <mike@ethernal.org>
+
+commit ac12e77e3dffc9e9ddb1578a38b32783ad64e940
+Author: Bdale Garbee <bdale@gag.com>
+Date: Thu Dec 19 03:22:21 2013 -0700
+
+ updated notes from 1.3 release
+
+commit 27528961457865acc3a38b822268df6d7cb86cfd
+Merge: 4006eff a31629d
+Author: Bdale Garbee <bdale@gag.com>
+Date: Thu Dec 19 02:00:10 2013 -0700
+
+ Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
+
+commit 4006effc538289c36a1563c1b717231991292c0c
+Author: Bdale Garbee <bdale@gag.com>
+Date: Thu Dec 19 01:58:24 2013 -0700
+
+ fix missing newline at end of src/test/Makefile
+
+commit a31629dfceb5e9cf1d5c654b8bd87d575f73c34b
+Author: Keith Packard <keithp@keithp.com>
+Date: Thu Dec 19 00:58:50 2013 -0800
+
+ altosui: Ship EasyMini firmware too
+
+ Missing the FIRMWARE_EMINI define left all easy mini firmware out of
+ the distribution
+
+ Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit bc3610d8cecbfed40c62d4dcb93fc9a4d2a7c9e3
+Author: Bdale Garbee <bdale@gag.com>
+Date: Thu Dec 19 01:29:55 2013 -0700
+
+ update ChangeLog from git
+
commit 701c26ed85c28ac59e338975f2a6ba6bd25f6493
Author: Keith Packard <keithp@keithp.com>
Date: Thu Dec 19 00:16:16 2013 -0800
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.altusmetrum.AltosDroid"
- android:versionCode="4"
+ android:versionCode="5"
android:versionName="1.3">
<uses-sdk android:targetSdkVersion="10" android:minSdkVersion="10"/>
<!-- Google Maps -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<permission android:name="org.altusmetrum.AltosDroid.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDSr6u4i9TJmVGhgGk4g0wUUhTy9FGyn0s"/>
+ <meta-data android:name="com.google.android.gms.version"
+ android:value="@integer/google_play_services_version" />
</application>
</manifest>
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 \
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
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
//import android.os.Message;
import android.util.Log;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class AltosBluetooth extends AltosLink {
import android.app.AlertDialog;
import android.location.Location;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class AltosDroid extends FragmentActivity {
// Debugging
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";
package org.altusmetrum.AltosDroid;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import android.location.Location;
public interface AltosDroidTab {
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class AltosVoice {
package org.altusmetrum.AltosDroid;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import android.app.Activity;
import android.os.Bundle;
package org.altusmetrum.AltosDroid;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import android.app.Activity;
import android.os.Bundle;
package org.altusmetrum.AltosDroid;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import android.app.Activity;
import android.os.Bundle;
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;
package org.altusmetrum.AltosDroid;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import android.app.Activity;
import android.os.Bundle;
package org.altusmetrum.AltosDroid;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.util.Log;
import android.os.Handler;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class TelemetryReader extends Thread {
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 {
* 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 {
* 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;
* 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;
* 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.*;
* 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 */
/*
* Sensor data conversion functions
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
public class AltosConvert {
/*
public static AltosTemperature temperature = new AltosTemperature();
+ public static AltosOrient orient = new AltosOrient();
+
public static String show_gs(String format, double a) {
a = meters_to_g(a);
format = format.concat(" g");
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.io.*;
* 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 {
* 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.*;
* 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.*;
* 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.*;
* 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.*;
* 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.*;
* 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.*;
* 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.*;
* 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.*;
* 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.*;
state.set_ms5607(pres(), temp());
AltosIMU imu = new AltosIMU();
- imu.accel_x = accel_x();
- imu.accel_y = accel_y();
- imu.accel_z = accel_z();
+ imu.accel_x = AltosIMU.convert_accel(accel_x());
+ imu.accel_y = AltosIMU.convert_accel(accel_y());
+ imu.accel_z = AltosIMU.convert_accel(accel_z());
- imu.gyro_x = gyro_x();
- imu.gyro_y = gyro_y();
- imu.gyro_z = gyro_z();
+ imu.gyro_x = AltosIMU.convert_gyro(gyro_x());
+ imu.gyro_y = AltosIMU.convert_gyro(gyro_y());
+ imu.gyro_z = AltosIMU.convert_gyro(gyro_z());
state.imu = imu;
AltosMag mag = new AltosMag();
- mag.x = mag_x();
- mag.y = mag_y();
- mag.z = mag_z();
+ mag.x = AltosMag.convert_gauss(mag_x());
+ mag.y = AltosMag.convert_gauss(mag_y());
+ mag.z = AltosMag.convert_gauss(mag_z());
state.mag = mag;
* 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.*;
* 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.*;
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
public interface AltosEepromMonitor {
* 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.*;
* 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.*;
* 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.*;
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.io.*;
* 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);
* 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.*;
* 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;
* 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.*;
* 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;
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.lang.Math;
* 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 {
* 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;
* 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;
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.util.concurrent.*;
public class AltosIMU implements Cloneable {
- public int accel_x;
- public int accel_y;
- public int accel_z;
+ public double accel_x;
+ public double accel_y;
+ public double accel_z;
- public int gyro_x;
- public int gyro_y;
- public int gyro_z;
+ public double gyro_x;
+ public double gyro_y;
+ public double gyro_z;
+
+ public static int counts_per_g = 2048;
+
+ public static double convert_accel(int counts) {
+ return (double) counts / (double) counts_per_g * (-AltosConvert.GRAVITATIONAL_ACCELERATION);
+ }
+
+ public static double counts_per_degsec = 16.4;
+
+ public static double convert_gyro(int counts) {
+ return (double) counts / counts_per_degsec;
+ }
public boolean parse_string(String line) {
if (!line.startsWith("Accel:"))
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;
}
* 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.*;
* 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.*;
* 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.*;
* 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);
* 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.*;
AltosLink link;
boolean remote;
boolean link_started;
+ boolean have_npyro = false;
+ int npyro;
+ AltosConfigData config_data;
- public final static int None = 0;
- public final static int Apogee = 1;
- public final static int Main = 2;
+ public final static String None = null;
+ public final static String Apogee = "drogue";
+ public final static String Main = "main";
public final static int Unknown = 0;
public final static int Ready = 1;
}
*/
- 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"))
return Unknown;
}
- public int status(int igniter) throws InterruptedException, TimeoutException {
- int status = Unknown;
+ private void get_npyro() throws InterruptedException, TimeoutException {
+ if (config_data == null)
+ config_data = new AltosConfigData(link);
+ if (config_data != null)
+ npyro = config_data.npyro;
+ else
+ npyro = 0;
+ have_npyro = true;
+ }
+
+ public int npyro() throws InterruptedException, TimeoutException {
+ if (!have_npyro) {
+ start_link();
+ get_npyro();
+ stop_link();
+ }
+ return npyro;
+ }
+
+ public HashMap<String,Integer> status() throws InterruptedException, TimeoutException {
+ HashMap<String,Integer> status = new HashMap<String,Integer>();
+
if (link == null)
return status;
- //string_ref status_name = new string_ref();
try {
start_link();
+ get_npyro();
+
+ String last_igniter = Main;
+ if (npyro > 0)
+ last_igniter = String.format("%d", npyro - 1);
+
link.printf("t\n");
for (;;) {
String line = link.get_reply(5000);
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();
}
}
- 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();
* 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.*;
* 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;
* 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.*;
* 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;
* 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.*;
* 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")) {
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;
}
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.util.concurrent.*;
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.util.concurrent.*;
* 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) {
--- /dev/null
+/*
+ * Copyright © 2013 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+package org.altusmetrum.altoslib_3;
+
+public class AltosOrient extends AltosUnits {
+
+ public double value(double p, boolean imperial_units) {
+ return p;
+ }
+
+ public double inverse(double p, boolean imperial_units) {
+ return p;
+ }
+
+ public String show_units(boolean imperial_units) {
+ return "°";
+ }
+
+ public String say_units(boolean imperial_units) {
+ return "degrees";
+ }
+
+ public int show_fraction(int width, boolean imperial_units) {
+ return 0;
+ }
+}
\ No newline at end of file
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.text.*;
* 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.*;
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.io.File;
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.io.*;
* 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.*;
* 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.*;
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.io.*;
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.io.*;
* 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;
* 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;
* 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;
* 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;
* 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;
* 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;
* 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 {
* Track flight state from telemetry or eeprom data stream
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
public class AltosState implements Cloneable {
return acceleration.max();
}
+ public AltosValue orient;
+
+ public void set_orient(double new_orient) {
+ orient.set(new_orient, time);
+ }
+
+ public double orient() {
+ return orient.value();
+ }
+
+ public double max_orient() {
+ return orient.max();
+ }
+
public AltosValue kalman_height, kalman_speed, kalman_acceleration;
public void set_kalman(double height, double speed, double acceleration) {
pressure = new AltosPressure();
speed = new AltosSpeed();
acceleration = new AltosAccel();
+ orient = new AltosValue();
temperature = AltosLib.MISSING;
battery_voltage = AltosLib.MISSING;
pressure.finish_update();
speed.finish_update();
acceleration.finish_update();
+ orient.finish_update();
kalman_height.finish_update();
kalman_speed.finish_update();
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;
}
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)
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) {
}
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) {
* 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.*;
* 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;
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.text.*;
* 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 {
* 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.*;
* 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.*;
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
import java.text.*;
* 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 {
* 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;
* 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;
* 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;
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);
state.set_pressure(pres);
state.set_temperature(temp / 100.0);
+ state.set_orient(orient);
+
AltosIMU imu = new AltosIMU();
- imu.accel_x = accel_x;
- imu.accel_y = accel_y;
- imu.accel_z = accel_z;
+ imu.accel_x = AltosIMU.convert_accel(accel_x);
+ imu.accel_y = AltosIMU.convert_accel(accel_y);
+ imu.accel_z = AltosIMU.convert_accel(accel_z);
- imu.gyro_x = gyro_x;
- imu.gyro_y = gyro_y;
- imu.gyro_z = gyro_z;
+ imu.gyro_x = AltosIMU.convert_gyro(gyro_x);
+ imu.gyro_y = AltosIMU.convert_gyro(gyro_y);
+ imu.gyro_z = AltosIMU.convert_gyro(gyro_z);
state.imu = imu;
AltosMag mag = new AltosMag();
- mag.x = mag_x;
- mag.y = mag_y;
- mag.z = mag_z;
+ mag.x = AltosMag.convert_gauss(mag_x);
+ mag.y = AltosMag.convert_gauss(mag_y);
+ mag.z = AltosMag.convert_gauss(mag_z);
state.mag = mag;
}
* 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 {
* 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 {
* 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 {
* 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) {
* 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.*;
* 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;
* 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 {
* 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;
* 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 {
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_3;
public abstract class AltosUnits {
* 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);
AltosMma655x.java \
AltosMs5607.java \
AltosNoSymbol.java \
+ AltosOrient.java \
AltosParse.java \
AltosPreferences.java \
AltosPreferencesBackend.java \
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 {
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;
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) {
height.reset();
speed.reset();
accel.reset();
+ orient.reset();
}
public void set_font() {
height.set_font();
speed.set_font();
accel.set_font();
+ orient.set_font();
}
public void show(AltosState state, AltosListenerState listener_state) {
apogee.hide();
speed.show(state, listener_state);
accel.show(state, listener_state);
+ orient.show(state, listener_state);
}
public void labels(GridBagLayout layout, int y) {
* 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++);
}
}
package altosui;
import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import org.altusmetrum.altosuilib_1.*;
public class AltosBTKnown implements Iterable<AltosBTDevice> {
import java.io.*;
import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class AltosCSV implements AltosWriter {
File name;
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
import java.awt.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class AltosCompanionInfo extends JTable {
private AltosFlightInfoTableModel model;
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 {
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 {
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;
class PyroItem implements ItemListener, DocumentListener, AltosUnitsListener
{
public int flag;
- public JRadioButton enable;
+ public JCheckBox enable;
public JTextField value;
public JComboBox combo;
AltosConfigPyroUI ui;
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);
}
}
+ /* 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);
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);
}
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 {
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
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
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 {
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;
import javax.swing.*;
import java.io.*;
import java.text.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class AltosDisplayThread extends Thread {
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;
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 {
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;
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 {
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
package altosui;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public interface AltosFlightDisplay {
void reset();
package altosui;
import java.io.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class AltosFlightStats {
double max_height;
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;
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;
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) {
import java.awt.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class AltosFlightStatsTable extends JComponent {
GridBagLayout layout;
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;
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 = {
package altosui;
import java.awt.event.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class AltosFlightStatusUpdate implements ActionListener {
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 {
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 {
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.*;
}
}
+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);
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);
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,
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
package altosui;
import org.altusmetrum.altosuilib_1.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class AltosGraphDataPoint implements AltosUIDataPoint {
public static final int data_range = 13;
public static final int data_distance = 14;
public static final int data_pressure = 15;
+ public static final int data_accel_x = 16;
+ public static final int data_accel_y = 17;
+ public static final int data_accel_z = 18;
+ public static final int data_gyro_x = 19;
+ public static final int data_gyro_y = 20;
+ public static final int data_gyro_z = 21;
+ public static final int data_mag_x = 22;
+ public static final int data_mag_y = 23;
+ public static final int data_mag_z = 24;
+ public static final int data_orient = 25;
public double x() throws AltosUIDataMissing {
double time = state.time_since_boost();
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);
import java.lang.*;
import java.io.*;
import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import org.altusmetrum.altosuilib_1.*;
class AltosGraphIterator implements Iterator<AltosUIDataPoint> {
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;
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 {
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;
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());
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);
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
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;
LinkedBlockingQueue<String> command_queue;
+ LinkedBlockingQueue<String> reply_queue;
+
+ class Igniter {
+ JRadioButton button;
+ JLabel status_label;
+ String name;
+ int status;
+
+ void set_status (int status) {
+ this.status = status;
+ status_label.setText(String.format("\"%s\"", AltosIgnite.status_string(status)));
+ }
+
+ Igniter(AltosIgniteUI ui, String label, String name, int y) {
+ Container pane = getContentPane();
+ GridBagConstraints c = new GridBagConstraints();
+ Insets i = new Insets(4,4,4,4);
+
+ this.name = name;
+ this.status = AltosIgnite.Unknown;
+
+ c.gridx = 0;
+ c.gridy = y;
+ c.gridwidth = 1;
+ c.anchor = GridBagConstraints.WEST;
+ button = new JRadioButton (label);
+ pane.add(button, c);
+ button.addActionListener(ui);
+ button.setActionCommand(name);
+ group.add(button);
+
+ c.gridx = 1;
+ c.gridy = y;
+ c.gridwidth = 1;
+ c.anchor = GridBagConstraints.WEST;
+ status_label = new JLabel("plenty of text");
+ pane.add(status_label, c);
+
+ status = AltosIgnite.Unknown;
+ }
+ }
+
+ Igniter igniters[];
+
+ void set_status(String _name, int _status) {
+
+ final String name = _name;
+ final int status = _status;
+ Runnable r = new Runnable() {
+ public void run() {
+ for (int p = 0; p < igniters.length; p++)
+ if (name.equals(igniters[p].name))
+ igniters[p].set_status(status);
+ }
+ };
+ SwingUtilities.invokeLater(r);
+ }
+
class IgniteHandler implements Runnable {
AltosIgnite ignite;
JFrame owner;
+ AltosLink link;
void send_exception(Exception e) {
final Exception f_e = e;
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) {
String reply = null;
if (command.equals("get_status")) {
- apogee_status = ignite.status(AltosIgnite.Apogee);
- main_status = ignite.status(AltosIgnite.Main);
+ HashMap<String,Integer> status_map = ignite.status();
+
+ for (int p = 0; p < igniters.length; p++) {
+ Integer i = status_map.get(igniters[p].name);
+ if (i != null)
+ set_status(igniters[p].name, i);
+ }
reply = "status";
- } else if (command.equals("main")) {
- ignite.fire(AltosIgnite.Main);
- reply = "fired";
- } else if (command.equals("apogee")) {
- ignite.fire(AltosIgnite.Apogee);
- reply = "fired";
+ } else if (command.equals("get_npyro")) {
+ put_reply(String.format("%d", ignite.npyro()));
+ continue;
} else if (command.equals("quit")) {
ignite.close();
break;
} else {
- throw new ParseException(String.format("invalid command %s", command), 0);
+ ignite.fire(command);
+ reply = "fired";
}
final String f_reply = reply;
r = new Runnable() {
}
}
- public IgniteHandler(JFrame in_owner) {
+ public IgniteHandler(JFrame in_owner, AltosLink in_link) {
owner = in_owner;
+ link = in_link;
}
}
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();
}
}
}
+ 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);
}
}
+ int get_npyro() {
+ send_command("get_npyro");
+ String reply = get_reply();
+ return Integer.parseInt(reply);
+ }
+
boolean firing = false;
void start_fire(String which) {
}
void close() {
- send_command("quit");
- timer.stop();
+ if (opened) {
+ send_command("quit");
+ timer.stop();
+ }
setVisible(false);
dispose();
}
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();
}
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()) {
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 */
private boolean open() {
command_queue = new LinkedBlockingQueue<String>();
+ reply_queue = new LinkedBlockingQueue<String>();
+ opened = false;
device = AltosDeviceUIDialog.show(owner, Altos.product_any);
if (device != null) {
- IgniteHandler handler = new IgniteHandler(owner);
+ try {
+ AltosSerial serial = new AltosSerial(device);
+ serial.set_frame(owner);
+ IgniteHandler handler = new IgniteHandler(owner, serial);
Thread t = new Thread(handler);
t.start();
+ opened = true;
return true;
+ } catch (Exception ex) {
+ ignite_exception(ex);
+ }
}
return false;
}
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);
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");
arm.setEnabled(false);
c.gridx = 1;
- c.gridy = 3;
+ c.gridy = y;
c.gridwidth = 1;
c.anchor = GridBagConstraints.CENTER;
fire = new JButton ("Fire");
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");
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;
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' "));
}
}
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)
package altosui;
import java.io.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class AltosKML implements AltosWriter {
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;
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;
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
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 */
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 */
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 {
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.*;
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 {
}
}
- 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);
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);
}
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;
}
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);
pane.setLayout(new GridBagLayout());
- map = new AltosSiteMap(4);
+ map = new AltosSiteMap(radius);
c.fill = GridBagConstraints.BOTH;
c.anchor = GridBagConstraints.CENTER;
setLocationRelativeTo(owner);
setVisible(true);
}
-}
\ No newline at end of file
+}
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;
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 {
AltosUI altosui = new AltosUI();
java.util.List<AltosDevice> devices = AltosUSBDevice.list(Altos.product_basestation);
- for (AltosDevice device : devices)
- altosui.telemetry_window(device);
+ if (devices != null)
+ for (AltosDevice device : devices)
+ altosui.telemetry_window(device);
} else {
int process = process_none;
for (int i = 0; i < args.length; i++) {
} 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"))
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 {
package altosui;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public interface AltosWriter {
altosuilib_$(ALTOSUILIB_VERSION).jar
LIBALTOS= \
- libaltos.so \
+ libaltos32.so \
+ libaltos64.so \
libaltos.dylib \
altos.dll
$(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)
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
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/"$@" .
-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
File "../doc/telemetrum-outline.pdf"
File "../doc/telemega-outline.pdf"
File "../doc/easymini-outline.pdf"
+ File "../doc/telemini.pdf"
SectionEnd
Section "Uninstaller"
import java.awt.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import org.jfree.ui.*;
import org.jfree.chart.*;
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.*;
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;
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);
}
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;
/* 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();
}
});
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;
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();
import java.awt.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import org.jfree.ui.*;
import org.jfree.chart.*;
import java.awt.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import org.jfree.ui.*;
import org.jfree.chart.*;
import java.awt.*;
import libaltosJNI.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
public class AltosUILib extends AltosLib {
static public boolean initialized = false;
static public boolean loaded_library = false;
+ static final String[] library_names = { "altos", "altos32", "altos64" };
+
public static boolean load_library() {
if (!initialized) {
- try {
- System.loadLibrary("altos");
- libaltos.altos_init();
- loaded_library = true;
- } catch (UnsatisfiedLinkError e) {
+ for (String name : library_names) {
try {
- System.loadLibrary("altos64");
+ System.loadLibrary(name);
libaltos.altos_init();
loaded_library = true;
- } catch (UnsatisfiedLinkError e2) {
+ break;
+ } catch (UnsatisfiedLinkError e) {
+ System.out.printf("Link error %s\n", e.getMessage());
loaded_library = false;
}
}
import java.awt.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import org.jfree.ui.*;
import org.jfree.chart.*;
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 {
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 {
import java.awt.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import org.jfree.ui.*;
import org.jfree.chart.*;
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
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
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])
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
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}"
doc/altos.pdf
doc/telemetrum-outline.pdf
doc/telemega-outline.pdf
+doc/easymini-outline.pdf
+doc/telemini.pdf
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 \
<surname>Towns</surname>
</author>
<copyright>
- <year>2013</year>
+ <year>2014</year>
<holder>Bdale Garbee and Keith Packard</holder>
</copyright>
<legalnotice>
</para>
</legalnotice>
<revhistory>
+ <revision>
+ <revnumber>1.3.1</revnumber>
+ <date>21 January 2014</date>
+ <revremark>
+ Bug fixes for TeleMega and TeleMetrum v2.0 along with a few
+ small UI improvements.
+ </revremark>
+ </revision>
<revision>
<revnumber>1.3</revnumber>
<date>12 November 2013</date>
<informalfigure>
<mediaobject>
<imageobject>
- <imagedata fileref="altosui.png" width="5.5in"/>
+ <imagedata fileref="altosui.png" width="4.6in"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
- <imagedata fileref="device-selection.png" width="3.5in"/>
+ <imagedata fileref="device-selection.png" width="3.1in"/>
</imageobject>
</mediaobject>
</informalfigure>
rocket as it heads towards apogee.
</para>
<para>
- The height, speed and acceleration are shown along with the
- maximum values for each of them. This allows you to quickly
- answer the most commonly asked questions you'll hear during
- flight.
+ The height, speed, acceleration and tilt are shown along
+ with the maximum values for each of them. This allows you to
+ quickly answer the most commonly asked questions you'll hear
+ during flight.
</para>
<para>
The current latitude and longitude reported by the GPS are
<informalfigure>
<mediaobject>
<imageobject>
- <imagedata fileref="graph.png" width="5.5in" scalefit="1"/>
+ <imagedata fileref="graph.png" width="6in" scalefit="1"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
- <imagedata fileref="graph-configure.png" width="5.5in" scalefit="1"/>
+ <imagedata fileref="graph-configure.png" width="6in" scalefit="1"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
- <imagedata fileref="graph-stats.png" width="5.5in" scalefit="1"/>
+ <imagedata fileref="graph-stats.png" width="6in" scalefit="1"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
- <imagedata fileref="graph-map.png" width="5.5in" scalefit="1"/>
+ <imagedata fileref="graph-map.png" width="6in" scalefit="1"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
- <imagedata fileref="configure-altimeter.png" width="3in" scalefit="1"/>
+ <imagedata fileref="configure-altimeter.png" width="3.6in" scalefit="1"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
- <imagedata fileref="configure-altosui.png" width="2.5in" scalefit="1"/>
+ <imagedata fileref="configure-altosui.png" width="2.4in" scalefit="1"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
- <imagedata fileref="configure-groundstation.png" width="3in" scalefit="1"/>
+ <imagedata fileref="configure-groundstation.png" width="3.1in" scalefit="1"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
- <imagedata fileref="fire-igniter.png" width="1in" scalefit="1"/>
+ <imagedata fileref="fire-igniter.png" width="1.2in" scalefit="1"/>
</imageobject>
</mediaobject>
</informalfigure>
<para>
Selecting the 'Fire Igniter' button brings up the usual device
selection dialog. Pick the desired device. This brings up another
- window which shows the current continuity test status for both
- apogee and main charges.
+ window which shows the current continuity test status for all
+ of the pyro channels.
</para>
<para>
Next, select the desired igniter to fire. This will enable the
<informalfigure>
<mediaobject>
<imageobject>
- <imagedata fileref="scan-channels.png" width="2.75in" scalefit="1"/>
+ <imagedata fileref="scan-channels.png" width="3.2in" scalefit="1"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
- <imagedata fileref="load-maps.png" width="5.5in" scalefit="1"/>
+ <imagedata fileref="load-maps.png" width="5.2in" scalefit="1"/>
</imageobject>
</mediaobject>
</informalfigure>
Then, divide 434.550 MHz by the
measured frequency and multiply by the current radio cal value show
in the 'c s' command. For an unprogrammed board, the default value
- is 1186611. Take the resulting integer and program it using the 'c f'
+ is 1186611 for cc1111 based products and 7119667 for cc1120
+ based products. Take the resulting integer and program it using the 'c f'
command. Testing with the 'C' command again should show a carrier
within a few tens of Hertz of the intended frequency.
As with all 'c' sub-commands, follow this with a 'c w' to write the
- change to the parameter block in the on-board DataFlash chip.
+ change to the configuration memory.
</para>
<para>
Note that the 'reboot' command, which is very useful on the altimeters,
</appendix>
<appendix>
<title>Release Notes</title>
+ <simplesect>
+ <title>Version 1.3.1</title>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="release-notes-1.3.1.xsl"
+ xpointer="xpointer(/article/*)"/>
+ </simplesect>
<simplesect>
<title>Version 1.3</title>
<xi:include
--- /dev/null
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"/usr/share/xml/docbook/schema/dtd/4.5/docbookx.dtd">
+
+<article>
+ <para>
+ Version 1.3.1 is a minor release. It improves support for TeleMega,
+ TeleMetrum v2.0, TeleMini v2.0 and EasyMini.
+ </para>
+ <para>
+ AltOS Firmware Changes
+ <itemizedlist>
+ <listitem>
+ <para>
+ Improve sensor boot code. If sensors fail to self-test, the
+ device will still boot up and check for pad/idle modes. If
+ in idle mode, the device will warn the user with a distinct
+ beep, if in Pad mode, the unit will operate as best it
+ can. Also, the Z-axis accelerometer now uses the factory
+ calibration values instead of re-calibrating on the pad each
+ time. This avoids accidental boost detect when moving the
+ device around while in Pad mode.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Fix antenna-down mode accelerometer configuration. Antenna
+ down mode wasn't working because the accelerometer
+ calibration values were getting re-computed incorrectly in
+ inverted mode.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Improved APRS mode. Now uses compressed position format for
+ smaller data size, improved precision and to include
+ altitude data as well as latitude and longitude. Also added
+ battery and pyro voltage reports in the APRS comment field
+ so you can confirm that the unit is ready for launch.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ AltosUI changes
+ <itemizedlist>
+ <listitem>
+ <para>
+ Display additional TeleMega sensor values in real
+ units. Make all of these values available for
+ plotting. Display TeleMega orientation value in the Ascent
+ and Table tabs.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Support additional TeleMega pyro channels in the Fire
+ Igniter dialog. This lets you do remote testing of all of
+ the channels, rather than just Apogee and Main.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Limit data rate when downloading satellite images from
+ Google to make sure we stay within their limits so that all
+ of the map tiles download successfully.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+</article>
libaltos_wrap.c
libaltosJNI
cjnitest
+cjnitest32
+cjnitest64
libaltos.swig
swig_bindings/
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 \
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
import java.lang.*;
import java.io.*;
import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import org.altusmetrum.altosuilib_1.*;
class MicroIterator implements Iterator<MicroDataPoint> {
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 {
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 {
import java.io.*;
import java.util.*;
-import org.altusmetrum.altoslib_2.*;
+import org.altusmetrum.altoslib_3.*;
import org.altusmetrum.altosuilib_1.*;
public class MicroFile {
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 {
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.*;
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 {
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 {
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 {
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 {
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 {
void
ao_aes_set_mode(enum ao_aes_mode mode)
{
+ (void) mode;
/* we only do CBC_MAC anyways... */
}
#include <ao_serial.h>
#endif
+/*
+ * ao_convert_volt.c
+ *
+ * Convert ADC readings to decivolts
+ */
+
+int16_t
+ao_battery_decivolt(int16_t adc);
+
+int16_t
+ao_ignite_decivolt(int16_t adc);
/*
* ao_spi_slave.c
{
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();
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();
}
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
{
_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();
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
--- /dev/null
+/*
+ * Copyright © 2014 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#include "ao.h"
+
+#define scale(v,p,m) ((int32_t) (v) * (AO_ADC_REFERENCE_DV * ((p) + (m))) / (AO_ADC_MAX * (m)))
+
+int16_t
+ao_battery_decivolt(int16_t adc)
+{
+ return scale(adc, AO_BATTERY_DIV_PLUS, AO_BATTERY_DIV_MINUS);
+}
+
+int16_t
+ao_ignite_decivolt(int16_t adc)
+{
+ return scale(adc, AO_IGNITE_DIV_PLUS, AO_IGNITE_DIV_MINUS);
+}
+
/* 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
#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 */
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;
__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
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)
{
#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 */
#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");
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
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
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;
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 (;;) {
ao_delay(AO_IGNITER_FIRE_TIME);
AO_IGNITER_SET_MAIN(0);
break;
+ default:
+ break;
}
break;
case AO_IGNITE_MODE_MAIN:
ao_delay(AO_IGNITER_FIRE_TIME);
AO_IGNITER_SET_MAIN(0);
break;
+ default:
+ break;
}
break;
}
{
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;
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
ao_log(void)
{
__pdata uint16_t next_sensor, next_other;
- uint8_t i;
ao_storage_setup();
void
ao_log(void)
{
- __pdata uint16_t next_sensor, next_other;
+ __pdata uint16_t next_sensor;
ao_storage_setup();
* 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 */
void
ao_wakeup(__xdata void *wchan)
{
+ (void) wchan;
ao_wchan = 0;
}
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;
}
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)
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)
{
* 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;
}
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
#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
{
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;
}
else
time = ao_time();
- bottom: ;
}
}
}
#endif
#include <ao_aprs.h>
+#include <math.h>
// Public methods, constants, and data structures for each class.
/// 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
} // 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.
*/
int32_t latitude = ao_gps_data.latitude;
int32_t longitude = ao_gps_data.longitude;
int32_t altitude = ao_gps_data.altitude;
+ uint8_t *buf;
+
+ if (altitude < 0)
+ altitude = 0;
+ altitude = (altitude * (int32_t) 10000 + (3048/2)) / (int32_t) 3048;
+
+ buf = tncBuffer;
+ *buf++ = '!';
- uint16_t lat_deg;
- uint16_t lon_deg;
- uint16_t lat_min;
- uint16_t lat_frac;
- uint16_t lon_min;
- uint16_t lon_frac;
+ /* Symbol table ID */
+ *buf++ = '/';
- char lat_sign = 'N', lon_sign = 'E';
+ latitude = ((uint64_t) 380926 * (900000000 - latitude)) / 10000000;
+ longitude = ((uint64_t) 190463 * (1800000000 + longitude)) / 10000000;
- if (latitude < 0) {
- lat_sign = 'S';
- latitude = -latitude;
- }
+#define ALTITUDE_LOG_BASE 0.001998002662673f /* log(1.002) */
- if (longitude < 0) {
- lon_sign = 'W';
- longitude = -longitude;
- }
+ altitude = logf((float) altitude) * (1/ALTITUDE_LOG_BASE);
- /* Round latitude and longitude by 0.005 minutes */
- latitude = latitude + 833;
- if (latitude > 900000000)
- latitude = 900000000;
- longitude = longitude + 833;
- if (longitude > 1800000000)
- longitude = 1800000000;
-
- lat_deg = latitude / 10000000;
- latitude -= lat_deg * 10000000;
- latitude *= 60;
- lat_min = latitude / 10000000;
- latitude -= lat_min * 10000000;
- lat_frac = latitude / 100000;
-
- lon_deg = longitude / 10000000;
- longitude -= lon_deg * 10000000;
- longitude *= 60;
- lon_min = longitude / 10000000;
- longitude -= lon_min * 10000000;
- lon_frac = longitude / 100000;
+ tncCompressInt(buf, latitude, 4);
+ buf += 4;
+ tncCompressInt(buf, longitude, 4);
+ buf += 4;
- if (altitude < 0)
- altitude = 0;
+ /* Symbol code */
+ *buf++ = '\'';
- altitude = (altitude * (int32_t) 10000 + (3048/2)) / (int32_t) 3048;
-
- return sprintf ((char *) tncBuffer, "=%02u%02u.%02u%c\\%03u%02u.%02u%cO /A=%06u\015",
- lat_deg, lat_min, lat_frac, lat_sign,
- lon_deg, lon_min, lon_frac, lon_sign,
- altitude);
+ tncCompressInt(buf, altitude, 2);
+ buf += 2;
+
+ *buf++ = 33 + ((1 << 5) | (2 << 3));
+
+#if HAS_ADC
+ buf += tncComment(buf);
+#else
+ *buf = '\0';
+#endif
+
+ return buf - tncBuffer;
}
static int16_t
case 4: return ao_button_value(4);
#endif
}
+ return 0;
}
static void
return in;
}
+#if 0
static uint8_t
ao_radio_fifo_read(uint8_t *data, uint8_t len)
{
ao_radio_deselect();
return status;
}
+#endif
static uint8_t
ao_radio_fifo_write_start(void)
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)
ao_radio_set_mode(uint16_t new_mode)
{
uint16_t changes;
- int i;
+ unsigned int i;
if (new_mode == ao_radio_mode)
return;
static void
ao_radio_setup(void)
{
- int i;
+ unsigned int i;
ao_radio_strobe(CC1120_SRES);
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);
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) {
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));
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
ao_radio_reg_read(uint8_t addr)
{
uint8_t data[1];
- uint8_t d;
data[0] = ((1 << CC115L_READ) |
(0 << CC115L_BURST) |
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) |
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) |
{
ao_radio_deselect();
}
+#endif
static uint8_t
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)
ao_wakeup(&ao_radio_wake);
}
-static void
-ao_radio_start_tx(void)
-{
-}
-
static void
ao_radio_idle(void)
{
ao_radio_set_mode(uint16_t new_mode)
{
uint16_t changes;
- int i;
+ unsigned int i;
if (new_mode == ao_radio_mode)
return;
static void
ao_radio_setup(void)
{
- int i;
+ unsigned int i;
ao_radio_strobe(CC115L_SRES);
ao_delay(AO_MS_TO_TICKS(10));
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();
}
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;
ao_radio_send(packet, sizeof (packet));
}
-#endif /* CC115L_DEBUG */
#if HAS_APRS
#include <ao_aprs.h>
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" },
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));
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
uint8_t ao_event_queue_remove;
-uint8_t
+void
ao_event_get(struct ao_event *ev)
{
ao_arch_critical(
int32_t value;
};
-uint8_t
+void
ao_event_get(struct ao_event *ev);
void
{
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);
static void
lco_fire_cmd(void) __reentrant
{
- static __xdata struct ao_pad_command command;
uint8_t secs;
uint8_t i;
int8_t r;
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;
#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
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);
}
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)
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];
}
{
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;
ao_mma655x_stop();
addr &= ~(1 << 6);
- PRINTD("write %x %x = %x\n",
- addr, value, ao_mma655x_reg_read(addr));
}
static uint16_t
(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;
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 (\
(0 << AO_MMA655X_AXISCFG_LPF)) /* 100Hz 4-pole filter */
+#define AO_ST_TRIES 10
+#define AO_ST_DELAY AO_MS_TO_TICKS(100)
+
static void
ao_mma655x_setup(void)
{
- uint8_t v;
uint16_t a, a_st;
- uint8_t stdefl;
- uint8_t i;
+ int16_t st_change;
+ int tries;
+ uint8_t devstat;
+#if 0
uint8_t s0, s1, s2, s3;
- uint8_t pn;
uint32_t lot;
- uint16_t serial;
-
-
- if (mma655x_configured)
- return;
- mma655x_configured = 1;
- ao_delay(AO_MS_TO_TICKS(10)); /* Top */
- ao_mma655x_reset();
- ao_delay(AO_MS_TO_TICKS(10)); /* Top */
- (void) ao_mma655x_reg_read(AO_MMA655X_DEVSTAT);
- v = ao_mma655x_reg_read(AO_MMA655X_DEVSTAT);
-
- /* Configure R/W register values.
- * Most of them relate to the arming feature, which
- * we don't use, so the only registers we need to
- * write are DEVCFG and AXISCFG
- */
+#endif
- ao_mma655x_reg_write(AO_MMA655X_DEVCFG,
- DEVCFG_VALUE | (0 << AO_MMA655X_DEVCFG_ENDINIT));
+ for (tries = 0; tries < AO_ST_TRIES; tries++) {
+ ao_delay(AO_MS_TO_TICKS(10));
+ ao_mma655x_reset();
+ ao_delay(AO_MS_TO_TICKS(10));
- /* Test X axis
- */
+ devstat = ao_mma655x_reg_read(AO_MMA655X_DEVSTAT);
+ PRINTD(DEBUG_HIGH, "devstat %x\n", devstat);
+
+ if (!(devstat & (1 << AO_MMA655X_DEVSTAT_DEVRES)))
+ continue;
+
+ /* Configure R/W register values.
+ * Most of them relate to the arming feature, which
+ * we don't use, so the only registers we need to
+ * write are DEVCFG and AXISCFG
+ */
+
+ ao_mma655x_reg_write(AO_MMA655X_DEVCFG,
+ DEVCFG_VALUE | (0 << AO_MMA655X_DEVCFG_ENDINIT));
+
+ /* Test X axis
+ */
- ao_mma655x_reg_write(AO_MMA655X_AXISCFG,
- AXISCFG_VALUE |
- (1 << AO_MMA655X_AXISCFG_ST));
- a_st = ao_mma655x_value();
+ ao_mma655x_reg_write(AO_MMA655X_AXISCFG,
+ AXISCFG_VALUE |
+ (1 << AO_MMA655X_AXISCFG_ST));
+ ao_delay(AO_MS_TO_TICKS(10));
+
+ a_st = ao_mma655x_value();
+
+ ao_mma655x_reg_write(AO_MMA655X_AXISCFG,
+ AXISCFG_VALUE |
+ (0 << AO_MMA655X_AXISCFG_ST));
+
+ ao_delay(AO_MS_TO_TICKS(10));
+
+ a = ao_mma655x_value();
- stdefl = ao_mma655x_reg_read(AO_MMA655X_STDEFL);
+ st_change = a_st - a;
- ao_mma655x_reg_write(AO_MMA655X_AXISCFG,
- AXISCFG_VALUE |
- (0 << AO_MMA655X_AXISCFG_ST));
- a = ao_mma655x_value();
+ PRINTD(DEBUG_HIGH, "self test %d normal %d change %d\n", a_st, a, st_change);
+
+ if (AO_ST_MIN <= st_change && st_change <= AO_ST_MAX)
+ break;
+ ao_delay(AO_ST_DELAY);
+ }
+ if (tries == AO_ST_TRIES)
+ ao_sensor_errors = 1;
ao_mma655x_reg_write(AO_MMA655X_DEVCFG,
DEVCFG_VALUE | (1 << AO_MMA655X_DEVCFG_ENDINIT));
+#if 0
s0 = ao_mma655x_reg_read(AO_MMA655X_SN0);
s1 = ao_mma655x_reg_read(AO_MMA655X_SN1);
s2 = ao_mma655x_reg_read(AO_MMA655X_SN2);
serial = lot & 0x1fff;
lot >>= 12;
pn = ao_mma655x_reg_read(AO_MMA655X_PN);
+#endif
}
uint16_t ao_mma655x_current;
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));
#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
#if HAS_MPU6000
-static uint8_t ao_mpu6000_wake;
static uint8_t ao_mpu6000_configured;
#ifndef AO_MPU6000_I2C_INDEX
#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;
}
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;
ao_delay(AO_MS_TO_TICKS(200));
_ao_mpu6000_sample(&normal_mode);
- errors += ao_mpu6000_accel_check(normal_mode.accel_x, test_mode.accel_x, "x");
- errors += ao_mpu6000_accel_check(normal_mode.accel_y, test_mode.accel_y, "y");
- errors += ao_mpu6000_accel_check(normal_mode.accel_z, test_mode.accel_z, "z");
+ errors += ao_mpu6000_accel_check(normal_mode.accel_x, test_mode.accel_x);
+ errors += ao_mpu6000_accel_check(normal_mode.accel_y, test_mode.accel_y);
+ errors += ao_mpu6000_accel_check(normal_mode.accel_z, test_mode.accel_z);
- errors += ao_mpu6000_gyro_check(normal_mode.gyro_x, test_mode.gyro_x, "x");
- errors += ao_mpu6000_gyro_check(normal_mode.gyro_y, test_mode.gyro_y, "y");
- errors += ao_mpu6000_gyro_check(normal_mode.gyro_z, test_mode.gyro_z, "z");
+ errors += ao_mpu6000_gyro_check(normal_mode.gyro_x, test_mode.gyro_x);
+ errors += ao_mpu6000_gyro_check(normal_mode.gyro_y, test_mode.gyro_y);
+ errors += ao_mpu6000_gyro_check(normal_mode.gyro_z, test_mode.gyro_z);
if (!errors)
break;
}
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
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
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
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();
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)
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
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)
}
}
-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)
/* 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");
/* 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);
#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
--- /dev/null
+/* 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);
+ }
+}
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;
#define __ieee754_acosf acosf
#define __ieee754_sqrtf sqrtf
+#define __ieee754_logf logf
/* REDHAT LOCAL: Include files. */
#include <math.h>
float copysignf(float x, float y);
+float logf(float x);
+
#endif
void
ao_panic(uint8_t reason)
{
+ (void) reason;
}
void
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
*/
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) {
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
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
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)
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);
}
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;
}
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;
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;
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)
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) |
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 {
ao_dma_done_transfer(miso_dma_index);
}
-
uint8_t
ao_spi_slave_recv(void *block, uint16_t len)
{
ao_dma_done_transfer(mosi_dma_index);
ao_dma_done_transfer(miso_dma_index);
+ return 1;
}
static void
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
static void
ao_usb_set_ep0(void)
{
- uint32_t epr;
int e;
ao_usb_sram_addr = 0;
static void
ao_usb_set_configuration(void)
{
- uint32_t epr;
-
debug ("ao_usb_set_configuration\n");
/* Set up the INT end point */
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;
}
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;
}
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;
}
Makefile
+MATH_SRC=\
+ ef_log.c
+
ALTOS_SRC = \
ao_interrupt.c \
ao_boot_chain.c \
ao_log.c \
ao_log_mega.c \
ao_gps_report_mega.c \
+ $(MATH_SRC) \
$(SAMPLE_PROFILE)
PRODUCT=TeleGPS-v0.3
#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;
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);
sf_sin.c \
sf_fabs.c \
sf_floor.c \
- sf_scalbn.c
+ sf_scalbn.c \
+ ef_log.c
ALTOS_SRC = \
ao_boot_chain.c \
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 \
#define AO_ADC_SQ8 AO_ADC_V_PBATT
#define AO_ADC_SQ9 AO_ADC_TEMP
+/*
+ * Voltage divider on ADC battery sampler
+ */
+#define AO_BATTERY_DIV_PLUS 56 /* 5.6k */
+#define AO_BATTERY_DIV_MINUS 100 /* 10k */
+
+/*
+ * Voltage divider on ADC igniter samplers
+ */
+#define AO_IGNITE_DIV_PLUS 100 /* 100k */
+#define AO_IGNITE_DIV_MINUS 27 /* 27k */
+
+/*
+ * ADC reference in decivolts
+ */
+#define AO_ADC_REFERENCE_DV 33
+
/*
* Pressure sensor settings
*/
sf_fabs.c \
sf_floor.c \
sf_scalbn.c \
- sf_sin.c
+ sf_sin.c \
+ ef_log.c
ALTOS_SRC = \
ao_boot_chain.c \
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 \
#define AO_ADC_SQ8 AO_ADC_V_PBATT
#define AO_ADC_SQ9 AO_ADC_TEMP
+/*
+ * Voltage divider on ADC battery sampler
+ */
+#define AO_BATTERY_DIV_PLUS 56 /* 5.6k */
+#define AO_BATTERY_DIV_MINUS 100 /* 10k */
+
+/*
+ * Voltage divider on ADC igniter samplers
+ */
+#define AO_IGNITE_DIV_PLUS 100 /* 100k */
+#define AO_IGNITE_DIV_MINUS 27 /* 27k */
+
+/*
+ * ADC reference in decivolts
+ */
+#define AO_ADC_REFERENCE_DV 33
+
/*
* Pressure sensor settings
*/
#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 \
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 \
ao_packet.c \
ao_companion.c \
ao_aprs.c \
+ $(MATH_SRC) \
$(PROFILE) \
$(SAMPLE_PROFILE) \
$(STACK_GUARD)
#define AO_ADC_SQ3 AO_ADC_V_BATT
#define AO_ADC_SQ4 AO_ADC_TEMP
+/*
+ * Voltage divider on ADC battery sampler
+ */
+#define AO_BATTERY_DIV_PLUS 56 /* 5.6k */
+#define AO_BATTERY_DIV_MINUS 100 /* 10k */
+
+/*
+ * Voltage divider on ADC igniter samplers
+ */
+#define AO_IGNITE_DIV_PLUS 100 /* 100k */
+#define AO_IGNITE_DIV_MINUS 27 /* 27k */
+
+/*
+ * ADC reference in decivolts
+ */
+#define AO_ADC_REFERENCE_DV 33
+
/*
* GPS
*/