rust-embedded-community / tm4c-hal

An Embedded HAL and general chip support for the TM4C123/LM4F120. Replaces the old lm4f120 crate.
Apache License 2.0
40 stars 26 forks source link

Making serial code shared... #18

Closed thejpster closed 5 years ago

thejpster commented 5 years ago

Interesting problem while making the serial code shared...

https://docs.rs/tm4c129x/0.7.0/tm4c129x/uart0/dr/struct._DATAW.html is safe. https://docs.rs/tm4c123x/0.7.0/tm4c123x/uart0/dr/struct._DATAW.html is unsafe.

I either get "need unsafe to call this function" or "unnecessary unsafe block".

thejpster commented 5 years ago

Same with

https://docs.rs/tm4c123x/0.7.0/tm4c123x/uart0/ibrd/struct._DIVINTW.html and https://docs.rs/tm4c129x/0.7.0/tm4c129x/uart0/ibrd/struct._DIVINTW.html

thejpster commented 5 years ago

Hmm, actually, it seems OK with the unsafe block regardless.