altos: Restructure altos build to prepare for multi-arch support Split out sources into separate directories: core: architecture and product independent bits cc1111: cc1111-specific code drivers: architecture independent drivers product: product-specific sources and Makefile fragments util: scripts for building stuff This should have no effect on the built products, but testing is encouraged Signed-off-by: Keith Packard <keithp@keithp.com>
altos: remove monitor disable stubs from altimeter code Monitor mode in the ground-station boards must be disabled when the radio is going to be used for another purpose, or the radio parameters changed. That places monitor-mode disable calls in other parts of the system which are shared with the altimeter code. Elide the ao_set_monitor calls for builds which do not include any monitoring code. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Allow any stdio to be used with packet forwarding There's no reason to restrict packet forwarding to work only from USB. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Configure packet size from send/recv parameters. Instead of setting the packet size at configuration time, use the provided packet size to the send/recv functions to configure the radio. This eliminates many configuration calls, leaving us with 'RDF' mode and 'packet' mode, the latter working for telemetry and the bi-directional link. Signed-off-by: Keith Packard <keithp@keithp.com>
src/ao_cmd: Shave off bytes from doc strings Switch to using { func, "X args\0Desc" } to specify command, saving a char field by looking at help[0] instead, and reduce help length by doing alignment with printf instead of hardcoded spaces.
altos: packet and usb i/o routines use 'char', not 'uint8_t' Just fixing the type of a local variable holding a character passed from the packet link to usb. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: eliminate ao_wake_task Waking up a task waiting on some random object is a bad idea. Fix the waiters to look for suitable signalling. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: clean up radio abort paths. Share radio code. Instead of aborting the DMA and radio operation and expecting that to be handled reasonably by the radio receiving task, rewrite things so that the abort function just wakes the receiving task while that terminates the DMA and cleans up the radio. This eliminates all kinds of nasty bugs dealing with radio abort smashing the radio registers at the wrong time, or interrupting a radio transmission. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: shut down packet mode cleanly Instead of constantly bashing the packet master thread, let it shut itself down in an orderly fashion. It will shut down fairly quickly as all of the activities in that thread are bounded. Otherwise, the master packet thread might leave mutexes locked and all sorts of other horrors. Tested on Linux and Mac OS X and shown to be reliable. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Abort radio harder when terminating packet mode. Make sure the master radio tasks don't get stuck waiting for an incoming packet again by aborting the radio each time we poke the tasks. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: flush pending output when terminating packet mode Just in case the last command sent hasn't been transmitted, hang around for up to a second waiting for the data to get across the link. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: add callsign to packet mode, increase payload to 64 bytes Untested, but it 'should' work. Need to add callsign setting to packet mode users. Signed-off-by: Keith Packard <keithp@keithp.com>
Fix all stdio reading functions to be __critical Oh, right SDCC has '__critical' to mark sections of code that need to run with interrupts disabled; no need to use EA = 0 and EA = 1. Signed-off-by: Keith Packard <keithp@keithp.com>
Return radio to telemetry settings when packet system closed. To receive telemetry after disabling the packet system, the radio must be reconfigured for telemetry mode. Signed-off-by: Keith Packard <keithp@keithp.com>
Explicitly use USB I/O routines in packet code Using the implicit stdio functions (putchar/getchar/flush) would result in essentially random redirection of each, depending on whether the packet code had characters available when getchar was called. This would cause lockups in putchar. Signed-off-by: Keith Packard <keithp@keithp.com>
In packet master, move USB flush from packet thread to echo thread This keeps the packet thread from blocking on USB and also makes the flush happen after every packet (slightly more USB traffic, but packets are slow anyway). Signed-off-by: Keith Packard <keithp@keithp.com>
Enable packet-based communcation to command processor This splits the packet code into master/slave halves and hooks the slave side up to the getchar/putchar/flush logic in ao_stdio.c Signed-off-by: Keith Packard <keithp@keithp.com>