Skip to content

Conversation

burrbull
Copy link
Member

@burrbull burrbull commented Oct 20, 2024

This looks not so beautiful like #738, but almost not breaking and allows to transfer data between writes with unsafe.

    let bits = rcc.apb1rstr().modify(|_, w| w.usart2rst().clear_bit());
    rcc.apb1rstr().write(|w| unsafe { // save on 1 read operation
        w.bits(bits).usart2rst().set_bit()
    });

@AdinAck

This comment was marked as off-topic.

@burrbull

This comment was marked as off-topic.

@AdinAck

This comment was marked as off-topic.

@AdinAck

This comment was marked as off-topic.

@burrbull

This comment was marked as off-topic.

@burrbull

This comment was marked as off-topic.

@AdinAck

This comment was marked as off-topic.

@AdinAck

This comment was marked as off-topic.

@burrbull

This comment was marked as off-topic.

@Emilgardis
Copy link
Member

Isn't this a huge change?

@burrbull
Copy link
Member Author

burrbull commented Nov 3, 2024

@Emilgardis let's merge this one too.

@Emilgardis
Copy link
Member

Hmm, I guess it shouldn't break to much, since people should have closed the expression with ;

@burrbull
Copy link
Member Author

burrbull commented Nov 3, 2024

Hmm, I guess it shouldn't break to much, since people should have closed the expression with ;

Compared to #738 this does not affect on expressions inside write, only outside.
For example in f1xx-hal there is only 18 places that require adding ;.

@burrbull burrbull added this pull request to the merge queue Nov 3, 2024
Merged via the queue into master with commit 99e3073 Nov 3, 2024
46 checks passed
@burrbull burrbull deleted the write-return-raw branch November 3, 2024 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants