| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
This allows other systems to see what baud rate the host has requested.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
These were getting accidentally used by ao_pad.c
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
The timers are all stopped when the chip boots, so no need to stop
them. This saves some text space, allowing the current code to (just
barely) fit.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
This exposes the cc1200 radio test function so we can load special
test firmware in telemini to do the radio cal as it has no USB to
perform that interactively.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This saves space on cc1111 parts.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Can't get the hw to work.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
These set or clear a group of bits in a single GPIO register all together.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having arbitrary alarms firing in the middle of complicated device
logic makes no sense at all. Therefore only correct use of ao_alarm
and ao_clear_alarm was around a specific ao_sleep call, with correct
recovery in case the alarm fires.
This patch replaces all uses of ao_alarm/ao_sleep/ao_clear_alarm with
ao_sleep_for, a new function which takes the alarm timeout directly.
A few cases which weren't simply calling ao_sleep have been reworked
to pass the timeout value down to the place where sleep *is* being
called, and having that code deal with the return correctly.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Instead of defaulting to 8 bits, explicitly require declaration of the
type of the port register for each architecture.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
There's no reason to use 20.5kHz deviation at 2400 and 9600 baud, and
if we get a better receiver, we'll want to use narrower deviation to
have less bandwidth sucking noise into the radio. The new values are
(nominally) 5.125kHz deviation for 9600 baud and 1.5kHz deviation for
2400 baud.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This ensures that we don't try to start another write too soon.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Stores 32-bits for all of the flight parameters. Uses 64-bit
intermediates for kalman computation.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Telemetry gets a special 'mode' flag indicating that 24-bit data is
present; log files get new data and log readers are expected to detect
that via the firmware version number.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
Instead of blocking on PQT, just set up the receiver to start going
and when the first bit interrupt comes in, grab the SPI bus if
possible and configure it for reception. This improves sensitivity in
the radio by a significant amount while making the code conceptually a
bit nicer.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
This removes the packet quality test and carrier sense tests when
deciding whether to start decoding a packet. This lets more bad
packets through, but the CRC check catches those and now we're
regularly receiving packets down to -110 or even -112 dBm. Before this
change, we'd rarely see packets as low as -105dBm
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This lets the radio code adjust the telemetry packet sending pattern
when the data rate changes.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
This provides a more accurate means of determining available log space
than guessing whether some portion of the flash chip holds
configuration data.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
And, doesn't fit in memory for some of them, so don't compile it.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Errata http://www.ti.com/lit/er/swrz022c/swrz022c.pdf says that the
xtal is stable bit is bogus and that you need to just delay for a while.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
This lets you directly set the mid-range beep tone; the high and low
tones remain set off of that in the same ratio as before.
Note that none of the cc1111 products get this feature as they don't
have enough flash space anymore...
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This works on everything with a beeper except TeleMetrum v1.0 which
just doesn't have enough flash space for the code.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
core remains a bad name to use -- dirvish skips files (and
directories, it seems) with that name.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This lets other bits of the code know when USB has been connected.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Because it's missing a return, we'd end up filling out one element of
the ADC record per interrupt, and rotating through which one was set,
hitting all of the even offsets within the struct. Yikes!
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
There's no reason to keep running the RC oscillator after we switch to
the crystal, so turn it off.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
This allows the user to specify which compiler to use for each target
CPU. Also checks to make sure the arm compiler supports -m0 and -m3
cpu type flags. The build now actually uses the specified compilers too.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
cc1111 ao_adc.c supplies the needed globals at this point, and linking
both into the program leads to two different versions of each at
different addresses (yay SDCC linker!)
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
If the MISO line goes low before we manage to configure the
interrupts, we'll miss it entirely unless we check the pin explicitly.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Make sure the MS5607 code gets told to sample every tick
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Don't even turn in the PICTL bits as that seems to cause the chip to
be unhappy.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
The ADC code is responsible for actually inserting the non-ADC data
into the ring, so do the copy there.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This code is designed to support the MS5607 MISO interrupt bits.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
The Tm v2 ADC code was not actually fetching and storing the ADC
conversion values.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Needed for TeleMini v2.0
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Reading the status byte doesn't provide very useful RSSI info
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
We usually work in RF quiet areas; let the AGC hardware try all of the
available gain settings.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Necessary for flashing skytraq chips
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
These sequences are very similar, differing only in whether the dbg
clock line is toggled while holding reset low for a while.
Signed-off-by: Keith Packard <keithp@keithp.com>
|