You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was just perusing the codebase here and thought I'd mention you can use bit_reverse instead of rolling your own. Specifically this guy.
The only benefit here would be to save some space if multiple people are using the same crate / version. Other option is that we request it be included in the HAL's SPI layer because I hit the same problem building a driver for a PlayStation controller where my target doesn't have hardware support for flipping the bits for me.
The text was updated successfully, but these errors were encountered:
Note that Rust (as of 1.37.0) may have support for intrinsics such as u8::reverse_bits(), at least on supporting micros (not including Cortex-M0 or M33 but including M4, M7 and others). I have not tried actually using those yet but if it can do it with a single RBIT instruction instead of a function and table of 256 bytes, that's a big win.
I was just perusing the codebase here and thought I'd mention you can use bit_reverse instead of rolling your own. Specifically this guy.
The only benefit here would be to save some space if multiple people are using the same crate / version. Other option is that we request it be included in the HAL's SPI layer because I hit the same problem building a driver for a PlayStation controller where my target doesn't have hardware support for flipping the bits for me.
The text was updated successfully, but these errors were encountered: