[En-Nut-Discussion] CAN128: AvrCanOvrIrqCtl and AvrCanTxIrqCtl
Henrik Maier
hmlists at focus-sw.com
Tue Feb 28 01:47:53 CET 2006
Thank you for pointing this out.
Nut/OS 4.0 introduced changes to the way IRQs are managed. The CAN IRQ
functions have not yet been updated in the CVS in this regard, hence the
empty functions. I will check them into the CVS in the next few days.
Here is the required implementation for arch/avr/dev/ivect35.c:
int AvrCanTxIrqCtl(int cmd, void *param)
{
int rc = 0;
u_int *ival = (u_int *) param;
int enabled = bit_is_set(CANGIE, ENIT);
/* Disable interrupt. */
cbi(CANGIE, ENIT);
switch (cmd) {
case NUT_IRQCTL_INIT:
case NUT_IRQCTL_DISABLE:
enabled = 0;
break;
case NUT_IRQCTL_ENABLE:
enabled = 1;
break;
case NUT_IRQCTL_GETPRIO:
*ival = 0;
break;
#ifdef NUT_PERFMON
case NUT_IRQCTL_GETCOUNT:
*ival = (u_int) sig_CAN_TRANSFER.ir_count;
sig_CAN_TRANSFER.ir_count = 0;
break;
#endif
default:
rc = -1;
break;
}
/* Enable interrupt. */
if (enabled) {
sbi(CANGIE, ENIT);
}
return rc;
}
Henrik
http://www.proconx.com
More information about the En-Nut-Discussion
mailing list