Forum Discussion
Altera_Forum
Honored Contributor
21 years agoproblem of "if" condition
I wrote a program to process data from PC through uart, but there is something wrong. <div class='quotetop'>QUOTE </div> --- Quote Start --- main() { ...... init_uart0(); ...
Altera_Forum
Honored Contributor
21 years agoHi,
define uart0_rbuf_out_cnt and uart0_rbuf_in_cnt variable as volatile, for example: volatile int uart0_rbuf_out_cnt if not, the compiler optimize these variables because they aren't managed in the main program...