aboutsummaryrefslogtreecommitdiff
path: root/stmhal/irq.h
AgeCommit message (Collapse)Author
2017-09-06ports: Make new ports/ sub-directory and move all ports there.Damien George
This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.
2017-07-31all: Use the name MicroPython consistently in commentsAlexander Steffen
There were several different spellings of MicroPython present in comments, when there should be only one.
2017-07-18all: Unify header guard usage.Alexander Steffen
The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h
2017-06-22stmhal: Add "quiet timing" enter/exit functions.Damien George
They disable all interrupts except for SysTick and are useful for doing certain low-level timing operations.
2017-03-22stmhal/irq: Shift IRQ priorities of TIM and EXTINT to be above PENDSV.Damien George
This way, Timer and ExtInt callbacks can interrupt the low-priority pendsv handler (for example thread switching).
2016-10-21py: Be more specific with MP_DECLARE_CONST_FUN_OBJ macros.Damien George
In order to have more fine-grained control over how builtin functions are constructed, the MP_DECLARE_CONST_FUN_OBJ macros are made more specific, with suffix of _0, _1, _2, _3, _VAR, _VAR_BETEEN or _KW. These names now match the MP_DEFINE_CONST_FUN_OBJ macros.
2016-08-22stmhal: Remove obsolete code for special handling of TIM3 irq settings.Damien George
TIM3 is no longer special, or at least does not have special IRQ settings.
2015-12-22stmhal: Add pyb.irq_stats() to get statistics about IRQ calls.Damien George
Adds a lot of code, makes IRQs a bit less efficient, but is very useful for debugging. Usage: pyb.irq_stats() returns a memory view that can be read and written, eg: list(pyb.irq_stats()) pyb.irq_stats()[0] pyb.irq_stats()[0] = 0 The patch provides general IRQ_ENTER() and IRQ_EXIT() macros that can be modified to provide further IRQ statistics if desired.
2015-12-04stmhal: Only use BASEPRI irq stuff if Cortex is M3 or higher.Damien George
2015-12-04stmhal: Add raise_irq_pri and restore_irq_pri functions.Damien George
These can be used to disable only certain interrupts, ones at or above the given priority value.
2015-11-25stmhal: Increase the priority of UART IRQ.Dave Hylands
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-24stmhal/irq: Set all IRQ subpriorities to 0, since they aren't used.Damien George
2015-11-24stmhal/irq: Add comment about SDIO priority being higher than DMA.Damien George
2015-11-24stmhal: Put IRQs into priority order.Dave Hylands
- 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-01stmhal: Add symbolic #defines for interrupt levels in irq.h.Dave Curtis
2014-11-30stmhal: Make pyb.[u]delay use systick with IRQs, busy loop otherwise.Damien George
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-08-25stmhal: Make enable_irq and disable_irq inline functions.Damien George
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-25Add save/restore_irqDave Hylands
Factored irq functions into a separate file.