引用:
|
作者booger
還是不懂哪裡錯了
void uart_read_char(char *ch){
...
*ch=SBUF;
uart_write_char(*ch);
}
|
"*ch=SBUF"
ch is pointing to SBUF which I assume is a memory-mapped register mapped to the output of the UART input buffer. Once you read it the buffer pushes out the valid data, so the output now is the next item in the buffer (invalid data?)
uart_write_char(*ch) then obviously ends up writing the wrong value.
我很久沒寫embedded c了..好像是這樣