Keith Packard [Thu, 5 May 2016 09:25:52 +0000 (02:25 -0700)]
altoslib: Fix map preloading callbacks, run in separate thread
The map storage and tile callbacks were muddled together. Create
clearly separate states for map data and have status updates be
delivered when registering for new status events so that registration
is sufficient to track the state without an explicit call to get the
current state.
Run the map tile creation in a separate thread so that even checking
status of files on disk runs out of the UI thread.
These fixes serve to make the pacifier update more smoothly, and also
not over/under count tile loading so that the loading actually
completes when all of the tiles are loaded.
Keith Packard [Thu, 5 May 2016 06:56:44 +0000 (23:56 -0700)]
micropeak: Change order of windows install so that java detect works
I have no idea why this matters, but if you run the FTDI script before
trying to detect java, then the javaw.exe program isn't found and java
detection fails.
Keith Packard [Mon, 2 May 2016 23:19:39 +0000 (16:19 -0700)]
altos: Make sure AO_MMA655X_INVERT is declared where needed
Add #define AO_MMA655X_INVERT 0 to existing products which didn't
declare it at all. This will make sure the value is set correctly for
each new board.
Keith Packard [Mon, 2 May 2016 23:13:53 +0000 (16:13 -0700)]
altoslib: Deal with TeleMetrum v2.0 MMA6555 being inverted
Dumping the MMA655X data with the 'A' command provides the raw sensor
value. On TM v2.0 boards, the sensor is inverted, and all of the
firmware uses the inverted value except for the 'dump the raw data'
command. As a result, MonitorIdle was using the un-inverted value and
displaying mystic values.
I've fixed this in the ground station code by checking the product
name and conditionally inverting the value (4095 - value) for
TeleMetrum v2.0 products. Unknown products will generate a warning
dialog on AltosUI so we'll catch places where we've failed to add a
new product name.
Keith Packard [Sun, 1 May 2016 01:37:05 +0000 (18:37 -0700)]
altoslib: Flush during set_state. Don't store listener state.
The listener state wasn't used anyways, so don't bother storing
it. Also, flush the state during set_state, which actually causes the
state to be written out.
Keith Packard [Mon, 25 Apr 2016 22:50:58 +0000 (18:50 -0400)]
altos: Clear packet queue when starting packet master
This avoids overfilling the packet buffer when
disconnected. Applications using packet mode shouldn't expect that
output be saved across master sessions.
Keith Packard [Mon, 25 Apr 2016 22:48:47 +0000 (18:48 -0400)]
altos/stm32l: Add support for software-driven HW flow control
This allows applications to request that the flow control bits be
driven from software rather than hardware, permitting more flexible
pin configuration.
OSX and Windows cannot handle files with names differing only by
case. When these files are present in either there's a constant
unfixable change viewable in git status and git diff.
Since this code can be run and compiled on both platforms
names different only by case should be avoided.
Signed-off-by: Justin Vreeland <vreeland.justin@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
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.