使能Rx_buffer,全局中断,RX中断。但是接收不到数据,如果单个字节查询读取接收数据是没问题的!并且单独发送也没问题!是不是进不了中断?哪里还需要设置呢,请各位高手指点?谢谢!本来想在RX中断中设置调用自己的中断函数,但是也不成功! 用 PUSH A PUSH X lcall _UART_Function POP X POP A 或者:#pragma interrupt_handler UART_1_RX_ISR void UART_1_RX_ISR(void) {} 都不行!困惑
void main() { M8C_EnableGInt; UART_1_CmdReset(); UART_1_IntCntl(UART_1_ENABLE_RX_INT); UART_1_Start(UART_1_PARITY_NONE); while(1) { if(UART_1_bCmdCheck()) {
if(strPtr= UART_1_szGetParam()) { UART_1_CPutString("Found valid command
Command =>"); UART_1_PutString(strPtr); UART_1_CPutString("<
Paramaters:
"); while(strPtr= UART_1_szGetParam()) { // loop on each parameter //strPtr= UART_1_szGetParam(); UART_1_CPutString(" <"); UART_1_PutString(strPtr); // Print each parameter UART_1_CPutString(">
"); } } UART_1_CmdReset(); // Reset command buffer }
} } 收不到数据
|