Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Merge #263
Browse files Browse the repository at this point in the history
263: set blocking mode to 0b10 (BLOCK_IF_FULL) r=jonas-schievink a=japaric

the previous version (after PR #257) was setting the blocking mode (first 2 bits of the flags field) to 0b11 (0b01
is what defmt-rtt uses by default) which is not a valid mode

Co-authored-by: Jorge Aparicio <[email protected]>
  • Loading branch information
bors[bot] and japaric authored Sep 15, 2021
2 parents 0879ce5 + 87b9487 commit fd606d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ fn set_rtt_to_blocking(
let channel_flags = &mut [0];
core.read_32(rtt_buffer_address, channel_flags)?;
// modify flags to blocking
const BLOCK_IF_FULL: u32 = 2;
let modified_channel_flags = channel_flags[0] | BLOCK_IF_FULL;
const MODE_MASK: u32 = 0b11;
const MODE_BLOCK_IF_FULL: u32 = 0b10;
let modified_channel_flags = (channel_flags[0] & !MODE_MASK) | MODE_BLOCK_IF_FULL;
// write flags back
core.write_word_32(rtt_buffer_address, modified_channel_flags)?;

Expand Down

0 comments on commit fd606d6

Please sign in to comment.