skullc-peripherals/Utility/Inc/utility_uartlogger.hpp
Erki d945e7a799
Some checks failed
continuous-integration/drone/push Build is failing
Add basic logging framework with a global logger
2021-03-20 23:22:17 +02:00

40 lines
628 B
C++

/*
* utility_uartlogger.hpp
*
* Created on: Mar 20, 2021
* Author: erki
*/
#ifndef SKULLC_UTILITY_UARTLOGGER_HPP_
#define SKULLC_UTILITY_UARTLOGGER_HPP_
#include "utility_logging.hpp"
#include "usart.h"
#include <array>
namespace Utility
{
class UARTLogger : public ILogger
{
public:
explicit UARTLogger(UART_HandleTypeDef* huart);
UARTLogger() = delete;
UARTLogger(const UARTLogger&) = delete;
UARTLogger(UARTLogger&&) = delete;
void log(const char* format, ...) override;
private:
UART_HandleTypeDef* _huart;
std::array<char, 255> _buffer;
};
}
#endif /* SKULLC_UTILITY_UARTLOGGER_HPP_ */