Custom printf: Definitions and Prototypes More...
Functions | |
void | CPrintf_select_file (FILE *f) |
uint16_t | CPrintf_select_output (uint16_t device) |
void | CPrintfActivateOutput (void) |
activate all initialized output devices More... | |
int | CPuts (const char *_ptr) |
int | CPrintf (const char *_format,...) |
Custom printf function. More... | |
void | CPrintChar (const char symbol, size_t count) |
Custom print char function. More... | |
Variables | |
uint16_t | output_device |
Select active output device. More... | |
const char * | CPrintfMessages [] |
_ _ _ __| | ___(_) ____ _ __ | |_ / _` | / __| |/ _` | '_ \| __| | (_| | _ \__ \ | (_| | | | | |_ \__,_|(_) ___/_|\__, |_| |_|\__| Signalprocessing |___/ Technology
#define CPRINTF_CODE_SECTION ".cprintftext" |
#define CPRINTF_BUFFER_SIZE 512 |
CPrintf buffer size
#define CPRINTF_LINEBUFFER_SIZE 80 |
#define CPRINTF_NO_OUTPUT 0x0 |
define available CPrintf Outputs
#define CPRINTF_CCS_OUTPUT (1<<COM_DEV_CCS) |
#define CPRINTF_CCS_BIT CPRINTF_CCS_OUTPUT |
#define CPRINTF_UART_OUTPUT (1<<COM_DEV_UART) |
#define CPRINTF_UART_BIT CPRINTF_UART_OUTPUT |
#define CPRINTF_USB_BIT 0x0 |
#define CPRINTF_NET_BIT 0x0 |
#define CPRINTF_TELNET_BIT 0x0 |
#define CPRINTF_FILE_BIT 0x0 |
#define CPRINTF_CDC_BIT 0x0 |
#define CPRINTF_OUTPUT_MASK |
#define VT100_TERMINAL 1 |
#define VT100_BLACK "\x1B[30m" |
#define VT100_RED "\x1B[31m" |
#define VT100_GREEN "\x1B[32m" |
#define VT100_YELLOW "\x1B[33m" |
#define VT100_BLUE "\x1B[34m" |
#define VT100_MAGENTA "\x1B[35m" |
#define VT100_CYAN "\x1B[36m" |
#define VT100_WHITE "\x1B[37m" |
#define VT100_DEFAULT "\x1B[30m" |
#define VT100_BLACK_BACK "\x1B[40m" |
#define VT100_RED_BACK "\x1B[41m" |
#define VT100_GREEN_BACK "\x1B[42m" |
#define VT100_YELLOW_BACK "\x1B[43m" |
#define VT100_BLUE_BACK "\x1B[44m" |
#define VT100_MAGENTA_BACK "\x1B[45m" |
#define VT100_CYAN_BACK "\x1B[46m" |
#define VT100_WHITE_BACK "\x1B[47m" |
#define CLRSCR "\x1B[2J\x1B[H" |
#define CLRLINE "\x1B[79D\x1B[2K" |
#define CRLF "\r\n" |
#define CPRINTF_PROGRESS_COL 52 |
#define CPrintfProgress | ( | s | ) |
print string with trailing dots ".....". The dots will end at line CPRINTF_PROGRESS_COL
#define CPrintfProgressVar | ( | s | ) |
print variadic string with trailing dots ".....". The dots will end at line CPRINTF_PROGRESS_COL.
use with double parentheses:
#define PRINT_SPACER |
#define CPrintfProgressSuccess | ( | ) | (CPuts(CPrintfMessages[1])) |
print progress success message. On VT100 terminals this message is printed in green.
#define CPrintfProgressError | ( | ) | (CPuts(CPrintfMessages[2])) |
#define CPrintfProgressSkipped | ( | ) | (CPuts(CPrintfMessages[3])) |
void CPrintf_select_file | ( | FILE * | f | ) |
void CPrintfActivateOutput | ( | void | ) |
- |
int CPuts | ( | const char * | _ptr | ) |
int CPrintf | ( | const char * | _format, |
... | |||
) |
_format | - format string |
void CPrintChar | ( | const char | symbol, |
size_t | count | ||
) |
symbol | - character to print |
count | - repeat count |
output_device |
Used to select the CPrintf() outputs. Use defines
const char* CPrintfMessages[] |