Altera_Forum
Honored Contributor
16 years agoRewrite "while((rcvdata = nr_uart_rxchar((np_uart *) 0x00000800)) == -1);" for NiosII
I used to create the Nios project.
But, I am a very newcomer for Nios II. so, I want to ask you about my trouble. In Nios project, I used UART to receive the data into Nios. And I used the below code (C langauge) to do that. It can work without the problem. (rcvdata is int) ---------------------------------------------------------------------- "while((rcvdata = nr_uart_rxchar((np_uart *) 0x00000800)) == -1);" ---------------------------------------------------------------------- But, in case of Nios II, according to "Upgrading Nios Processor Systems to the Nios II Processor", it seems that the source code should be rewrited. According to page 27 of that document, the "getchar()" should be used instead of "nr_rxchar()". so, I changed the above code to ---------------------------------------------------------------------- "rcvdata = getchar();" . ---------------------------------------------------------------------- But, it seems that I did something wrong. The project cannot be built. :confused::confused::confused: Could you tell me how to correct it, please. Thank you very much in advance, and sorry for my English.