FreeRTOS Tetris
Functions
TUM Printing

Thread safe printing API. More...

Collaboration diagram for TUM Printing:

Functions

void fprints (FILE *__restrict __stream, const char *__format,...)
 Prints a formatted string to the specifed IO stream. More...
 
void prints (const char *__format,...)
 Prints a formatted string to stdout More...
 
int safePrintInit (void)
 Initializes the printing module. More...
 
void safePrintExit (void)
 Exits the printing module.
 

Safe print configuration default values

Allows for the configuration of each print messages length and the number of print messages that FreeRTOS can buffer

#define SAFE_PRINT_QUEUE_LEN   20
 
#define SAFE_PRINT_MAX_MSG_LEN   256
 
#define SAFE_PRINT_STACK_SIZE   (SAFE_PRINT_MAX_MSG_LEN * 2)
 
#define SAFE_PRINT_PRIORITY   tskIDLE_PRIORITY
 
#define SAFE_PRINT_INPUT_BUFFER_COUNT   10
 

Detailed Description

Thread safe printing API.

Provides replacements for printf and fprintf with the two functions prints and fprints, standing for "print safe".

Both functions are variadic and wrap the standard print functions, meaning their use is identical and as such the documentations for printf and fprintf can be used as reference.

The functions also allow writing to any IO stream, prints is simply a call to fprints where the IO stream is fixed to stdout,

Function Documentation

◆ fprints()

void fprints ( FILE *__restrict  __stream,
const char *  __format,
  ... 
)

#include <TUM_Print.h>

Prints a formatted string to the specifed IO stream.

Parameters
__streamIO stream to print to, eg. stdio or stderr
__formatFormatting string to be printed

◆ prints()

void prints ( const char *  __format,
  ... 
)

#include <TUM_Print.h>

Prints a formatted string to stdout

Parameters
__formatFormatting string to be printed

◆ safePrintInit()

int safePrintInit ( void  )

#include <TUM_Print.h>

Initializes the printing module.

Returns
0 on sucess