https://docs.micropython.org/en/latest/ ... rules.html
- Where an ISR returns multiple bytes use a pre-allocated bytearray. If multiple integers are to be shared between an ISR and the main program consider an array (array.array).
Code: Select all
# -----------------------------------------
def mycallback(t):
pass.
tim = machine.Timer()
tim.init(mode = Timer.PERIODIC, period = 1000, callback = mycallback)
# -----------------------------------------------
Did the hint mean to say something other than return'? Did the hint mean to say that the ISR should update a pre-allocated memory buffer like a pre-allocated bytearray or a pre-allocated array.array? If this is not the case, how does one construct an ISR that 'returns' a pre-allocated buffer with the 'return' reserved word, and how does it get passed back via the callback function return?