From 87b9487852e9addf40094f18b3faf7a60f81ac36 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 15 Sep 2021 16:52:52 +0200 Subject: [PATCH] set blocking mode to 0b10 (BLOCK_IF_FULL) 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 --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index bd940c45..168a876d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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)?;