Type error in Service Routine
-
I randomly get the following error:
Unhandled exception in callback handler TypeError: 'bytearray' object is not callableor
Unhandled exception in callback handler TypeError: 'slice' object is not callableThis happens in a callback which is triggerd by a pin interrupt. Defined like so:
int_pin.callback(trigger=Pin.IRQ_RISING, handler=self.handler)The callback function is a very simple method of an object:
def handler(self, arg): self.todo = TrueActually, there is no such type as
sliceorbytearrayinvolved in the callback which makes me think its a bug ...Sometimes the callback works fine for several thousands of times, some times for just a few hundreds.
After that exception the callback seems to be never called again, even tough it should have been called again.I have a main loop which looks as follows and shall handle the todos:
while True: irq = machine.disable_irq() if this.todo: this.todo = False do_this() if that.todo: that.todo = False do_that() machine.enable_irq(irq) time.sleep_us(1)Any ideas?
Oh yea, forgot to mention:
(sysname='LoPy', nodename='LoPy', release='1.6.12.b1', version='v1.8.6-593-g8e4ed0fa on 2017-04-12', machine='LoPy with ESP32', lorawan='1.0.0')
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login