叮当物联

高亮测试

CAN任务


void CAN_Task( void *pvParameters ){
    (void)pvParameters;

    //frame buffer
    CAN_frame_t __RX_frame;

    //create CAN RX Queue
    CAN_cfg.rx_queue = xQueueCreate(10,sizeof(CAN_frame_t));

    //start CAN Module
    CAN_init();
    DEBUG_LOGI(LOGTAG,"Can Init done - wait now..\n");
    while (1){
        //receive next CAN frame from queue
        if(xQueueReceive(CAN_cfg.rx_queue,&__RX_frame, 3*portTICK_PERIOD_MS)==pdTRUE){
            DEBUG_LOGI(LOGTAG,"Frame from : 0x%08x, DLC %d \n", __RX_frame.MsgID, __RX_frame.FIR.B.DLC);
            DEBUG_LOGI(LOGTAG,"D0: 0x%02x, ", __RX_frame.data.u8[0]);
            DEBUG_LOGI(LOGTAG,"D1: 0x%02x, ", __RX_frame.data.u8[1]);
            DEBUG_LOGI(LOGTAG,"D2: 0x%02x, ", __RX_frame.data.u8[2]);
            DEBUG_LOGI(LOGTAG,"D3: 0x%02x, ", __RX_frame.data.u8[3]);
            DEBUG_LOGI(LOGTAG,"D4: 0x%02x, ", __RX_frame.data.u8[4]);
            DEBUG_LOGI(LOGTAG,"D5: 0x%02x, ", __RX_frame.data.u8[5]);
            DEBUG_LOGI(LOGTAG,"D6: 0x%02x, ", __RX_frame.data.u8[6]);
            DEBUG_LOGI(LOGTAG,"D7: 0x%02x\n", __RX_frame.data.u8[7]);
            DEBUG_LOGI(LOGTAG,"==============================================================================\n");

            //loop back frame
            // CAN_write_frame(&__RX_frame);
        }
    }
}
<?php echo 'hello jrotty!'; ?>

删除上边代码中的

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »