mirror of
https://github.com/markqvist/OpenModem.git
synced 2025-06-19 20:04:21 -04:00
Fixed stream setup io function declarations
This commit is contained in:
parent
2c80adbda4
commit
145b1154f9
3 changed files with 12 additions and 9 deletions
|
@ -19,6 +19,7 @@ void serial_init(Serial *serial) {
|
|||
UCSR0B = _BV(RXEN0) | _BV(TXEN0);
|
||||
|
||||
FILE uart0_fd = FDEV_SETUP_STREAM(uart0_putchar, uart0_getchar, _FDEV_SETUP_RW);
|
||||
//FILE uart0_fd = FDEV_SETUP_STREAM(uart0_putchar, NULL, _FDEV_SETUP_WRITE);
|
||||
|
||||
serial->uart0 = uart0_fd;
|
||||
}
|
||||
|
@ -31,12 +32,13 @@ bool serial_available(uint8_t index) {
|
|||
}
|
||||
|
||||
|
||||
void uart0_putchar(char c) {
|
||||
int uart0_putchar(char c, FILE *stream) {
|
||||
loop_until_bit_is_set(UCSR0A, UDRE0);
|
||||
UDR0 = c;
|
||||
return 1;
|
||||
}
|
||||
|
||||
char uart0_getchar(void) {
|
||||
int uart0_getchar(FILE *stream) {
|
||||
loop_until_bit_is_set(UCSR0A, RXC0);
|
||||
return UDR0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue