RISC-V/V003/math/avr/usart.cpp

23 lines
528 B
C++
Raw Normal View History

2024-03-11 15:05:36 +01:00
#include <stdio.h>
#include "usart.h"
extern "C" FILE mystdout;
Usart::Usart(const uint32_t _baud) noexcept : BaseLayer (), tx_ring () {
stdout = &mystdout;
}
void Usart::irq () {
}
void Usart::SetRS485 (const bool polarity) const {
}
void Usart::SetHalfDuplex (const bool on) const {
}
uint32_t Usart::Down (const char * data, const uint32_t len) {
//int n = fwrite (data, 1, len, stdout);
for (unsigned n=0; n<len; n++) putchar(data[n]);
return len;
}
extern "C" {
void __cxa_pure_virtual() { while (1); }
};