Keith Packard [Sat, 8 Aug 2020 01:17:07 +0000 (18:17 -0700)]
altos: Remove ao_led_toggle API from general code
The generic implementation would need to record LED status as it
cannot be read back from the device on most hardware. Just get rid of
it and let attiny keep its implementation (which does work).
Keith Packard [Mon, 3 Aug 2020 00:29:44 +0000 (17:29 -0700)]
altos/stmf0, stm32f0: Call ao_boot_chain to start application
This used to be done inside ao_boot_check_chain or ao_boot_check_pin,
but it made more sense to have it done in _start instead. stm and lpc
were adjusted, but stmf0 and stm32f4 were missed.
This caused boards using this process to wedge in the boot loader.
Keith Packard [Sun, 2 Aug 2020 20:31:58 +0000 (13:31 -0700)]
altosui: Re-set pad orientation labels after product name is set
We don't know what product is being configured until after we query
the configuration, which means we need to re-set the orientation label
once that has been fetched.
Keith Packard [Wed, 29 Jul 2020 17:53:39 +0000 (10:53 -0700)]
altos: Use new ao_spi_speed inline to set SPI speeds using spec'd frequencies
Instead of hand-adjusting SPI speeds for each driver and product based
on processor supported rates, create an inline function that takes the
maximum frequency supported by the device and maps that to a value
supported by the SoC. This ensures that we don't accidentally drive devices
faster than they want (as could happen with AO_SPI_SPEED_FAST), but do go
as fast as possible in every configuration. Using an inline function means
the value is computed at compile time.
Keith Packard [Wed, 22 Jul 2020 16:04:30 +0000 (09:04 -0700)]
altos: Add 'booster' mode for dual-deploy igniters
Booster mode triggers the 'main' channel at first motor burnout
allowing the use of a simple flight computer in the booster while
providing both a separation charge and an apogee event for recovery.
Keith Packard [Wed, 22 Jul 2020 15:57:05 +0000 (08:57 -0700)]
altos: Use state transitions to directly drive igniters
Instead of a separate igniter API, have the igniter code monitor
flight state changes to trigger igniter events. This simplifes the
code while allowing further changes in the igniter code.
Keith Packard [Thu, 2 Jul 2020 22:11:42 +0000 (15:11 -0700)]
altos: Reduce flash temp buffer to make space for Em v1.0 ISR stack
EasyMini has limited RAM; small enough that increasing the size of the
storage buffer from 128 to 256 bytes left too little space at the top
of memory for the interrupt stack, causing EasyMini v1.0 to crash at
boot.
Keith Packard [Sun, 14 Jun 2020 07:04:31 +0000 (00:04 -0700)]
altos: Leave floating printf enabled on m3 devices
These devices all use floating point computations, so leave the
floating point printf included in case they print one of those
values. If we run short on flash space, we can switch back.
Keith Packard [Tue, 9 Jun 2020 04:26:23 +0000 (21:26 -0700)]
altos: Leave accel data in ring raw; swap for orientation on fetch
Instead of re-writing the acceleration data in the ring to adjust for
pad orientation, just leave it alone and flip it each time it is
fetched. Much simpler this way.
Keith Packard [Tue, 9 Jun 2020 04:03:31 +0000 (21:03 -0700)]
altos: Round selected log size down to ao_storage_block multiple
There was some (broken) code that complained if the value set wasn't
correct, that has been replaced by code that accepts any value and
just rounds it down to a multiple of ao_storage_block. The code also
stops complaining when set to the current value when storage isn't
empty.
Keith Packard [Tue, 9 Jun 2020 04:01:31 +0000 (21:01 -0700)]
altos: Move ao_storage_erase to shared code. Add len
This makes ao_storage_erase take an arbitrary length. The new version
erases each storage block if there's any un-erased data present, and
then also checks after erasing to make sure the block is clear.
Keith Packard [Mon, 16 Sep 2019 00:05:17 +0000 (17:05 -0700)]
altos: Move from newlib-nano to picolibc
Use picolibc.ld, which involved some .ld file hacking, including:
1) Defining ao_boot RAM address in the .ld file and declaring it 'extern'
2) Changing how m0 interrupt vector got moved to ram
3) Using -Taltos.ld instead of -Wl,-Taltos.ld so picolibc.specs wouldn't add picolibc.ld
4) Placing romconfig vars in '.init.1' and '.init.2' sections instead of '.romconfig'
5) Place code needing to run out of RAM in section .srodata instead of .ramtext
Keith Packard [Fri, 17 Apr 2020 19:51:13 +0000 (12:51 -0700)]
ao-tools: Use array indexing instead of addition to make gcc-10 happy
A struct with a trailing zero-length array (for variable-length data) is
treated as a zero-sized object when doing pointer arithmetic, but treated
correctly when treated as an array. This generates a warning from gcc-10
Keith Packard [Thu, 26 Mar 2020 17:01:48 +0000 (10:01 -0700)]
altosui: Report baro ground alt for 'Pad Altitude' when GPS missing
The 'Pad Altitude' field in the pad tab of AltosUI was originally one
of three fields designed to report the GPS position of the pad. When
TeleMini was added, the code was updated to separate the lat/lon from
altitude display, but the pad_alt field in AltosState used for that
was still only computed from GPS data.
This fix gets rid of the confusing 'pad_alt' field in AltosState and
has the 'Pad Altitude' data select either GPS ground altitude or baro
ground altitude, depending on whether GPS data is available.
Keith Packard [Thu, 5 Mar 2020 01:26:49 +0000 (17:26 -0800)]
altos: add APRS 'offset' value to set APRS transmision time
This value is the offset from the top of the minute for the first APRS
packet in the minute. Subsequent packets will be transmitted
'interval' seconds apart for the rest of the minute.
This allows multiple transmitters to be configured to share the same
frequency and not transmit at the same time.
Note that this offset only works when the device has GPS lock.