def rfid_tick(timer):
if rfid_port.any():
beep_on()
start_ns_delay()
def start_rfid_tick():
tim = pyb.Timer(4,freq=5)
tim.callback(rfid_tick)
uncaught exception in Timer(4) interrupt handler
MemoryError:
uncaught Timer
Re: uncaught Timer
You can get more detailed information on the exception by doing:
Code: Select all
import micropython
micropython.alloc_emergency_exception_buf(100)
-
- Posts: 31
- Joined: Wed Dec 02, 2015 1:47 pm
Re: uncaught Timer
dhylands wrote:You can get more detailed information on the exception by doing:Code: Select all
import micropython micropython.alloc_emergency_exception_buf(100)
what is 'heap is locked'?
Re: uncaught Timer
The heap is locked (i.e. you can't allocate or free from it) while an interrupt handler is running.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: uncaught Timer
In a nutshell you can't allocate memory in an interrupt handler. The rues on how to write interrupt handlers are explained here: http://docs.micropython.org/en/latest/p ... rules.html.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.