Page 2 of 2

Re: Multithreading-like ideas?

Posted: Fri Mar 17, 2017 4:50 pm
by Roberthh
I did not put too much in the timer code which would be disallowed in an ISR. Only stuff like:

Code: Select all

data = self.i2c.readfrom(self.address, 2)
or

Code: Select all

return ustruct.unpack('>h', data)[0]
which returns create or return newly allocated data objects. But in a later version I avoided that, allowing the code to be executed in a Pin ISR handler.