mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 05:03:34 +08:00
uavcannode: Add CANNODE_TERM parameter (configure CAN termination on ARK cannodes)
- adds functionality to enable the built in can termination on the ARK cannodes
This commit is contained in:
@@ -513,6 +513,19 @@ extern "C" int uavcannode_start(int argc, char *argv[])
|
||||
// Sarted byt the bootloader, we must pet it
|
||||
watchdog_pet();
|
||||
|
||||
#if defined(GPIO_CAN_TERM)
|
||||
int32_t can_term = 0;
|
||||
param_get(param_find("CANNODE_TERM"), &can_term);
|
||||
|
||||
if (can_term != 0) {
|
||||
px4_arch_gpiowrite(GPIO_CAN_TERM, true);
|
||||
|
||||
} else {
|
||||
px4_arch_gpiowrite(GPIO_CAN_TERM, false);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// CAN bitrate
|
||||
int32_t bitrate = 0;
|
||||
|
||||
|
||||
@@ -50,3 +50,12 @@ PARAM_DEFINE_INT32(CANNODE_NODE_ID, 120);
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(CANNODE_BITRATE, 1000000);
|
||||
|
||||
/**
|
||||
* CAN built-in bus termination
|
||||
*
|
||||
* @boolean
|
||||
* @max 1
|
||||
* @group UAVCAN
|
||||
*/
|
||||
PARAM_DEFINE_INT32(CANNODE_TERM, 0);
|
||||
|
||||
Reference in New Issue
Block a user