FreeRTOS Emulator with SDL2 Based Graphics and Input Library  1.0
A POSIX wrapper to run FreeRTOS on an x86 machine with some basic input and output libraries aimed at making teaching FreeRTOS simpler.
gfx_print.h
Go to the documentation of this file.
1 
26 #ifndef __GFX_PRINT_H__
27 #define __GFX_PRINT_H__
28 
29 #include <stdio.h>
30 
57 #ifndef SAFE_PRINT_QUEUE_LEN
58 #define SAFE_PRINT_QUEUE_LEN 20
59 #endif // SAFE_PRINT_QUEUE_LEN
60 #ifndef SAFE_PRINT_MAX_MSG_LEN
61 #define SAFE_PRINT_MAX_MSG_LEN 256
62 #endif // SAFE_PRINT_QUEUE_LEN
63 #ifndef SAFE_PRINT_STACK_SIZE
64 #define SAFE_PRINT_STACK_SIZE (SAFE_PRINT_MAX_MSG_LEN * 2)
65 #endif // SAFE_PRINT_STACK_SIZE
66 #ifndef SAFE_PRINT_PRIORITY
67 #define SAFE_PRINT_PRIORITY tskIDLE_PRIORITY
68 #endif // SAFE_PRINT_PRIORITY
69 #ifndef SAFE_PRINT_INPUT_BUFFER_COUNT
70 #define SAFE_PRINT_INPUT_BUFFER_COUNT 10
71 #endif // SAFE_PRINT_INPUT_BUFFER_COUNT
72 //Uncomment to embed print debug ID's into messages
73 // #define SAFE_PRINT_DEBUG
76 #define PRINT_ERROR(msg, ...) \
77  fprintf(stderr, "[ERROR] " msg, ##__VA_ARGS__); \
78  fprintf(stderr, " @-> %s:%d, %s\n", __FILE__, __LINE__, __func__)
79 #define PRINT_TASK_ERROR(task) PRINT_ERROR("Failed to print task ##task");
80 
87 void fprints(FILE *__restrict __stream, const char *__format, ...);
88 
94 void prints(const char *__format, ...);
95 
101 int gfxSafePrintInit(void);
102 
106 void gfxSafePrintExit(void);
107 
110 #endif // __GFX_PRINT_H__
int gfxSafePrintInit(void)
Initializes the printing module.
Definition: gfx_print.c:126
void prints(const char *__format,...)
Prints a formatted string to stdout
Definition: gfx_print.c:104
void fprints(FILE *__restrict __stream, const char *__format,...)
Prints a formatted string to the specifed IO stream.
Definition: gfx_print.c:96
void gfxSafePrintExit(void)
Exits the printing module.
Definition: gfx_print.c:160