SaturnRingLibrary 0.6
SGL wrapper
 
Loading...
Searching...
No Matches
SRL::Debug Class Reference

Detailed Description

Debug helper.

#include <srl_debug.hpp>

Static Public Member Functions

template<typename ... Args>
static void AssertScreen (const char *message, const char *file, const char *function, Args...args)
 Breaks any further execution and shows assert screen.
 
static void Print (uint8_t x, uint8_t y, const char *text)
 Print text on screen at specific location.
 
template<typename ... Args>
static void Print (uint8_t x, uint8_t y, const char *text, Args...args)
 Print text on screen at specific location.
 
static void PrintClearLine (const uint8_t line)
 Clear screen line.
 
static void PrintClearScreen ()
 Clear whole screen from text.
 
static void PrintColorRestore ()
 Restore previous print color.
 
static void PrintColorSet (uint8_t color)
 Color of the cursor.
 
static uint8_t PrintWithWrap (uint8_t x, uint8_t y, const uint8_t fromLeft, const uint8_t fromRight, const char *text)
 Print text on screen at specific location.
 
template<typename ... Args>
static uint8_t PrintWithWrap (uint8_t x, uint8_t y, const uint8_t fromLeft, const uint8_t fromRight, const char *text, Args...args)
 Print text on screen at specific location.
 

Static Public Attributes

static constexpr bool Enabled = false
 Debug functions are disabled.
 

Member Function Documentation

◆ AssertScreen()

template<typename ... Args>
static void SRL::Debug::AssertScreen ( const char * message,
const char * file,
const char * function,
Args... args )
inlinestatic

Breaks any further execution and shows assert screen.

Parameters
messageCustom message to show
fileFile the assert happened in
functionFunction that threw the exception
argsText arguments

◆ Print() [1/2]

static void SRL::Debug::Print ( uint8_t x,
uint8_t y,
const char * text )
inlinestatic

Print text on screen at specific location.

Parameters
xOffset from left of the screen
yOffset from top of the screen
textText to print

◆ Print() [2/2]

template<typename ... Args>
static void SRL::Debug::Print ( uint8_t x,
uint8_t y,
const char * text,
Args... args )
inlinestatic

Print text on screen at specific location.

Parameters
xOffset from left of the screen
yOffset from top of the screen
textText to print
argsText arguments

◆ PrintClearLine()

static void SRL::Debug::PrintClearLine ( const uint8_t line)
inlinestatic

Clear screen line.

Parameters
lineLine number

◆ PrintColorSet()

static void SRL::Debug::PrintColorSet ( uint8_t color)
inlinestatic

Color of the cursor.

Parameters
colorCursor color index

◆ PrintWithWrap() [1/2]

static uint8_t SRL::Debug::PrintWithWrap ( uint8_t x,
uint8_t y,
const uint8_t fromLeft,
const uint8_t fromRight,
const char * text )
inlinestatic

Print text on screen at specific location.

Parameters
xOffset from left of the screen
yOffset from top of the screen
fromLeftWhere to start next line from on screen
fromRightWhere to start wrapping to next line
textText to print
Returns
Number of lines printed

◆ PrintWithWrap() [2/2]

template<typename ... Args>
static uint8_t SRL::Debug::PrintWithWrap ( uint8_t x,
uint8_t y,
const uint8_t fromLeft,
const uint8_t fromRight,
const char * text,
Args... args )
inlinestatic

Print text on screen at specific location.

Parameters
xOffset from left of the screen
yOffset from top of the screen
fromLeftWhere to start next line from on screen
fromRightWhere to start wrapping to next line
textText to print
argsText arguments
Returns
Number of lines printed