Near the beginning of my Rust learning adventure I wrote a small program to handle GPIO events generated by buttons.
The program implemented manual polling, with each of 7 GPIO lines being polled in separate threads. It worked smoothly but was super resource hungry (11% of CPU usage on my Pi3B+).
I rewrote it this weekend with tokio and the async feature of the gpio_cdev crate. CPU usage now sits at 0.0% with memory usage at 0.3%.
I love these moments when I can really sense how far I've come in my learning 🖤
Merveilles is a community project aimed at the establishment of new ways of speaking, seeing and organizing information — A culture that seeks augmentation through the arts of engineering and design. A warm welcome to any like-minded people who feel these ideals resonate with them.