The doc would be in two main sections, the first (targeted at all users) referring to Pyboard specific aspects. The second, targeted at beginners, would comprise a basic discussion of generic aspects of writing interrupt handlers. Pyboard specific topics would be:
- The emergency exception buffer.
- Need for simplicity of code (discussed further in section 2).
- The benefits of using object methods as callbacks.
- The problem of heap allocation, its consequences. Circumvention by writing to pre-allocated mutable objects. The pyb methods which support pre-allocated buffers.
- Brief note on the use of assembler to overcome the FP restriction.
- Need for short, deterministic execution time. Reasons for this - locking out lower priority interrupts, risk of re-entrancy. How to achieve it: being wary of I/O to devices other than that being serviced.
- A description of a typical ISR. How to partition the code between the ISR and the main program loop.
- An elementary discussion of concurrency issues: awareness that variables in the main loop may change unexpectedly. Perhaps with a URL for a more advanced discussion - recommendations?