Closed dzervas closed 4 years ago
The buffers need to have 'static
lifetime because the radio uses DMA to access them. This is somewhat tricky to handle correctly, since the BleRadio
can be dropped or leaked while the radio still has access to the buffer, so it might write to deallocated memory if we don't require a 'static
lifetime there.
hmm, ok, that covers my question. I guess it's a difficult problem to solve - if I do happen to solve it, I'll make an MR.
https://github.com/jonas-schievink/rubble/blob/17bb8bd292bfe644f85aa185358ff9107df9fd2d/rubble-nrf5x/src/radio.rs#L74-L80
I'm not any kind of a guru in Rust and I'm trying to get rubble to play without
rtic
(btw: it works! :tada: ). The only hacky thing I had to do was this:I don't get why BleRadio would require
'static
- you need the references to be alive as long BleRadio instance is alive - no?If there's no particular reason, do you want me to open an MR?
BTW: GREAT, FUCKING GREAT work, thank you for your project