ruduino icon indicating copy to clipboard operation
ruduino copied to clipboard

Differences between ports and other registers is jarring

Open shepmaster opened this issue 5 years ago • 2 comments

If I want a specific pin, I have to do both:

atmega328::port::B5::MASK;
atmega328::UCSR0B::RXCIE0.into();

This is annoying.

shepmaster avatar Jul 25 '20 13:07 shepmaster

What does the above code do? 😅

Restioson avatar Jul 25 '20 18:07 Restioson

That specific code does nothing, it’s just examples of how you would get a u8 value corresponding to a specific pin in a specific register.

In context:

https://github.com/shepmaster/rust-arduino-blink-led-no-core-with-cargo/blob/b2d612142b8112a4c70f97b4f74f62be3b9a28c3/src/main.rs#L46-L49

https://github.com/shepmaster/rust-arduino-blink-led-no-core-with-cargo/blob/b2d612142b8112a4c70f97b4f74f62be3b9a28c3/src/main.rs#L475-L481

shepmaster avatar Jul 25 '20 18:07 shepmaster