Keith Packard [Wed, 2 Mar 2016 21:54:58 +0000 (13:54 -0800)]
altos/chaoskey: Add another USB endpoint to read raw data
This replaces having the single output switch based on a pin value and
allows us to box the device and still fetch raw data.
For now, this will use a special libusb2 program, ao-chaosread, to
pull bits as I haven't figure out how to make linux provide two
/dev entries for one USB device.
Keith Packard [Mon, 15 Feb 2016 23:26:00 +0000 (15:26 -0800)]
altos/chaoskey: Use SoC device ID as serial number
To make manufacturing these devices tractable, we don't want to
require a custom firmware load for each device, but we still want a
unique serial number. Fortunately, the SoC provides a 96-bit ID which
we can use.
Keith Packard [Mon, 15 Feb 2016 23:24:35 +0000 (15:24 -0800)]
altos/stmf0: Use device ID as usb serial number if requested
This exposes the hardware device ID (which is unique per-chip) as the
USB serial number, avoiding the need to create a custom ROM image for
each device.
Keith Packard [Sat, 6 Feb 2016 13:10:57 +0000 (00:10 +1100)]
altos: Allow USB drivers to skip CDC-ACM -specific descriptors
For devices not providing the standard CDC-ACM interface, let them
skip the various descriptors and interfaces to provide a more limited
set of capabilities.
Keith Packard [Thu, 28 Jan 2016 08:14:36 +0000 (00:14 -0800)]
altos/chaoskey: Add support for flipping between raw and cooked bits
Plug the 'force bootloader' thing onto the board while it's running
and it will generate raw bits instead of running them through the CRC
to whiten. Useful for validating the raw hardware.
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.