Keith Packard [Wed, 13 Apr 2016 13:11:44 +0000 (06:11 -0700)]
altos/stmf0: Fix external interrupts
Missing a reserved address in the registers broke everything nicely,
but the priority values were also wrong - stm32f0 exposes 8 bits per
priority, like the stm32l, but it uses only the top two bits.
Keith Packard [Wed, 6 Apr 2016 06:45:52 +0000 (23:45 -0700)]
altos/telelcotwo: Add idle timeout
Puts TeleLCOTwo in a low power state (drawing about 80µA) after a
timeout (default two minutes) to keep from killing the battery if the
device is left turned on.
Keith Packard [Sat, 26 Dec 2015 04:46:40 +0000 (20:46 -0800)]
altos: Use simpler debounce logic for buttons
Instead of waiting for a while after the transition to decide if it
has stuck, signal the event right away and then ignore other
transitions for the debounce interval.
This seems to work just as reliably, but has the benefit of
eliminating button latency at press time.
The LCO interface is likely to end up very device specific as the
interactions depends on the input devices. Here's a version for
TeleLCOTwo, which has two arming switches and a firing button.
Keith Packard [Tue, 22 Dec 2015 05:47:10 +0000 (21:47 -0800)]
altos: Allow for pad boxes with different sensor configurations
This allows for a pad box without a resistor from power to each
FET. That resistor is needed to detect welded relays, but in a
solid-state system, that's not a possibility.
Keith Packard [Fri, 18 Dec 2015 03:30:35 +0000 (19:30 -0800)]
altos: Add pad support for new telefire versions
Makes the voltage divider values configurable, and allows for pyro
channels that don't have the resistors necessary to check for a stuck
relay.
Also supports STM32L processors with wider GPIO registers, and uses
the new ao_gpio_set/clr_bits functions to fire igniters rather than
cc1111-specific code.
Keith Packard [Sat, 26 Mar 2016 22:54:24 +0000 (15:54 -0700)]
altos/stm: Validate current task SP in interrupt by looking at PSP
We use a separate stack pointer for task code, which means we can
verify that it is in range in any interrupt handler. This adds checks
for the task stack (under #ifdef DEBUG) that run in ao_wakeup as well
as at every timer interrupt.
Keith Packard [Fri, 18 Mar 2016 18:15:57 +0000 (11:15 -0700)]
ao-tools: Add ao-makebin
This constructs a raw binary or DFU format file for use with dfu-util,
which can be used with a bare STM processor to load code before the
boot loader is available.
Bart Massey [Sun, 6 Mar 2016 01:38:19 +0000 (17:38 -0800)]
altos: Fixed timing of panic display LED to be readable
When we don't have a beeper, there's no way to signal a 'warble' for
panic. So, elide that bit.
Second, panic can't use the scheduler and timer because those may not
be running (or may have failed), and so it uses a delay loop. Add a
configurable scale value to the panic loop so that the LED blinks can
be read. For stm32f0 devices, scale that by the sysclk value to
automatically make them of reasonable length.
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.