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

Commit

Permalink
set blocking mode to 0b10 (BLOCK_IF_FULL)
Browse files Browse the repository at this point in the history
the previous version 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 valid
  • Loading branch information
japaric committed Sep 15, 2021
1 parent 0879ce5 commit 87b9487
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 87b9487

Please sign in to comment.