mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
Added SocketCAN driver implementation to the tiva chip, modified the EK-TC1294XL launchpad board to use the new SocketCAN API
This commit is contained in:
committed by
Xiang Xiao
parent
3f97a87162
commit
372fee9412
@@ -78,6 +78,7 @@ int tm4c_can_setup(void)
|
||||
goto configgpio_error;
|
||||
}
|
||||
|
||||
# ifdef CONFIG_TIVA_CHAR_DEV_CAN
|
||||
/* Call tiva_can_initialize() to get an instance of CAN interface 0
|
||||
* and register it.
|
||||
*/
|
||||
@@ -88,6 +89,20 @@ int tm4c_can_setup(void)
|
||||
canerr("ERROR: Failed to get/register CAN interface 0\n");
|
||||
return ret;
|
||||
}
|
||||
# endif /* CONFIG_TIVA_CHAR_DEV_CAN */
|
||||
|
||||
# if defined(CONFIG_TIVA_SOCKET_CAN)
|
||||
/* Call tiva_cansockinitialize() to get an instance of CAN interface 0
|
||||
* and register it.
|
||||
*/
|
||||
|
||||
ret = tiva_cansockinitialize(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
canerr("ERROR: Failed to get/register CAN interface 0\n");
|
||||
return ret;
|
||||
}
|
||||
# endif /* CONFIG_TIVA_SOCKET_CAN */
|
||||
# endif /* CONFIG_TIVA_CAN0 */
|
||||
|
||||
# ifdef CONFIG_TIVA_CAN1
|
||||
@@ -105,6 +120,7 @@ int tm4c_can_setup(void)
|
||||
goto configgpio_error;
|
||||
}
|
||||
|
||||
# ifdef CONFIG_TIVA_CHAR_DEV_CAN
|
||||
/* Call tiva_can_initialize() to get an instance of CAN interface 1
|
||||
* and register it.
|
||||
*/
|
||||
@@ -115,6 +131,20 @@ int tm4c_can_setup(void)
|
||||
canerr("ERROR: Failed to get/register CAN interface 1\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
# endif /* CONFIG_TIVA_CHAR_DEV_CAN */
|
||||
# if defined(CONFIG_TIVA_SOCKET_CAN)
|
||||
/* Call tiva_cansockinitialize() to get an instance of CAN interface 0
|
||||
* and register it.
|
||||
*/
|
||||
|
||||
ret = tiva_cansockinitialize(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
canerr("ERROR: Failed to get/register CAN interface 0\n");
|
||||
return ret;
|
||||
}
|
||||
# endif /* CONFIG_TIVA_SOCKET_CAN */
|
||||
# endif /* CONFIG_TIVA_CAN1 */
|
||||
|
||||
return OK;
|
||||
|
||||
Reference in New Issue
Block a user