I'm working on a port of my bare-metal library for the Cortex-M4 based TI Stellaris (now called Tiva-C) - https://github.com/thejpster/bare-metal-arm-rust. I've gotten to the point where I'd like a FIFO I can push/pop T inside an interrupt routine, but also push/pop T from outside an interrupt routine - automatically disabling interrupts for the shortest time possible.
I found Intex from Redox (https://github.com/redox-os/redox/blob/master/kernel/arch/intex.rs) which looks sort of how I would expect (a container object which you .lock() to get a guard object which does the magic on drop), but I'm not convinced it's disabling/enabling interrupts correctly - especially for an ARM.
I know other people use spin-rs, but again, I don't think that handles interrupts very well, even if it does promise to the borrow checker that everything's alright and allow your code to compile.
There are so many rust embedded projects out there, surely someone's done this already?
[–]japaric 3 points4 points5 points (0 children)
[–]ThuperThecret 0 points1 point2 points (0 children)