SAMV71-XULT: Add call to can_txready() to MCAN driver. This is part of a fix to a CAN hang problem

This commit is contained in:
Gregory Nutt 2015-11-03 10:47:37 -06:00
parent c90876ff9c
commit 1299160d1d
2 changed files with 16 additions and 0 deletions

View File

@ -223,6 +223,7 @@ config SAMV7_MCAN0
bool "CAN controller 0 (MCAN0)" bool "CAN controller 0 (MCAN0)"
default n default n
select CAN select CAN
select CAN_TXREADY
select SAMV7_MCAN select SAMV7_MCAN
config SAMV7_MCAN1 config SAMV7_MCAN1
@ -230,6 +231,7 @@ config SAMV7_MCAN1
default n default n
depends on SAMV7_HAVE_MCAN1 depends on SAMV7_HAVE_MCAN1
select CAN select CAN
select CAN_TXREADY
select SAMV7_MCAN select SAMV7_MCAN
config SAMV7_DAC0 config SAMV7_DAC0

View File

@ -128,6 +128,12 @@
# endif # endif
#endif #endif
/* General Configuration ****************************************************/
#ifndef CONFIG_CAN_TXREADY
# warning WARNING!!! CONFIG_CAN_TXREADY is required by this driver
#endif
/* MCAN0 Configuration ******************************************************/ /* MCAN0 Configuration ******************************************************/
#ifdef CONFIG_SAMV7_MCAN0 #ifdef CONFIG_SAMV7_MCAN0
@ -3190,6 +3196,14 @@ static void mcan_interrupt(FAR struct can_dev_s *dev)
mcan_buffer_release(priv); mcan_buffer_release(priv);
handled = true; handled = true;
#ifdef CONFIG_CAN_TXREADY
/* Inform the upper half driver that we are again ready to accept
* data in mcan_send().
*/
can_txready(dev);
#endif
} }
else if ((pending & priv->txints) != 0) else if ((pending & priv->txints) != 0)
{ {