summaryrefslogtreecommitdiff
path: root/src/core
Commit message (Collapse)AuthorAge
* Add Mini logging format. Use in EasyMinilpcKeith Packard2013-05-19
| | | | | | | This is a 16-byte record that includes all of the sensor data in each sensor record, along with records for flight state changes. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use ao_data_pres macro in ao_log_tinyKeith Packard2013-05-18
| | | | | | Now it works on easymini too Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Check for packet mode before trying to disable it in flight codeKeith Packard2013-05-18
| | | | | | This is only relevant for telemini Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: ao_data_get is in ao_data.c now, not ao_adc.cKeith Packard2013-05-18
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow architecture to define the type of port registersKeith Packard2013-05-18
| | | | | | LPC11U14 has 32-bit ports, STM32 has 16 bit ports. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Move ao_data.c from stm to coreKeith Packard2013-05-18
| | | | | | This should be used on every processor Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow target-specific USB endpoint specificationsKeith Packard2013-05-17
| | | | | | | The LPC has only a small number of endpoints, and those are not configurable. Let the LPC USB driver pick the IN and OUT endpoints by itself. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/cc1111: Hack on USB driver to make Windows happyKeith Packard2013-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Windows modem driver is quite chatty at startup time, getting and setting the comm parameters each time the device is opened. Sometimes, when setting the parameters, the cc1111 would STALL EP0. Most of the time, Windows would happily pass this as an error back to AltosUI which would then re-try the open (and succeed, most of the time). Sometimes, Windows would stall for 30 seconds before passing the error back. This made the whole UI freeze, and I suspect most people assumed our app had died. A bit of analysis with the beagle USB sniffer and I discovered the STALL settings, but there wasn't any correlation between the data on the wire and when the STALL would be generated. So, I found a couple of other cc1111 USB stacks on the net and just looked to see how our driver differed. There wasn't anything clearly related, but there were a list of small differences: 1) Other drivers didn't bother waiting for the hardware to ack the USBADDR setting; doing it this way means we can set the address *before* acking the setup packet. It'll get set eventually, at which point the device will start responding to packets again. Easy to fix, and saves a bit of code space too. 2) The other drivers set the STALL bit for setup packets which aren't understood. This shouldn't have any effect on 'good' systems as those shouldn't ever be generating bogus setup packets anyways. The driver already handled the STALL state in the interrupt handler, the only requirement was to figure out when to explicitly set the STALL bit. That required moving the state updating code from the start of the ep0 setup handling to the end, after the setup packet had been examined and data queued in or out as appropriate. 3) Our driver explicitly queued an IN packet for any setup request that wasn't waiting for an OUT pack. This appears to tie in with the USBADDR change above as before I made that change, this change caused the driver to fail to respond to most setup packets. This was simple once the above change was made, just move the generation of the IN packet inside the code that switched to the IN state. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Move MS5607 info from 'v' to 'c s'Keith Packard2013-05-15
| | | | | | Makes more sense there. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add 'g' command to ublox GPS code.Keith Packard2013-05-15
| | | | | | | | Take the gps_dump function from ao_gps_skytraq.c and move it to a new file so it can be shared with the u-blox driver. That affects every skytraq and u-blox user as they need to include the new file. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Provide a define for the number of sat infos in a telem packetKeith Packard2013-05-13
| | | | | | 12 fit, but it's best to use a symbolic constant Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use flash loader on all STM productsKeith Packard2013-05-07
| | | | | | Includes the boot chain stuff Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Eliminate stdio looping when system has a single stdio sourceKeith Packard2013-05-07
| | | | | | No need to loop if there's only one Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Move ao_notask to coreKeith Packard2013-05-07
| | | | | | | The STM flash loader wants to be taskless too, share this very simple implementation of sleep/wakeup. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make stm-flash capable of switching to applicationKeith Packard2013-05-07
| | | | | | | This shrinks the base OS load down a bit as well so that stm-flash fits comfortably in the first 8kB of memory. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Sanity check barometer before going to pad modeKeith Packard2013-05-07
| | | | | | | Make sure the barometer is reporting some sensible value before letting TM try to fly the rocket. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Mark GPS telemetry packets with GPS time stampKeith Packard2013-05-07
| | | | | | | | This provides a reasonable accurate indication of the system time when the GPS location data was received, and also makes sure GPS packets get some timestamp when no other telemetry is being transmitted. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use separate exception stack on STM32LKeith Packard2013-05-07
| | | | | | | | This reserves 512 bytes of memory for a stack, then makes sure that exceptions continue to use that stack while processes use the per-task stack. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Compute "real" RSSI value in radio code as neededKeith Packard2013-05-07
| | | | | | | | | Instead of dragging around the weird CC1111 RSSI values, just compute a dBm value in a signed 8-bit integer, ao_radio_rssi. Use that everywhere we need RSSI internally. We leave the weird CC1111 value in the packet reply as that's what the host expects. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Provide timeout value to ao_radio_recvKeith Packard2013-05-07
| | | | | | | | | Instead of using ao_alarm around calls to ao_radio_recv, provide an explicit timeout value as needed by radio functions with more complicated system interaction than the cc1111. The timeout is 8 bits of clock ticks. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Expose ao_put_string functionKeith Packard2013-05-07
| | | | | | This works like puts, except it doesn't add a trailing newline. Signed-off-by: Keith Packard <keithp@keithp.com>
* name change from MegaMetrum to TeleMegaBdale Garbee2013-04-22
|
* altoslib/altosui: Carry receiver status around in AltosListenerStateKeith Packard2013-04-09
| | | | | | | | | | This moves the crc_errors into the new structure and adds a receiver battery voltage value there as well. Now the receiver status can be monitored separately from the flight status. That also means that code receiving state updates should be prepared to accept missing listener or flight state values. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Flush the on-board mega log after every sample interval.Keith Packard2013-04-01
| | | | | | | | SPI flash parts don't need flushing, but the SD card does. Make sure the SD card contents are sane after every logging interval has passed by flushing all dirty blocks to the device. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Do not release interrupts from any pollchar functionKeith Packard2013-03-31
| | | | | | | | | | | getchar relies on interrupts being blocked across the pollchar calls and into the sleep call or it may go to sleep with data pending. This prefixes all pollchar functions with _ to indicate that they are to be called with interrupts blocked and eliminates all interrupt manipulation calls from within the pollchar functions. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add logging and telem to telegpsKeith Packard2013-03-30
| | | | | | | | | | | | This turns on telemetry, APRS, RDF and data logging for telegps. Data is logged as soon as GPS has a date to create the right filename, using files of the form YYYYMMDD.LOG which just barely fits in a FAT filename. Telemetry/RDF/APRS are all separately controllable. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Get CC115L radio working.Keith Packard2013-03-29
| | | | | | | | | | | | | | | | This involved figuring out which GPIO signal would reliably indicate that the transmitter was finished; I ended up using the PA_PD bit for this. This also converts all of the radio users to the long packet support as the CC115L has only a 64-byte fifo, not large enough to hold either an RDF tone or a regular AltOS telemetry packet. This also renames the public API for sending APRS packets from ao_radio_send_lots to ao_radio_send_aprs, which is at least more accurate. The workings of that API haven't changed, just the name. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add temporary RF power settingsKeith Packard2013-03-29
| | | | | | | | | | These expose the raw cc115l and rfpa0133 register settings so that we can calibrate them against measured power outputs. I've tested them to verify that they change how much power the board consumes, so they're clearly doing something... Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add new panic flag for bufio misuseKeith Packard2013-03-27
| | | | | | Allow the bufio code to signal a fatal error if someone misuses the API Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix config to not abort radio recv when no recv is availableKeith Packard2013-03-26
| | | | | | | Use the new radio recv define to skip disabling the receiver when there isn't a receiver. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow radio recv and xmit to be separately configuredKeith Packard2013-03-26
| | | | | | | The CC115L is xmit only, so split out the functions and provide defines to check for xmit or recv separately as needed. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add RFPA0133 amplifier driverKeith Packard2013-03-26
| | | | | | No configuration of power level yet, just the bare driver. Signed-off-by: Keith Packard <keithp@keithp.com>
* Update avr ao_spi_slave code to match API changesKeith Packard2013-01-13
| | | | | | Made the interface use void * for pointers and uint16_t for lengths Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Actually record ground averages for 6dof sensorKeith Packard2012-12-18
| | | | | | | This gets the long-term averages for the 6dof sensors recorded into the first flight log record. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Average MPU6000 values on ground for later useKeith Packard2012-12-17
| | | | | | | Having long-term ground averages recorded to the eeprom file will make post-flight analysis of the data better. Signed-off-by: Keith Packard <keithp@keithp.com>
* Merge branch 'aprs' into 'master'Keith Packard2012-12-16
|\
| * Merge branch 'micropeak-1.1'Keith Packard2012-12-09
| |\
| | * altos: Make sure pa to altitude conversion is done with 32 bitsKeith Packard2012-12-09
| | | | | | | | | | | | | | | | | | | | | We need 32 bits to hold intermediate values, even if the final altitude is reported in only 16 bits. Signed-off-by: Keith Packard <keithp@keithp.com>
* | | altos: Make APRS interval configurableKeith Packard2012-12-07
| | | | | | | | | | | | | | | | | | | | | This provides a separate configuration value for APRS, allowing the interval between APRS reports to vary. Signed-off-by: Keith Packard <keithp@keithp.com>
* | | Merge branch 'master' into aprsKeith Packard2012-12-07
|\| |
| * | altos: fix functions calling pollchar to use 'int' to hold the valueKeith Packard2012-12-07
| | | | | | | | | | | | | | | | | | | | | | | | AO_READ_AGAIN doesn't fit in a char anymore now that stdio is 8-bit clean, everyone using pollchar must use an 'int' variable to capture the whole value from pollchar. Signed-off-by: Keith Packard <keithp@keithp.com>
| * | altos: Change 'flight-number' to 'current-flight'Keith Packard2012-12-06
| | | | | | | | | | | | | | | | | | Avoids ambiguity with stored flight info, which starts lines with 'flight'. Signed-off-by: Keith Packard <keithp@keithp.com>
| * | altos: Shrink 'ao_version' by calling printf fewer timesKeith Packard2012-12-06
| | | | | | | | | | | | | | | | | | | | | Each printf call costs quite a bit of code space on the cc1111, so instead of making multiple short calls, make one longer one. Signed-off-by: Keith Packard <keithp@keithp.com>
* | | altos: Send APRS packets even during ascentKeith Packard2012-12-06
| | | | | | | | | | | | | | | | | | If you're using APRS, presumably you want to watch the rocket going up too. Signed-off-by: Keith Packard <keithp@keithp.com>
* | | altos: Allow telemetry, rdf and APRS to be individually controlledKeith Packard2012-12-06
| | | | | | | | | | | | | | | | | | | | | But, only when APRS is available so that TeleMetrum and TeleMini don't change behaviour Signed-off-by: Keith Packard <keithp@keithp.com>
* | | altos: Hook up APRS to telemetry loopKeith Packard2012-12-06
| | | | | | | | | | | | | | | | | | Send APRS packet once every 2 seconds Signed-off-by: Keith Packard <keithp@keithp.com>
* | | altos: Hook APRS up to the radioKeith Packard2012-12-06
|/ / | | | | | | | | | | | | This adds an arbitrary-length packet writing function to the radio code. Signed-off-by: Keith Packard <keithp@keithp.com>
* | altos: Add ao_task_minimize_latency to reduce IRQ delaysKeith Packard2012-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When set, this causes the task switching code to avoid blocking IRQs while looking for an idle task as that can increase IRQ latencies enough to drop characters at 115200 baud on the cc1111. Note that this *also* eliminates the ability to use low power modes as we cannot know at any point whether some interrupt has come along and woken a task. Has no effect when using task queues as those require IRQs to be blocked while looking at the queue. Shouldn't be a problem there though as the check for no running tasks is very cheap. Signed-off-by: Keith Packard <keithp@keithp.com>
* | altos: Use ao_xmemcpy in ao_log_telem.cKeith Packard2012-11-30
| | | | | | | | | | | | This eliminates the libc generic version in TeleTerra Signed-off-by: Keith Packard <keithp@keithp.com>
* | altos: Make stdio 8-bit clean by making pollchar return intKeith Packard2012-11-30
| | | | | | | | | | | | | | | | | | | | We were stealing one value (0xff) in the return value from pollchar to indicate 'not ready yet'. Instead of doing that, use the integer value -1 and have pollchar return an int instead of a char. That necessitated cleaning a few other bits to make sure that 0xff wouldn't get promoted to -1 on accident. Signed-off-by: Keith Packard <keithp@keithp.com>