|
@@ -4,6 +4,7 @@
|
|
#include <avr/interrupt.h>
|
|
#include <avr/interrupt.h>
|
|
#include <avr/pgmspace.h>
|
|
#include <avr/pgmspace.h>
|
|
#include "rbuf.h"
|
|
#include "rbuf.h"
|
|
|
|
+#include "macros.h"
|
|
|
|
|
|
#define UART2_BAUD 115200
|
|
#define UART2_BAUD 115200
|
|
#define UART_BAUD_SELECT(baudRate,xtalCpu) (((float)(xtalCpu))/(((float)(baudRate))*8.0)-1.0+0.5)
|
|
#define UART_BAUD_SELECT(baudRate,xtalCpu) (((float)(xtalCpu))/(((float)(baudRate))*8.0)-1.0+0.5)
|
|
@@ -16,7 +17,7 @@ uint8_t uart2_ibuf[14] = {0, 0};
|
|
FILE _uart2io = {0};
|
|
FILE _uart2io = {0};
|
|
|
|
|
|
|
|
|
|
-int uart2_putchar(char c, FILE *stream __attribute__((unused)))
|
|
|
|
|
|
+int uart2_putchar(char c, _UNUSED FILE *stream)
|
|
{
|
|
{
|
|
while (!uart2_txready);
|
|
while (!uart2_txready);
|
|
UDR2 = c; // transmit byte
|
|
UDR2 = c; // transmit byte
|
|
@@ -25,7 +26,7 @@ int uart2_putchar(char c, FILE *stream __attribute__((unused)))
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-int uart2_getchar(FILE *stream __attribute__((unused)))
|
|
|
|
|
|
+int uart2_getchar(_UNUSED FILE *stream)
|
|
{
|
|
{
|
|
if (rbuf_empty(uart2_ibuf)) return -1;
|
|
if (rbuf_empty(uart2_ibuf)) return -1;
|
|
return rbuf_get(uart2_ibuf);
|
|
return rbuf_get(uart2_ibuf);
|