| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
| |
This provides nano-second resolution times by reading the systick
value (which runs at 250ns ticks on stm).
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This saves a bit of space in the fox1ihu loader which uses the timer
interrupt to poke the watchdog.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
The ADC unit always uses the HSI timer.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
Because the STM32L only offers 16 priority levels, the bottom four
bits of each priority mask are not used. All of the interrupt priority
settings in the system were using values < 16, making them all
effectively the same. Fix that by moving them into the upper 4 bits
and using symbolic constants everywhere.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
We use a separate stack pointer for task code, which means we can
verify that it is in range in any interrupt handler. This adds checks
for the task stack (under #ifdef DEBUG) that run in ao_wakeup as well
as at every timer interrupt.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Redirects data input from local sensors to USB sourced data, leaving
USB enabled when the computer goes into pad mode.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This makes it possible to reflash the board without needing to disable
the watchdog.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
Need to ensure that the CPU is actually using the MSI during timer
init or all of the other clock changes won't work
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Stuff from when we weren't using systick
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This removes all of the support for the base 100Hz timer from the
system, saving space when not needed
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
It's probably more power efficient than using one of the timers, and
it's certainly easier to configure.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Cache the next wakeup time and check that before jumping to the task
code.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
This replaces the array-based scheduler with a queue-based one
instead. It should have the same basic scheduling semantics, but it
walks shorter lists for each operation, making it much more efficient
when the system has a lot of tasks.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sdcc offers __critical as a machine-independent way to block
interrupts, but as gcc doesn't, we need to use a compiler-independent
construct instead. ao_arch_critical has been around since the AVR
port, but some old __critical usages remained.
This fixes a bunch of random hangs when communicating with MM over USB
or the radio as the various stdio loops were running without
interrupts blocked between the test and the sleep.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This was used to debug the clock bringup, but is not useful anymore,
and probably a bad idea to boot.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Counting from 0 to 100 takes 10.1ms, so count to 99 instead.
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>
|
|
|
|
|
|
|
| |
This has each sensor mark a bit in the current data record which is
then sent for processing when all of the data are present.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
With this, a single task can wait for any button or quadrature input
device.
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
For some weird reason, a non-unity perhipheral bus clock scaler
affects the base of the various timers; this left the 100Hz tick
running at 200Hz.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
Clean all of the RCC configuration up after turning on the clocks.
Use the MSI clock during initialization to avoid messing around with
the HSI clock temporarily.
Allow for an external clock on the HSE line.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
| |
This moves all of the STM clock configuration into ao_pins.h so that
each product can configure it separately. While doing this, I
discovered that the flash memory mode (64-bit, prefetch, latency 1)
wasn't actually getting set, which is why the CPU refused to work at
32MHz.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This gets stm-demo working
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This runs AltOS and talks over the serial port.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
The stm-bringup doesn't run altos, it just initializes the device and
writes stuff over a serial port. Works on the STM32L Discovery board
at least, should do stuff on other boards too.
Signed-off-by: Keith Packard <keithp@keithp.com>
|