@@ -303,12 +303,20 @@ impl Task {
303303 }
304304 }
305305
306+ /// Get the minimum amount of stack that was ever left on this task in words.
306307 #[ cfg( feature = "stack_high_water" ) ]
307- /// Get the minimum amount of stack that was ever left on this task.
308+ # [ inline ]
308309 pub fn get_stack_high_water_mark ( & self ) -> u32 {
309310 unsafe { freertos_rs_get_stack_high_water_mark ( self . task_handle ) as u32 }
310311 }
311312
313+ /// Get the minimum amount of stack that was ever left on this task in bytes.
314+ #[ cfg( feature = "stack_high_water" ) ]
315+ #[ inline]
316+ pub fn get_stack_high_water_mark_bytes ( & self ) -> u32 {
317+ self . get_stack_high_water_mark ( ) * 4
318+ }
319+
312320 pub fn get_id ( & self ) -> Result < FreeRtosBaseType , FreeRtosError > {
313321 let task_id = unsafe { freertos_rs_uxTaskGetTaskNumber ( self . task_handle ) } ;
314322 if task_id == 0 {
@@ -347,11 +355,19 @@ impl CurrentTask {
347355 unsafe { freertos_rs_task_notify_take ( if clear { 1 } else { 0 } , wait_for. to_ticks ( ) ) }
348356 }
349357
350- #[ cfg( feature = "stack_high_water" ) ]
351358 /// Get the minimum amount of stack that was ever left on the current task.
359+ #[ cfg( feature = "stack_high_water" ) ]
360+ #[ inline]
352361 pub fn get_stack_high_water_mark ( ) -> u32 {
353362 unsafe { freertos_rs_get_stack_high_water_mark ( 0 as FreeRtosTaskHandle ) as u32 }
354363 }
364+
365+ /// Get the minimum amount of stack that was ever left on this task in bytes.
366+ #[ cfg( feature = "stack_high_water" ) ]
367+ #[ inline]
368+ pub fn get_stack_high_water_mark_bytes ( ) -> u32 {
369+ Self :: get_stack_high_water_mark ( ) * 4
370+ }
355371}
356372
357373#[ derive( Debug ) ]
0 commit comments