adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
MIT License
3.96k stars 1.16k forks source link

Move nRF touchio implementation to shared modules #1517

Closed tannewt closed 4 years ago

tannewt commented 5 years ago

It can be used generically.

nickzoic commented 5 years ago

Yeah, there's no particular reason which makes this specific to nRF.

I'd also say if I was going to rewrite this I'd use a timer or interrupt handler on the falling edge of the pin instead of busy-waiting. The current way is crude but effective :-/, given the microsecond timing involved not all bad but it'd be worth trying to be a little more clever ...

tannewt commented 5 years ago

Crude but effective is also more portable. We currently don't have a common way of doing timers and interrupts across ports.

nickzoic commented 5 years ago

Crude but effective is also more portable. We currently don't have a> common way of doing timers and interrupts across ports.

Yeah, that's true: I went with the simplest possible approach since I hadn't really looked at the GPIOTE functionality yet. It might be worth developing some kind of abstraction though, in the longer run ...

tannewt commented 5 years ago

Yup, we can add an abstraction when it'd be useful.

ladyada commented 4 years ago

@dhalbert this is done right?

dhalbert commented 4 years ago

@ladyada Yes, it's been merged, available in the latest S3 builds for both nRF and SAMD51.