These numbers puzzles me. Shouldn’t RxCallback1 and RxCallback2 be less or equal to MCP2515_isr? Where does these extra 81 calls come from? I’m missing something here...
Also, RxCallback2 is much bigger than Rx pkt, which means not all frames are sent to IncomingFrame. I Believe the reason is this code in can.cpp CAN_rxtask:
case CAN_rxcallback:
while (msg.body.bus->RxCallback(&msg.body.frame))
{
me->IncomingFrame(&msg.body.frame);
}
break;
Is this correct? Wouldn’t it skip calling IncomingFrame it there are only one interrupt?
I would think this is would be more appropriate:
case CAN_rxcallback:
{
bool keepOn=true;
do
{
keepOn = msg.body.bus->RxCallback(&msg.body.frame);
me->IncomingFrame(&msg.body.frame);
}while(keepOn);
}
break;
Do you agree?
But, the interrupts still stops :-( What does the 0x2040 means? And where do that number comes from?
Best regards,
Geir