FreeRTOS Tetris
Data Structures | Functions | Variables
TUM_Print.c File Reference

A couple of drop in replacements for printf and fprintf to be used for thread safe printing when using FreeRTOS. More...

#include <stdarg.h>
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
#include "semphr.h"
#include "TUM_Print.h"
#include "TUM_Utils.h"
Include dependency graph for TUM_Print.c:

Data Structures

struct  error_print_msg
 

Functions

static void vfprints (FILE *__restrict __stream, const char *__format, va_list args)
 
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...
 
static void safePrintTask (void *pvParameters)
 
int safePrintInit (void)
 Initializes the printing module. More...
 
void safePrintExit (void)
 Exits the printing module.
 

Variables

char rbuf_buffer [sizeof(struct error_print_msg) *SAFE_PRINT_INPUT_BUFFER_COUNT] = { 0 }
 
rbuf_handle_t input_rbuf = NULL
 
xQueueHandle safePrintQueue = NULL
 
xTaskHandle safePrintTaskHandle = NULL
 

Detailed Description

A couple of drop in replacements for printf and fprintf to be used for thread safe printing when using FreeRTOS.

Author
Alex Hoffman
Date
18 April 2020
----------------------------------------------------------------------
Copyright (C) Alexander Hoffman, 2020
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
----------------------------------------------------------------------