nrf-rs / nrf-hal

A Rust HAL for the nRF family of devices
Apache License 2.0
503 stars 139 forks source link

Polling 802.15.4 API #355

Open oddstr13 opened 3 years ago

oddstr13 commented 3 years ago

Pretty sure this code isn't even remotely close to safe nor sane, but it does do what I need for USB-serial + radio.

Pointers for how to implement this properly, in a safe way would be greatly appreciated.

This is how I'm using the enclosed functions (I assume there's multiple sanity issues here, like the clock stuff): https://github.com/oddstr13/rust-radio-usb-dongle/blob/86842a919e3e4fbde232c6f89af5c39efeab3242/src/main.rs#L91-L115