diff options
author | Christian Gromm <christian.gromm@microchip.com> | 2016-12-08 13:51:04 +0100 |
---|---|---|
committer | Christian Gromm <christian.gromm@microchip.com> | 2016-12-08 13:51:04 +0100 |
commit | 8c5f2324d7aa61669324aec1a0ad091fe1379489 (patch) | |
tree | 29cbdcdbe3657e1400d596ec3d560a2573d80817 /Src/Console.h | |
parent | e89ba11bd9111f02a940f227cf979f1947e975ac (diff) |
src: unicens: import sources
This patch adds the source tree of the NetworkManager v3.0.4.
Additionally, it provides the needed configuration scripts.
Change-Id: I23778b51423b51a4f87741957e0fb208bceb79b3
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Diffstat (limited to 'Src/Console.h')
-rw-r--r-- | Src/Console.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/Src/Console.h b/Src/Console.h new file mode 100644 index 0000000..aab7e71 --- /dev/null +++ b/Src/Console.h @@ -0,0 +1,113 @@ +/* + * Video On Demand Samples + * + * Copyright (C) 2015 Microchip Technology Germany II GmbH & Co. KG + * + * 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 + * (at your option) 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/>. + * + * You may also obtain this software under a propriety license from Microchip. + * Please contact Microchip for further information. + * + */ + +/*----------------------------------------------------------*/ +/*! \file + * \brief This file contains C-functions starting with "Console" to provide + * process and thread safe access to the console output. + */ +/*----------------------------------------------------------*/ +#ifndef _CONSOLE_H_ +#define _CONSOLE_H_ + +#define RESETCOLOR "\033[0m" +#define GREEN "\033[0;32m" +#define RED "\033[0;31m" +#define YELLOW "\033[1;33m" +#define BLUE "\033[0;34m" + +#include <stdbool.h> + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef enum + { + PRIO_LOW = 0, + PRIO_MEDIUM = 1, + PRIO_HIGH = 2, + PRIO_ERROR = 0xFF + } ConsolePrio_t; + + /*----------------------------------------------------------*/ + /*! \brief Initializes the resources needed to synchronize between processes and threads. + * \note This function must be called before any other function of this component. + * \param synchronizeProcesses - If set to true, multiple processes using this component will synchronize their output. + * + */ + /*----------------------------------------------------------*/ + void ConsoleInit( bool synchronizeProcesses ); + + /*----------------------------------------------------------*/ + /*! \brief Destroys the resources needed to synchronize between processes and threads. + * \note After this function, any other function (except ConsoleInit) must not be called. + * + */ + /*----------------------------------------------------------*/ + void ConsoleDeinit( void ); + + + /*----------------------------------------------------------*/ + /*! \brief Sets the minimum priority to be displayed. Lower priority messages are discarded + * \param prio - The minimum priority to display + */ + /*----------------------------------------------------------*/ + void ConsoleSetPrio( ConsolePrio_t prio ); + + /*----------------------------------------------------------*/ + /*! \brief Uses the board specific PRINT mechanism and provides thread and process safety. + * + */ + /*----------------------------------------------------------*/ + void ConsolePrintf( ConsolePrio_t prio, const char *statement, ... ); + + + /*----------------------------------------------------------*/ + /*! \brief Starts to print and stay blocked after exit of this function + * + */ + /*----------------------------------------------------------*/ + void ConsolePrintfStart( ConsolePrio_t prio, const char *statement, ... ); + + /*----------------------------------------------------------*/ + /*! \brief Continue to print and stay blocked after exit of this function + * \note ConsolePrintfStart must be called before and when finished ConsolePrintfExit must be called. + * \note This function may be called multiple times. + */ + /*----------------------------------------------------------*/ + void ConsolePrintfContinue( const char *statement, ... ); + + /*----------------------------------------------------------*/ + /*! \brief Continue to print and unblock after finishing. + * \note ConsolePrintfStart must be called before. ConsolePrintfContinue may have been called before multiple times. + */ + /*----------------------------------------------------------*/ + void ConsolePrintfExit( const char *statement, ... ); + +#ifdef __cplusplus +} +#endif + +#endif //_CONSOLE_H_ |