Convert uart2.c to a C++ file

This commit is contained in:
gudnimg 2024-11-24 09:28:26 +00:00 committed by 3d-gussner
parent 6b01929382
commit d3f95592c1
3 changed files with 3 additions and 13 deletions

View File

@ -268,7 +268,7 @@ set(FW_SOURCES
tmc2130.cpp tmc2130.cpp
tone04.c tone04.c
twi.cpp twi.cpp
uart2.c uart2.cpp
ultralcd.cpp ultralcd.cpp
util.cpp util.cpp
xflash.c xflash.c

View File

@ -10,7 +10,7 @@
#define uart2_txready (UCSR2A & (1 << UDRE2)) #define uart2_txready (UCSR2A & (1 << UDRE2))
uint8_t uart2_ibuf[20] = {0, 0}; uint8_t uart2_ibuf[20] = {0, 0};
FILE _uart2io = {0}; FILE _uart2io;
static int uart2_putchar(char c, _UNUSED FILE *stream) static int uart2_putchar(char c, _UNUSED FILE *stream)
{ {

View File

@ -5,19 +5,9 @@
#include <inttypes.h> #include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#if defined(__cplusplus)
extern "C" {
#endif //defined(__cplusplus)
extern FILE _uart2io; extern FILE _uart2io;
#define uart2io (&_uart2io) #define uart2io (&_uart2io)
void uart2_init(uint32_t baudRate);
extern void uart2_init(uint32_t baudRate);
#if defined(__cplusplus)
}
#endif //defined(__cplusplus)
#endif //_UART2_H #endif //_UART2_H