Commit d7628e70 authored by Matthias Wenzl's avatar Matthias Wenzl
Browse files

added some hints

parent 0de2ff47
......@@ -31,6 +31,48 @@ void CANBusOffSwiHandler(UArg arg0, UArg arg1) {
int canTivaInit(CAN_Handle handle) {
Hwi_Params hwiParams;
Hwi_Handle canHwi;
Swi_Params swiParams;
Mailbox_Params mbParams;
Error_Block eb;
CANTiva_HWAttrs const *hwAttr = NULL;
CANTiva_Object *obj = NULL;
tCANBitClkParms psClkParms;
/*TODO:implement_me*/
//register isr with TI-RTOS
canHwi = Hwi_create(hwAttr->irq, CANIntHandler,&hwiParams,&eb);
if(canHwi == NULL) {
System_abort("CAN HWi creation failed");
}
//register swi to handle bus off faults
Error_init(&eb);
Swi_Params_init(&swiParams);
swiParams.priority = (int)(SwiNumPriorities-1);
swiParams.arg0 = (xdc_UArg)handle;
gCanBusOffSwi = Swi_create(CANBusOffSwiHandler, &swiParams, &eb);
if (gCanBusOffSwi == NULL) {
System_abort("busOffSwi creation failed");
}
//create per device mailbox
Error_init(&eb);
Mailbox_Params_init(&mbParams);
obj->canMb = Mailbox_create(sizeof(CANTivaMsg), 32/*number of slots in can transceiver*/, &mbParams, &eb);
if(obj->canMb == NULL) {
System_abort("CanMailbox creation failed");
}
/*TODO:implement_me*/
return CAN_SUCCESS;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment