Commit Graph

10 Commits

Author SHA1 Message Date
Damien George
dd7d2e0810 stmhal: Only use BASEPRI irq stuff if Cortex is M3 or higher. 2015-12-04 12:13:12 +00:00
Damien George
95c9cc8114 stmhal: Add raise_irq_pri and restore_irq_pri functions.
These can be used to disable only certain interrupts, ones at or above
the given priority value.
2015-12-04 11:38:23 +00:00
Dave Hylands
c8437f97ae stmhal: Increase the priority of UART IRQ.
The UARTs have no FIFOs, so if interrupts are disabled
for more than a character time (10 usec at 1 Mbit/sec)
then characters get dropped.

The overhead for handling a UART ISR is about 0.5 usec,
so even at baud rates of 1 Mbit/sec this only corresponds
to about 5% of the CPU. Lower baud rates will have less
of an impact.
2015-11-25 08:03:44 +00:00
Damien George
3cfb02f166 stmhal/irq: Set all IRQ subpriorities to 0, since they aren't used. 2015-11-24 15:56:33 +00:00
Damien George
18820471ae stmhal/irq: Add comment about SDIO priority being higher than DMA. 2015-11-24 15:51:07 +00:00
Dave Hylands
9f5486c7e2 stmhal: Put IRQs into priority order.
- added some comments to explain the priority/sub-priority.
- adds an entry for SDIO (to be used in a later patch)
- increases DMA priority above USB so that DMA can be used
  for sdcard I/O when using USB Mass Storage.
2015-11-24 09:37:25 +00:00
Dave Curtis
32b3549cce stmhal: Add symbolic #defines for interrupt levels in irq.h. 2015-11-01 23:23:39 +00:00
Damien George
1960475ed7 stmhal: Make pyb.[u]delay use systick with IRQs, busy loop otherwise.
pyb.delay and pyb.udelay now use systick if IRQs are enabled, otherwise
they use a busy loop.  Thus they work correctly when IRQs are disabled.
The busy loop is computed from the current CPU frequency, so works no
matter the CPU frequency.
2014-11-30 21:23:25 +00:00
Damien George
e5cbb70328 stmhal: Make enable_irq and disable_irq inline functions.
These functions are generally 1 machine instruction, and are used in
critical code, so makes sense to have them inline.

Also leave these functions uninverted (ie 0 means enable, 1 means
disable) and provide macro constants if you really need to distinguish
the states.  This makes for smaller code as well (combined with
inlining).

Applied to teensy port as well.
2014-08-25 13:24:33 +01:00
Dave Hylands
9480138f0c Add save/restore_irq
Factored irq functions into a separate file.
2014-08-25 12:22:11 +01:00