summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* altos: Disable MS5607 interrupt in the handleraltosdroidKeith Packard2012-06-28
| | | | | | | Avoids having the interrupt re-raised multiple times until the reading task finally wakes up. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Track missed HMC5883 interruptsKeith Packard2012-06-27
| | | | | | | When it fails to signal conversion complete to the CPU, keep track of that and report it with the rest of the current data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Increase default STM stack to 648 bytesKeith Packard2012-06-27
| | | | | | | 512 seems cozy given the printf implementation we're using and the extensive interrupts. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: panic if MPU6000 self test failsKeith Packard2012-06-27
| | | | | | Don't try to fly if the board isn't working right. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Disable mag sensor for megametrumKeith Packard2012-06-27
| | | | | | | It doesn't work unless USB is connected or occasionally while the debug port is enabled. It's mystic. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow megametrum to be built without using the mag sensorKeith Packard2012-06-27
| | | | | | | I'm having trouble getting it working reliably, so we'll like disable it for now. This patch makes that possible. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make profiling Viterbi decoder more usefulKeith Packard2012-06-27
| | | | | | | This blocks starting the decoder until all of the data have arrived so that the time spent in the decoder is easily computed. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Unroll viterbi state loop for >30% performance boostKeith Packard2012-06-27
| | | | | | 9.3ms vs 14.7ms, a clear win. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up STM I2C clock computationsKeith Packard2012-06-27
| | | | | | Fix both clock time and rise time. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up radio CRC handlingKeith Packard2012-06-27
| | | | | | | Make the FEC code just set the CRC_OK bit like the cc1111 radio does; eliminates a bunch of weird conventions across the FEC API. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: get MPU6000 I2C link working reliablyKeith Packard2012-06-27
| | | | | | | | | | This slows the i2c bus to 100kHz (yuck), sets the rise time to spec (it was way off) and adds more delays during bus setup. I've run this for hours now without trouble. Will try to adjust things back to fast mode and see if I can make that work as 100kHz isn't fast enough to reliably get data at 100 samples/sec. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: reorder stm USB state stores to avoid racesKeith Packard2012-06-27
| | | | | | | | | | | | | Must set ao_usb_in_pending before telling USB about new data or an interrupt could arrive at the wrong time to clear it. Same for ao_usb_in_flushed. Without these changes, I've seen the USB bus lock up on occasion, waiting for an IN packet to consume data, but with no IN data pending in the hardware. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: include targe SPI speed in get requestKeith Packard2012-06-27
| | | | | | | STM needs it to be provided when enabling the SPI device, so just fix AVR and cc1111 to do the same. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Wait for i2c START condition before setting interrupt bitsKeith Packard2012-06-27
| | | | | | | | This seems better than the random loop that it replaces, but I still have no idea why this is required; it doesn't coorespond to the docs at all... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: disable FEC debug on MMKeith Packard2012-06-27
| | | | | | | Seems to work; we'll leave the code around in case something bad happens later. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up cc1120 driver a bitKeith Packard2012-06-27
| | | | | | Make some variables static, remove stale debug code Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't try to grab radio while firing MM ignitersKeith Packard2012-06-27
| | | | | | | If you're in idle mode, you stop forever as the packet mode receiver will own the radio mutex forever. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: stm i2c debug code was calling flush() even when disabledKeith Packard2012-06-27
| | | | | | | | | The fancy stm i2c debugging code had calls to flush() that were invoked outside of the conditionals leading to all kinds of fun -- flush() may re-enable interrupts, yield or do all kinds of wacky stuff, none of which is appropriate from the middle of a device driver Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: mpu6000 requires a delay during startKeith Packard2012-06-27
| | | | | | | I have no idea why this is required, but the mpu6000 will not come up and run if this isn't present. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: ao_ignite.c is no longer cc1111 specificKeith Packard2012-06-26
| | | | | | Move it to core Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add debugging code to check for stack overflowKeith Packard2012-06-26
| | | | | | | | Stack overflow often happens from interrupt handlers sitting on top of a task stack. Check for this during ao_wakeup as that is often called during interrupt processing. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Enable full flight computer functionality in MegaMetrumKeith Packard2012-06-26
| | | | | | This turns on everything that currently works Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Create a 32-bit 1MHz timer for use in profiling executionKeith Packard2012-06-26
| | | | | | | This provides a simple method for getting high-resolution timer data to use in performance tuning code. It's not used by default anywhere. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Abort radio receive when using flash memory on megametrumKeith Packard2012-06-26
| | | | | | | | | | Radio receive camps on the SPI bus, making it impossible to access flash memory. Abort any pending receive operation when trying to get to the flash part. Yes, this is a total hack. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make gcc happy with ao_telemetry_set_intervalKeith Packard2012-06-26
| | | | | | Using unsigned locals made GCC sad as it was compared with a signed value. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Turn radio-related bits of ao_flight_mm.cKeith Packard2012-06-26
| | | | | | Now that MM has full radio functionality, we can make it work right. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: custom hex printer for telemetry packetsKeith Packard2012-06-26
| | | | | | Using printf is way too slow with pdclib; just hand-write hex byte output. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Optimize FEC encode and decodeKeith Packard2012-06-26
| | | | | | | | | | | | | Integrate interleaving, CRC and padding within the decode/encode functions. Provide for ISR priorities so that the 1120 RX interrupt takes precedence over the other interrupts or we risk losing bits. Optimize the viterbi decoder a bit (goes from 10ms per packet to 7ms per packet). Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add GPS logging code for MegaMetrumKeith Packard2012-06-26
| | | | | | | MM uses a different logging format with larger log blocks, so restructure the GPS logging code to fill them up Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make cc1111 radio control functions staticKeith Packard2012-06-26
| | | | | | No need to publish these; they're all private to cc1111 Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up usage of port parametersKeith Packard2012-06-26
| | | | | | | | Make stm port parameters always be pointers; this avoids the confusion where some macros took '&port' and others took a bare 'port', and also unifies code to run on other processors in a consistent fashion. Signed-off-by: Keith Packard <keithp@keithp.com>
* altosui: Make libaltos recognise new USB idsKeith Packard2012-06-26
| | | | | | | libaltos has a small range of 'AltusMetrum' products to avoid opening other devices. We've got more IDs, so open up the range. Signed-off-by: Keith Packard <keithp@keithp.com>
* altosui: AltosSerial and AltosLink both tried to provide frequency settingKeith Packard2012-06-26
| | | | | | | | AltosLink owns all of the device configuration, so remove that from AltosSerial and make sure that AltosLink provides the right function signatures (wasn't using the new direct frequency setting command). Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: rename ao_viterbi.c to ao_fec_rx.cKeith Packard2012-06-26
| | | | | | Keep it parallel with ao_fec_tx.c Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Incremental viterbi decodeKeith Packard2012-06-25
| | | | | | | | Decode radio input one interleave block at a time. This overlaps the decode computation with the packet reception, leading to lower latency in an attempt to keep up with the transmitter. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: decode cc1120 received packetsKeith Packard2012-06-25
| | | | | | Call the fec decode function, compute RSSI and check CRC Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Get cc1120 packet reception workingKeith Packard2012-06-25
| | | | | | Interrupt-per-bit, but it seems to work Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Forgot ao_telemetry.hKeith Packard2012-06-25
| | | | | | Not much builds without this... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: improve FEC apis to reduce data copyingKeith Packard2012-06-23
| | | | | | | | | Integrate interleaving and whitening into encode and decode steps. Add CRC checking function for receive. Make ao_fec_test program round-trip the data and verify correctness. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add ao_viterbi.c to megametrum buildKeith Packard2012-06-23
| | | | | | | It's not used yet, just wanted to see how big the resulting object file was (492 bytes). Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: fix comment about decoding last byte of FEC dataKeith Packard2012-06-23
| | | | | | There aren't *any* forward bits to use when decoding the last byte. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make ao_fec_tx_test build cleanly with -WallKeith Packard2012-06-23
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: optimize Viterbi implementationKeith Packard2012-06-23
| | | | | | Minimize data usage, make data arrays static Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: incremental viterbi decodeKeith Packard2012-06-23
| | | | | | | Decode bits incrementally. Don't bother decoding the last byte; it's always a pad byte. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Start optimizing viterbi decoderKeith Packard2012-06-22
| | | | | | | | Only need two cost arrays (previous and next). Create constant full-width decoder table instead of expanding bits into bytes for each decode step. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add the simplest possible viterbi decoderKeith Packard2012-06-22
| | | | | | | I think I understand how it works now. It's not exactly speedy, and it uses a lot of memory. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Move FEC code to coreKeith Packard2012-06-21
| | | | | | It's not a driver as it's not specific to the 1120 chip Signed-off-by: Keith Packard <keithp@keithp.com>
* ao-tools: Support MM telemetry packets in ao-telemKeith Packard2012-06-21
| | | | | | Parse the new packet formats Signed-off-by: Keith Packard <keithp@keithp.com>
* altosui: Support MM telemetry packetsKeith Packard2012-06-21
| | | | | | | Required restructuring the whole telemetry system to provide abstract interfaces to flight data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Crank down STM SPI speed for MMKeith Packard2012-06-21
| | | | | | | | The cc1120 is noisy enough to break SPI data transfers at 4MHz, so crank things down to 1MHz. It's "stable" now, but clearly needs a filter and shorter traces. Signed-off-by: Keith Packard <keithp@keithp.com>