Closed seken closed 6 years ago
Are you sure? A char is only one byte.
char getchar() { return uart_read(); }
stm8/uart.c
uint8_t uart_read() { while (!(UART1_SR & (1 << UART1_SR_RXNE))); return UART1_DR; }
I am not sure but I believe that the function getchar has only the same name of the one in stdio.h
In the the trunk for SDCC, the definition for getchar returns an int https://github.com/lujji/stm8-bare-min/blob/787c487f92a15fbd976b21e28b8576e0e08fe5f8/examples/UART/main.c#L19