File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -712,7 +712,7 @@ Initial release
712712
713713### [ defmt-rtt-next]
714714
715- * No changes
715+ * [ # 968 ] Add ` in_blocking_mode ` public method
716716
717717### [ defmt-rtt-v1.0.0] (2025-04-01)
718718
@@ -947,6 +947,7 @@ Initial release
947947
948948---
949949
950+ [ #968 ] : https://github.com/knurling-rs/defmt/pull/968
950951[ #965 ] : https://github.com/knurling-rs/defmt/pull/965
951952[ #960 ] : https://github.com/knurling-rs/defmt/pull/960
952953[ #959 ] : https://github.com/knurling-rs/defmt/pull/959
Original file line number Diff line number Diff line change @@ -93,6 +93,17 @@ static _SEGGER_RTT: Header = Header {
9393 } ,
9494} ;
9595
96+ /// Report whether the SEGGER RTT up channel is in blocking mode.
97+ ///
98+ /// Returns true if the mode bitfield within the flags value has been set to
99+ /// `SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL`.
100+ ///
101+ /// Currently we start-up in non-blocking mode, so if it's been set to blocking
102+ /// mode then the connected client (e.g. probe-rs) must have done it.
103+ pub fn in_blocking_mode ( ) -> bool {
104+ ( _SEGGER_RTT. up_channel . flags . load ( Ordering :: Relaxed ) & MODE_MASK ) == MODE_BLOCK_IF_FULL
105+ }
106+
96107/// Our shared buffer
97108#[ cfg_attr( target_os = "macos" , link_section = ".uninit,defmt-rtt.BUFFER" ) ]
98109#[ cfg_attr( not( target_os = "macos" ) , link_section = ".uninit.defmt-rtt.BUFFER" ) ]
You can’t perform that action at this time.
0 commit comments