Forum Discussion
Altera_Forum
Honored Contributor
8 years agoHandling data with alt_getchar()
Hi, I've written a short program for a nios ii (e) with a uart rs232 core, to echo a character I send from a serial terminal on a PC. I have managed to get it to work, however it appears to 're...
Altera_Forum
Honored Contributor
8 years agoHi,
alt_getchar works fine outside the loop Small C library.
# include "sys/alt_stdio.h"
# include <stdio.h>
# include "altera_avalon_uart_regs.h"
int main(){
char c;
c = alt_getchar();
printf("You entered: %c \n", c);
while (1){
}
return 0;
}
--------------------------------
democode
Check with getchar() using Normal C library. Best Regards, Anand Raj Shankar (This message was posted on behalf of Intel Corporation)