mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-12-18 09:18:02 +00:00
Big assert / debug clean up
This commit is contained in:
25
src/debug/printing/printable_uart.cpp
Normal file
25
src/debug/printing/printable_uart.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <sta/debug/printing/printable_uart.hpp>
|
||||
|
||||
#include <sta/debug/assert.hpp>
|
||||
#include <sta/printf.hpp>
|
||||
|
||||
#include <cinttypes>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
|
||||
PrintableUART::PrintableUART(UART * intf)
|
||||
: intf_{intf}
|
||||
{
|
||||
STA_ASSERT(intf != nullptr);
|
||||
STA_ASSERT(intf->settings().mode == UARTMode::RX || intf->settings().mode == UARTMode::RX_TX);
|
||||
}
|
||||
|
||||
void PrintableUART::print(const char * str, size_t length)
|
||||
{
|
||||
intf_->transfer(reinterpret_cast<const uint8_t *>(str), length);
|
||||
}
|
||||
|
||||
} // namespace sta
|
||||
Reference in New Issue
Block a user