Open kmatch98 opened 2 years ago
This will be tough because the user code could also be accessing I2C at the same time.
Hmm.. does this mean that the I2C code would have to be rewritten to schedule the communications?
You can probably do it using a lock where the background code will wait until user code isn't using I2C.
Following on the previous discussion regarding interrupts, I am considering how to improve display response to capacitive touchscreen events.
I am considering whether it is [useful, possible] to create an event queue for I2C interrupt events.
I don't know anything about interrupt handling in CircuitPython, or CircuitPython does event scheduling, so this is just a first attempt at proposing a behavior and structure. I'm open to feedback, suggestions, clarification about what it will take to implement and the challenges to be faced.
Here's my basic thoughts on how it would work for a capacitive touchscreen:
My desired usage: I want to access a time-stamped list of touchscreen events [x, y, touch status (touch down, still-touched, touch up)].
I will pop off an touchscreen event from the queue and respond to it with a graphical change on the display (for example, reposition a rectangle on the screen).
Definition:
Action:
Event Queue elements: