mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_HAL: board: linux: Add default CAN interface name
This commit is contained in:
parent
b6665f7e58
commit
a50e6c6dd7
@ -430,3 +430,7 @@
|
|||||||
#ifndef HAL_BOARD_STORAGE_DIRECTORY
|
#ifndef HAL_BOARD_STORAGE_DIRECTORY
|
||||||
#define HAL_BOARD_STORAGE_DIRECTORY "/var/lib/ardupilot"
|
#define HAL_BOARD_STORAGE_DIRECTORY "/var/lib/ardupilot"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAL_BOARD_CAN_IFACE_NAME
|
||||||
|
#define HAL_BOARD_CAN_IFACE_NAME "can0"
|
||||||
|
#endif
|
||||||
|
@ -68,7 +68,7 @@ bool LinuxCAN::begin(uint32_t bitrate)
|
|||||||
{
|
{
|
||||||
if (_initialized) return _initialized;
|
if (_initialized) return _initialized;
|
||||||
// TODO: Add possibility change bitrate
|
// TODO: Add possibility change bitrate
|
||||||
_fd = openSocket("can0");
|
_fd = openSocket(HAL_BOARD_CAN_IFACE_NAME);
|
||||||
if (_fd > 0) {
|
if (_fd > 0) {
|
||||||
_bitrate = bitrate;
|
_bitrate = bitrate;
|
||||||
_initialized = true;
|
_initialized = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user