//! Interface to the Low Level Debug capsule. This provides routines that are
//! useful for toolchain issues. The capsule is documented at:
//! https://github.com/tock/tock/blob/master/doc/syscalls/00008_low_level_debug.md

use crate::syscalls;

const DRIVER_NUMBER: usize = 8;

mod command_nr {
    pub const ALERT_CODE: usize = 1;
    pub const PRINT1: usize = 2;
    pub const PRINT2: usize = 3;
}

/// Use the LowLevelDebug capsule (if present) to indicate the given status
/// code. If the capsule is not present, this is a no-op.
#[inline(always)] // Improve reliability for relocation issues
pub fn low_level_status_code(code: usize) {
    let _ = syscalls::command1_insecure(DRIVER_NUMBER, command_nr::ALERT_CODE, code);
}

/// Use the LowLevelDebug capsule (if present) to print a single number. If the
/// capsule is not present, this is a no-op.
#[inline(always)] // Improve reliability for relocation issues
pub fn low_level_print1(value: usize) {
    let _ = syscalls::command1_insecure(DRIVER_NUMBER, command_nr::PRINT1, value);
}

/// Use the LowLevelDebug capsule (if present) to print two numbers. If the
/// capsule is not present, this is a no-op.
#[inline(always)] // Improve reliability for relocation issues
pub fn low_level_print2(value1: usize, value2: usize) {
    let _ = syscalls::command(DRIVER_NUMBER, command_nr::PRINT2, value1, value2);
}
