Keith Packard [Sun, 10 Jan 2016 23:56:21 +0000 (15:56 -0800)]
altos: Switch PWM constants to end up exposing µsec
This changes the constants so the clock runs at 1MHz, making the step
1µsec each. Then make the period 20000 steps, or 20ms for a 50Hz
frequency as before.
Keith Packard [Sun, 10 Jan 2016 23:44:08 +0000 (15:44 -0800)]
altos: Set TeleMega v2.0 PWM to support servos
Typical servos use a 50Hz signal with less than 10% duty cycle. Set
the divider to 10 and the range to 64000 to provide a reasonable level
of detail down in the low range.
Keith Packard [Sun, 10 Jan 2016 05:33:23 +0000 (21:33 -0800)]
altos: Insert inter telemetry-packet delay
The receivers take some time to reset the radio between packets, so
make sure we don't send back-to-back telemetry too quickly by delaying
after sending each telemetry packet.
Keith Packard [Sat, 26 Dec 2015 07:20:29 +0000 (23:20 -0800)]
altos: Get stm32l pwm driver working
Fix the CCMR1_OC1PE and CCMR2_OC3PE values.
Disable clock when no PWM outputs are running.
Fix the apb1enr value for the timer.
Set ARR value to PWM_MAX - 1 -- ARR is off by one.
Sets the GPIO pins to 40MHz bandwidth for sharper edges.
Tested on EasyMega, but that code is not included as it breaks the
companion protocol.
Keith Packard [Sat, 14 Nov 2015 07:17:11 +0000 (23:17 -0800)]
doc: Try a different trick for asciidoc build issues
asciidoc creates temp files in the current directory using basename of
the source filename. Doing html and pdf builds in parallel causes
chaos as a result. Fix this by having the pdf target build both
serially, and then have the html target just depend on the pdf target.
Keith Packard [Tue, 13 Oct 2015 20:52:32 +0000 (13:52 -0700)]
doc: Force FOP to read images from doc directory
Looks like something changed and fop is now reading from the directory
containing the source file. xmlto places that source in /tmp, making
all relative URIs fail. Fix this by creating a fop configuration file
directing it to load relative to the doc directory and then pass that
through xmlto.
Keith Packard [Mon, 21 Sep 2015 05:00:36 +0000 (06:00 +0100)]
altosuilib: In display thread, set new state synchronously
When replaying telemetry, received_time gets set by both the
telemetry reader (when the file is initially read) and by the replay
reader (as the telemetry is processed). Because these two events are
separated by the time it takes to play the file, the second time is
the one we want for figuring out how long since the last telemetry
packet. However, if we set the global state when pulling the state out
of the telemetry reader, and then the replay reader pauses for a long
time, then the voice output thread sees the intermediate time value
and thinks that it has been a long time since the last packet was
received and reports that the rocket may have crashed.
Fix this by just holding the read state until it has been passed by
the replay reader and had the received_time set to current time.
Keith Packard [Mon, 14 Sep 2015 05:24:47 +0000 (22:24 -0700)]
altos/telelco: Adjust drag race UI
Enter/leave drag race is done by rotating the box selector knob
to a new 'dr' position and then holding down the firing button; this
avoids a potential accidental firing if you somehow don't realize
you've armed the box before selecting drag race mode.
Keith Packard [Sun, 13 Sep 2015 03:41:37 +0000 (20:41 -0700)]
altoslib: Rotation off by factor of two
The rotation computation was off by a factor of two when converting
the rates to a quaternion (the quaternion needs to be half of the
actual rotation amount). This ended up presenting a tilt angle of
twice what it should be.
Keith Packard [Sun, 13 Sep 2015 02:20:49 +0000 (19:20 -0700)]
altoslib: Hide 'state' member and use accessor function
Someone was smashing the state to 'landed' when no packets had been
received for a while. Found that by making it impossible for anyone
outside of AltosState to change the value.
Keith Packard [Sun, 30 Aug 2015 00:29:00 +0000 (17:29 -0700)]
altos/telelco: Add drag race UI
With the unit disarmed, press and hold the fire button for five
seconds to enable drag race mode.
The display will show 'dr' for five seconds and beep five times to
indicate that drag race mode is enabled. The decimal points in the
display will all be displayed as an additional visual aid. Once every
five seconds, it will beep.
With drag race mode enabled, you can select a box/pad pair and press
the 'fire' button to add it to the drag race group. For the current
box, all members of the drag race group will have their continuity
LEDs blink slowly. There will be no indication of continuity in this
mode; you'll want to check that before enabling drag race mode. If you
want to de-select a member of the group, just press the fire button
again. Each time you push the fire button, it will beep out the pad
number added or removed.
Arm the box and you will not be able to add or remove members from the
drag race group. Firing will simultaneously fire all members of the
drag race group.
To disable drag race mode, press and hold the fire button for two
seconds. It will beep twice and turn off the decimal points in the display.
Keith Packard [Fri, 21 Aug 2015 06:02:04 +0000 (23:02 -0700)]
altos: Add HAS_COMPANION to new boards with companion connectors
Thanks much to Rob Derstadt for discovering this bug!
TeleMetrum v2.0, TeleMega, EasyMega, TeleBalloon v2.0 all have
companion connectors and yet HAS_COMPANION was not defined. This
disabled companion telemetry packets on these products, but otherwise
didn't have any effect.
Keith Packard [Sun, 12 Jul 2015 02:17:40 +0000 (19:17 -0700)]
altosdroid: Keep speaking even when screen is off
Move the voice and telemetry disabling calls from onStop to onDestroy
so that a stopped application only leaves off updating the screen, and
not the voice bits as well.
Keith Packard [Sun, 12 Jul 2015 02:11:48 +0000 (19:11 -0700)]
altoslib: Limit simultanous map tile downloads to 128
Before this change, every tile requested would get downloaded at the
same time. With moving to distance-based offline map loading radius
values, the number of tiles at closer zooms was in the thousands,
overwhelming the network.