| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Share code for osequence of ao_dbg_long_delay(); ao_dbg_send_bits()
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Two implementations of the same function, one in cc1111/ao_dbg.c and
the other in core/ao_send_packet.c.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This is untested, but at least it builds now
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Otherwise, we run the risk of an interrupt waking a task after we've
decided to idle the CPU.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Just reformatting changes, aside from the removal of cli/sei
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Stop using cli/sei for AVR, add replacement to __critical for cc1111
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This also involved hacking up the code to allow for non-zero offsets
for the pad firing and continuity pins.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
Trying to use 8-bit counts is a nice optimization which fails when the
count is larger than 255, as is the case with clearing the flash block
in the AT45 driver. This bug resulted in the inability to erase
flights on TeleMetrum v1.0 boards.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
SPI send double buffered, so the DMA completes one byte too early. Use
the recv DMA to know when the SPI transfer is complete.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
This includes long delays to avoid overrunning the cc1111 input,
otherwise it works pretty well. The delays mean that we can't capture
the reply to a cmac command though, so more work is needed.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
We look at the out_done value, but not the in_done value; if we use
the radio DMA for out, we would have to use ao_radio_dma_done to check
for completion. This way, we can ignore that value and use the
existing ao_aes_dma_out_done value.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
ao_delay hasn't been chip-specific for a long time, and it had a bug
in not calling ao_clear_alarm.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Move api to ao_radio_cmac.h include file.
Expose ao_radio_test as standard API.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Don't enable DMA in the other direction when doing slave transfers.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Theese don't try to drive the chip select line
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
otherwise, telefire doesn't have enough DMA channels.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Allow either USART in any configuration. Still only supports one SPI
bus though.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Ensures that the radio testing won't block waiting for a firing mode
packet to arrive.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Just a comment in the source code about which pins each option selects.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
A typo in the symbol used to enable stdin wakeups from serial1 caused
the input to pend until some other wakeup occurred.
This also makes the serial1 hw flow control pin selects in config 2
work right, although those aren't used by any current product
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This is untested...
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
The ao_serial_speed structure is needed by serial0 too.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Allows general GPIO-using code to run on cc1111
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
tx/rx are 4/5, rts/cts are 2/3
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
Just like cc1111, stick the serial number and radio calibration values
at known fixed addresses so that when re-flashing the board, we can go
find the existing values.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Necessary to fetch it when interrupts are already disabled as we can't
call ao_time then.
Signed-off-by: Keith Packard <keithp@keithp.com>
|