mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-12-16 08:38:03 +00:00
Updated I2C for ESP32 and added mutex protection for printable serial
This commit is contained in:
@@ -4,15 +4,20 @@
|
||||
#include <sta/debug/printing/printable.hpp>
|
||||
#ifdef STA_PLATFORM_ARDUINO
|
||||
|
||||
#include <sta/mutex.hpp>
|
||||
|
||||
namespace sta
|
||||
{
|
||||
class PrintableSerial: public Printable
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Printable Serial object
|
||||
* @brief Printable implementation for Arduino Serial printing.
|
||||
*
|
||||
* @param baud The baud rate for serial printing.
|
||||
* @param mutex An optional mutex to protect the serial bus.
|
||||
*/
|
||||
PrintableSerial(unsigned long baud);
|
||||
PrintableSerial(unsigned long baud, Mutex * mutex = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Print string.
|
||||
@@ -21,6 +26,8 @@ namespace sta
|
||||
* @param length String length
|
||||
*/
|
||||
void print(const char * str, size_t length) override;
|
||||
private:
|
||||
Mutex * mutex_;
|
||||
};
|
||||
} // namespace sta
|
||||
|
||||
|
||||
Reference in New Issue
Block a user