Thread-safe Serial Communication.
More...
#include <Arduino.h>
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
Go to the source code of this file.
|
| void | safePrint (const char *message) |
| | Thread-safe print functions for serial output.
|
| |
| void | safePrint (const String &message) |
| | Thread-safe print functions for serial output.
|
| |
| void | safePrintln (const char *message) |
| | Thread-safe println functions for serial output.
|
| |
| void | safePrintln (const String &message) |
| | Thread-safe println functions for serial output.
|
| |
| void | safePrintf (const char *format,...) |
| | Thread-safe printf function for serial output.
|
| |
| template<typename T> |
| void | safePrint (const T &value) |
| | Thread-safe print function.
|
| |
| template<typename T> |
| void | safePrintln (const T &value) |
| | Thread-safe println function.
|
| |
|
|
SemaphoreHandle_t | serialMutex |
| | Serial mutex for thread-safe printing.
|
| |
Thread-safe Serial Communication.
◆ safePrint() [1/3]
| void safePrint |
( |
const char * | message | ) |
|
Thread-safe print functions for serial output.
- Parameters
-
◆ safePrint() [2/3]
| void safePrint |
( |
const String & | message | ) |
|
Thread-safe print functions for serial output.
- Parameters
-
◆ safePrint() [3/3]
template<typename T>
| void safePrint |
( |
const T & | value | ) |
|
Thread-safe print function.
- Template Parameters
-
- Parameters
-
This function safely prints a value to the serial port using a mutex to ensure thread safety. It takes a template parameter T, allowing it to handle various data types.
◆ safePrintf()
| void safePrintf |
( |
const char * | format, |
|
|
| ... ) |
Thread-safe printf function for serial output.
- Parameters
-
◆ safePrintln() [1/3]
| void safePrintln |
( |
const char * | message | ) |
|
Thread-safe println functions for serial output.
- Parameters
-
◆ safePrintln() [2/3]
| void safePrintln |
( |
const String & | message | ) |
|
Thread-safe println functions for serial output.
- Parameters
-
◆ safePrintln() [3/3]
template<typename T>
| void safePrintln |
( |
const T & | value | ) |
|
Thread-safe println function.
- Template Parameters
-
- Parameters
-
This function safely prints a value followed by a newline to the serial port using a mutex to ensure thread safety. It takes a template parameter T, allowing it to handle various data types.