RT,
void?RF_2G4StatusCallBack(?uint8?sta?,?uint8?crc,?uint8?*rxBuf?) { ????switch(?sta?) ????{ ????case?RX_MODE_RX_DATA: ????????RF_Shut(); ????????if(?crc?==?1?) ????????{ ????????????//PRINT("crc?error\n"); ????????} ????????else?if(?crc?==?2?) ????????{ ????????????//PRINT("match?type?error\n"); ????????} ????????else ????????{ ????????????if(l_rf_read_cb?!=?NULL){ ????????????????l_rf_read_cb(rxBuf); ????????????} ????????} ????????RF_Rx(?NULL,0,?l_package_type,?0xFF?); ??????break; ??} ??//PRINT("STA:?%x\n",sta); } void?rf_read_cb(uint8_t*?ptData){ #ifdef??DEBUG_ME ????/*int?i?=?0; ????PRINT("read?data:"); ????for(i=0;i?245){ ????????PRINT("data?>?245\n"); ????????return; ????} ???? ????/*if(queue_can_write_len(&g_bt_queue)?>=?ptData[1]+2){ ????????queue_put(&g_bt_queue,ptData[1]); ????????queue_put_buff(&g_bt_queue,ptData+2,ptData[1]);//data ????}else{ ????????PRINT("queue?full\n"); ????} ????tmos_set_event(l_task_id,?SBP_MAIN_RF_EVT); ????PRINT("end\n");*/ ????memcpy(uart_send_buff,ptData+2,ptData[1]); ????UART0_SendString(?uart_send_buff,?ptData[1]); ????//PRINT("e\n"); }
一塊板子在收,并打印,一塊板子在發(fā),當(dāng)發(fā)送的板子使用while(1) tx的時(shí)候,接收的板子可能出現(xiàn)卡死,TMOS set event后再也進(jìn)不了
RF_2G4StatusCallBack
,只要把發(fā)送的板子關(guān)閉,那接收的板子立馬就正常了。
如果發(fā)送的板子,發(fā)送的時(shí)候加上延時(shí),而非while(1) tx,那么接收的板子就沒(méi)事
熱門產(chǎn)品 :
CH32L103: 32位PDUSB低功耗單片機(jī)