mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
drivers/ctucan: fix IRQ ctrl
This revises the post-IRQ interruption control logic so that to balance the disable/enable operations for both chardev and socketcan cases. Checked with chardev/socketcan on qemu-intel64. Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
This commit is contained in:
committed by
Lup Yuen Lee
parent
fcbd3099aa
commit
55f85dd727
@@ -970,9 +970,10 @@ static void ctucanfd_chardev_interrupt(FAR struct ctucanfd_driver_s *priv)
|
||||
|
||||
ctucanfd_putreg(&priv->devs[i], CTUCANFD_INTSTAT, stat);
|
||||
|
||||
/* Re-enable RX interrupts */
|
||||
/* Re-enable RX/TX interrupts */
|
||||
|
||||
ctucanfd_rxint(&priv->devs[i], true);
|
||||
ctucanfd_txint(&priv->devs[i], true);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_CAN_CTUCANFD_CHARDEV */
|
||||
@@ -1680,9 +1681,10 @@ static void ctucanfd_sock_interrupt_work(FAR void *arg)
|
||||
|
||||
ctucanfd_putreg(&priv->devs[i], CTUCANFD_INTSTAT, stat);
|
||||
|
||||
/* Re-enable RX interrupts */
|
||||
/* Re-enable RX/TX interrupts */
|
||||
|
||||
ctucanfd_rxint(&priv->devs[i], true);
|
||||
ctucanfd_txint(&priv->devs[i], true);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_CAN_CTUCANFD_SOCKET */
|
||||
@@ -1711,9 +1713,10 @@ static int ctucanfd_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
|
||||
if (regval != 0)
|
||||
{
|
||||
/* Disable RX interrupts until we handle all interrupts */
|
||||
/* Disable RX/TX interrupts until we are done */
|
||||
|
||||
ctucanfd_rxint(&priv->devs[i], false);
|
||||
ctucanfd_txint(&priv->devs[i], false);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user