[][src]Module kernel::debug

Support for in-kernel debugging.

For printing, this module uses an internal buffer to write the strings into. If you are writing and the buffer fills up, you can make the size of output_buffer larger.

Before debug interfaces can be used, the board file must assign them hardware:

This example is not tested
kernel::debug::assign_gpios(
    Some(&sam4l::gpio::PA[13]),
    Some(&sam4l::gpio::PA[15]),
    None,
    );

let kc = static_init!(
    capsules::console::App,
    capsules::console::App::default());
kernel::debug::assign_console_driver(Some(hail.console), kc);

Example

debug!("Yes the code gets here with value {}", i);
debug_verbose!("got here"); // includes message count, file, and line
debug_gpio!(0, toggle); // Toggles the first debug GPIO
Yes the code gets here with value 42
TOCK_DEBUG(0): /tock/capsules/src/sensys.rs:24: got here

Structs

DebugWriter

Main type that we need an immutable reference to so we can share it with the UART provider and this debug module.

DebugWriterWrapper

Wrapper type that we need a mutable reference to for the core::fmt::Write interface.

Statics

DEBUG_GPIOS
DEBUG_WRITER

Static variable that holds the kernel's reference to the debug tool. This is needed so the debug!() macros have a reference to the object to use.

INTERNAL_BUF
OUTPUT_BUF

Traits

Debug

Functions

assign_gpios
begin_debug_fmt
begin_debug_verbose_fmt
flush
get_debug_writer
panic

Tock default panic routine.

panic_banner

Lightweight prints about the current panic and kernel version.

panic_begin

Generic panic entry.

panic_blink_forever

Blinks a recognizable pattern forever.

panic_process_info

More detailed prints about all processes.

set_debug_writer_wrapper

Function used by board main.rs to set a reference to the writer.