stm32-rs / stm32h7xx-hal

Peripheral access API for STM32H7 series microcontrollers
BSD Zero Clause License
210 stars 99 forks source link

Replace casts of &T to &mut T with UnsafeCell #451

Closed richardeoin closed 9 months ago

richardeoin commented 9 months ago

Specifically we cast *const T to *const UnsafeCell<T> then use the UnsafeCell::raw_get method.

richardeoin commented 9 months ago

Casts of &T to &mut T are UB. Caught by this lint.

richardeoin commented 9 months ago

Changes to the SPI implementation validated on hardware