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: Add ability to set arbitrary radio frequency This adds a separate config parameter to control the raw radio frequency setting, allowing the user to select an arbitrary frequency instead of being forced to choose one of the 10 pre-defined 'channels'. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: teledongle does not need ao_packet_slave.c TeleDongle doesn't provide slave interfaces, so remove ao_packet_slave from the TD build Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Rename telemetry to telemetry_orig This makes room to create a new multi-packet telemetry format without changing anything yet. 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.
ao_radio: generalise setup of packet size
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>
Revert "altos: Don't abort radio transmissions with ao_radio_abort" This reverts commit 54468e5dc567aaac5c5c20e921859b7cec28bb88. With this patch in place, TD could not be placed in 'packet' mode.
altos: Make radio test command careful with the radio mutex. Remember whether the radio test mode is on or off and don't try to do either of them twice to prevent the mutex from being acquired or released twice. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Don't abort radio transmissions with ao_radio_abort We only want to abort pending radio reception to release the radio for other use, or to change the radio channel. Let radio transmission proceed. This fixes a problem with using packet mode to configure the radio channel; if the packet transmission is aborted, the TM ends up wedged. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Add on/off modes to 'C' command This lets the user turn the radio on/off and then invoke other commands. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: prepare for sdcc 2.9.1 A few minor language changes -- non-standard keywords are now prefixed with __, such as 'at', 'interrupt', 'naked'. Signed-off-by: Keith Packard <keithp@keithp.com>
Make ao_radio_idle keep trying to get the radio to idle. Attempting to abort a radio operation could lead to a hang if the user of the radio jumped in and started using it again before the task attempting to abort woke up. This change just keeps smacking the radio until the radio goes idle long enough to detect it.
Disable monitor mode before attempting radio test. If monitor mode is left active, then the radio lock will not be able to be acquired for the radio test. Signed-off-by: Keith Packard <keithp@keithp.com>
Use ao_radio_get/ao_radio_put in packet code. The ao_radio_get function both acquires the mutex *and* configures the radio channel and frequency. Failing to use this in the packet code would leave the radio frequency unconfigured. Signed-off-by: Keith Packard <keithp@keithp.com>
Re-order config values. Change frequency to cal Place more often used values at top, and consistently call the radio value 'calibration' instead of 'frequency'. Signed-off-by: Keith Packard <keithp@keithp.com>
Add radio calibration configuration. The crystal we use is only good for 20ppm, which generates a fairly significant error bounds at our RF frequency. This commit adds a configuration variable that sets the RF frequency control variable so that the output frequency can be adjusted. Signed-off-by: Keith Packard <keithp@keithp.com>