Keith Packard [Mon, 20 May 2013 03:07:52 +0000 (20:07 -0700)]
altos/lpc: Pull ADC data from the correct registers
Was just stepping through register space arbitrarily, which would have
worked for EasyMini, but might have failed later if the ADC pin usage
wasn't consecutive.
Keith Packard [Mon, 20 May 2013 03:04:29 +0000 (20:04 -0700)]
altos: Add EXTI_PIN_NOCONFIGURE to exti interface, use for MS5607
This asks the EXTI code to not mess with the pin configuration so that
the MS5607 driver can get interrupts on the MISO pin while still using
it for SPI.
Keith Packard [Mon, 20 May 2013 03:00:24 +0000 (20:00 -0700)]
altos/lpc: Make EXTI code work.
Clear rise/fall bits in ISR to avoid re-entering.
Block interrupts around enable/disable bits.
Create shared _ao_exti_set_enable function to control mask changes.
Keith Packard [Fri, 17 May 2013 10:34:50 +0000 (03:34 -0700)]
libaltos: use PurgeComm in Windows altos_close to abort in-progress ops
Instead of manually signalling the related events, use PurgeComm which
can then abort the operations itself. Also make sure all of the
relevant handles are set to INVALID before closing them to avoid race conditions.
Keith Packard [Fri, 17 May 2013 10:21:08 +0000 (03:21 -0700)]
altos/cc1111: Hack on USB driver to make Windows happy
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.
Keith Packard [Tue, 14 May 2013 17:48:24 +0000 (10:48 -0700)]
altos: Grab SPI mutex until MPU6000 I2C mode is disabled
If other drivers use the SPI bus, the MPU6000 gets confused as its
sitting on the bus looking for I2C messages. Just grab the mutex
before the OS is running and hold onto it until the MPU6000 has been initialized.
Keith Packard [Tue, 14 May 2013 16:12:29 +0000 (09:12 -0700)]
altos: Add 'g' command to ublox GPS code.
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.
Keith Packard [Tue, 14 May 2013 07:38:34 +0000 (00:38 -0700)]
altosui: Use GPS alt + baro height for KML altitude
GPS altitude is generally more absolutely correct than baro altitude,
so use that as the nominal pad altitude when generating a KML
file. This results in a KML file that has the flight trace start and
end closer to the ground, which is always nice.
Keith Packard [Tue, 14 May 2013 07:24:53 +0000 (00:24 -0700)]
altoslib: Use sequence numbers to track GPS updates to AltosRecord
State objects now record what GPS sequence ID they have to know when
the GPS data has been updated. Record objects bump the GPS sequence
each time new GPS data is recorded. This way, record objects aren't
modified as they're iterated over to generate the list of state
objects which makes it possible to iterate multiple times and get the
same resulting set of states.
Keith Packard [Tue, 14 May 2013 05:27:00 +0000 (22:27 -0700)]
altoslib: Correct hexfile address ranges
Stop trying to use sentinal values for addresses and just keep a
boolean tracking whether they've been initialized. Avoids precision
errors in the variables.
Keith Packard [Mon, 29 Apr 2013 06:06:24 +0000 (23:06 -0700)]
altos: Wait after configuring boot pin before testing it
Clearly the pin isn't quite ready just after it's been configured, so
hang around for a while (100 nops) to let things setting down before
testing the value of the pin. Makes booting a lot more reliable.
Keith Packard [Sat, 27 Apr 2013 07:24:08 +0000 (00:24 -0700)]
altos: Get rodata into flash, make sure sections are aligned
.rodata* needs to be in flash; otherwise strings get left in ram.
Failing to align sections makes the initialized data get dumped into
the wrong place in memory.
Keith Packard [Sun, 24 Mar 2013 22:30:24 +0000 (15:30 -0700)]
ao-tools/lib: Add loading support for 32-bit ihx files
These place the upper 16 bits of the address in a special record. That
requires handling records in file order, so don't sort them in address
order anymore, instead find the bounds of the loaded data by scanning
them all.
Keith Packard [Sun, 24 Mar 2013 22:27:42 +0000 (15:27 -0700)]
altos/stm: Add comments to the .ld files explaining how the romconfig stuff works
Would be nice to be able to explicitly define addresses for the
romconfig variables, but I can't figure out how to make that
work. Instead, just explicitly load the files in teh right order to
make things land in the right places.