Keith Packard [Wed, 9 Nov 2016 19:13:58 +0000 (11:13 -0800)]
altos/lisp: macros appear to work now
Needed an extra stack frame to stash the pre-macro state. This
simplified macro processing quite a bit; a macro now just evaluates
the function and then sends that result to be evaluated again.
Keith Packard [Sat, 5 Nov 2016 21:51:58 +0000 (14:51 -0700)]
altos/lisp: Change GC move API
Pass reference to move API so it can change the values in-place, then
let it return '1' when the underlying object has already been moved to
shorten GC times.
Keith Packard [Thu, 3 Nov 2016 05:56:01 +0000 (22:56 -0700)]
altos/lisp: Separate out values from atoms
This enables changing values of atoms declared as constants, should
enable lets, and with some work, even lexical scoping.
this required changing the constant computation to run
ao_lisp_collect() before dumping the block of constant data, and that
uncovered some minor memory manager bugs.
Keith Packard [Wed, 2 Nov 2016 04:14:45 +0000 (21:14 -0700)]
altos/lisp: Change lisp objects to use ao_poly everywhere. Add const
This makes all lisp objects use 16-bit ints for references so we can
hold more stuff in small amounts of memory. Also adds a separate
constant pool of lisp objects for builtins, initial atoms and constant
lisp code.
Keith Packard [Sun, 18 Dec 2016 04:58:36 +0000 (20:58 -0800)]
altos/arm: Align data so that gcc 5.4 doesn't do byte-accesses. Add -Wcast-align
Gcc 5.4.1 tracks alignment of data through assignments, so that a
uint32_t pointer which comes from byte-aligned uint8_t data:
extern uint8_t foo[];
uint32_t *q = (void *) foo;
Fetches and stores through this pointer are done bytewise. This is
slow (meh), but if q references a device register, things to bad very
quickly.
This patch works around this bug in the compiler by adding
__attribute__((aligned(4))) tags to some variables, or changing them
from uint8_t to uint32_t. Places doing this will now be caught as I've
added -Wcast-align to the compiler flags. That required adding (void
*) casts, after the relevant code was checked to make sure the
compiler could tell that the addresses were aligned.
Keith Packard [Sat, 3 Sep 2016 06:21:34 +0000 (01:21 -0500)]
altos/stm: Set SPI slave DMA priority to HIGH/VERY_HIGH
Set spi slave DMA priority MOSI to HIGH and MISO to VERY_HIGH. Slave
SPI doesn't have the luxury of slowing down when the system is busy,
so provide it maximum memory bandwidth to try and keep up with the
master.
Keith Packard [Sat, 3 Sep 2016 05:55:19 +0000 (00:55 -0500)]
altos/stm: Set MISO DMA priority to HIGH to avoid OVR
When the MISO DMA priority is too low, and the processor gets busy,
it's possible for SPI input to overrun the processor, which causes the
MISO DMA to get out of sync and never finish. Set the MISO DMA
priority to HIGH to avoid this.
Keith Packard [Sat, 3 Sep 2016 05:53:44 +0000 (00:53 -0500)]
altos/stm: Create funcs to set SPI DMA parameters
Instead of having nearly duplicate versions of the SPI DMA
configuration calls, create helper funcs that do most of the work so
that the SPI API funcs are shorter and clearer.
Keith Packard [Sat, 3 Sep 2016 04:36:36 +0000 (23:36 -0500)]
ao-tools/ao-cal-freq: Re-open usb device each try
Instead of trying to re-use the same file descriptor, close and
re-open the device each time around the loop to avoid getting stuck
when calibrating TeleMega boards.
The code to validate the usb id and product name had some debug hacks
left enabled, which caused it to fail. The short -f version of the
force flag was also not getting parsed correctly.
Keith Packard [Fri, 2 Sep 2016 21:13:25 +0000 (16:13 -0500)]
altosui: Deal with connect failure in AltosConfigTD
When the USB connection times out, abort any pending operations and
clean up the thread correctly. Also, deal with the serial line being
closed by checking for null.
Keith Packard [Tue, 2 Aug 2016 23:31:41 +0000 (16:31 -0700)]
altos: Make telelcotwo control two boxes instead of two pads
telefiretwo is now a single pad box, so telelcotwo needs to switch
between boxes instead of pads on the same box. Do this by re-purposing
the pad arming switches into a box selector and arming switch.
Keith Packard [Wed, 27 Jul 2016 20:26:22 +0000 (13:26 -0700)]
altos: Don't switch to flight 0 when log fills in flight
If the log is full at startup, we want to transmit flight 0 to let the
ground station know. However, we don't want to switch to flight 0 in
flight, so save the initial telemetry flight number (0 or the real
flight number) at startup and use that throughout the flight.
Keith Packard [Wed, 27 Jul 2016 20:24:57 +0000 (13:24 -0700)]
altos: Expose cc1200 radio test functions for telemini bringup
This exposes the cc1200 radio test function so we can load special
test firmware in telemini to do the radio cal as it has no USB to
perform that interactively.
Keith Packard [Wed, 27 Jul 2016 20:17:51 +0000 (13:17 -0700)]
altos: Don't access cc1120 SPI bus during recv after abort has started
When the receive timeout happens, the radio may still interrupt while
the SPI bus is getting shut down. If this happens, the interrupt
handler shouldn't touch the SPI bus at all as it may well be turned
off, which would cause the receive function to wedge waiting for a spi
byte transfer to happen.
Keith Packard [Wed, 13 Jul 2016 04:06:23 +0000 (21:06 -0700)]
altosuilib: Show indicator when they switch from invalid back to valid
The 'hide' value wasn't getting reset to 'false' each time the state
of the indicators was checked, so indicators would get hidden and then
never shown again.
Keith Packard [Wed, 29 Jun 2016 19:52:37 +0000 (12:52 -0700)]
altos: Make ao_delay(0) not wait forever
ao_delay() is implemented on top of ao_sleep_for, and ao_sleep_for
uses the timeout value of 0 to indicate an infinite timeout. Calls to
ao_delay for 0 ticks would unintentionally hit this case and end up
waiting forever.x
Keith Packard [Wed, 29 Jun 2016 19:49:16 +0000 (12:49 -0700)]
altos: cc1200: use FIFO threshold pin output for APRS buffering
Instead of polling the device for fifo space, just use the available
pin configuration to figure out if there is enough space for a single
APRS buffer. Then set the APRS buffer size to match the fifo threshold
setting in the chip so that we know we can write the whole APRS buffer
once the pin says there's space.
Keith Packard [Wed, 29 Jun 2016 01:39:31 +0000 (18:39 -0700)]
altos/stm: Add better byte-level SPI api
This provides inline functions for sending and receiving individual
bytes, and setup/finish functions to wrap them in. This make the byte
sending respect the SPI hardware interface requirements.
Keith Packard [Tue, 28 Jun 2016 06:25:01 +0000 (23:25 -0700)]
altos/stm: move spi execution to common ao_spi_run
This regularizes SPI hardware use and ensures that the device is
turned off after it has been used and that the status register is back
to 'normal' the next time through.