Hi all,
In a critical section of my code, I have to toggle a couple of pins in assembly, because speed/accuracy is essential. I have separated this part of the code in a single function (I don't care about the overhead of calling the function), and decorated it with @micropython.asm_thumb
But this is useful only, if absolutely no interrupts occur while the function is being executed. I can, of course, call disable_irq() and enable_irq() immediately before, and after the function, but this is not particularly elegant, and even worse, prone to errors. I think it would be much better, if I could enable/disable the interrupts in the function that is decorated. What would be the assembler equivalent of the two above-mentioned functions?
Thanks,
Zoltán
enabling/disabling interrupts in assembly
Re: enabling/disabling interrupts in assembly
Look here on the use of cpsie() and cpsid():
http://docs.micropython.org/en/latest/p ... _misc.html
http://docs.micropython.org/en/latest/p ... _misc.html
Re: enabling/disabling interrupts in assembly
Robert,
Thanks for the pointer!
Zoltán
Thanks for the pointer!
Zoltán