Skip to content

defmt-rtt: fix check for blocking RTT#579

Merged
bors[bot] merged 1 commit intoknurling-rs:mainfrom
jonas-schievink:fix-check-for-blocking-rtt
Sep 15, 2021
Merged

defmt-rtt: fix check for blocking RTT#579
bors[bot] merged 1 commit intoknurling-rs:mainfrom
jonas-schievink:fix-check-for-blocking-rtt

Conversation

@jonas-schievink
Copy link
Copy Markdown
Contributor

This check wasn't testing correctly whether the BLOCK_IF_FULL bit was set, leading to knurling-rs/probe-run#257 breaking probe-run.

Comment thread firmware/defmt-rtt/src/lib.rs Outdated
fn host_is_connected(channel: &Channel) -> bool {
// we assume that a host is connected if we are in blocking-mode. this is what probe-run does.
channel.flags.load(Ordering::Relaxed) == BLOCK_IF_FULL
channel.flags.load(Ordering::Relaxed) & BLOCK_IF_FULL != 0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as the first 2 bits are a 3-state bitfield (0, 1 or 2). could you change this to load & mask == BLOCK_IF_FULL where mask = 0b11?

@japaric
Copy link
Copy Markdown
Member

japaric commented Sep 15, 2021

Thanks!

bors r+

@bors
Copy link
Copy Markdown
Contributor

bors Bot commented Sep 15, 2021

Build succeeded:

@bors bors Bot merged commit fb85bc1 into knurling-rs:main Sep 15, 2021
@jonas-schievink jonas-schievink deleted the fix-check-for-blocking-rtt branch September 15, 2021 15:08
@Urhengulas Urhengulas mentioned this pull request Sep 15, 2021
5 tasks
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.

2 participants