40 lines
628 B
C++
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_ */
|