full canfd support

This commit is contained in:
Benjamin Perseghetti
2022-06-07 13:17:05 -04:00
parent b827d5a9ac
commit 700e6da259
6 changed files with 21 additions and 1 deletions
+2
View File
@@ -1,3 +1,5 @@
CONFIG_DRIVERS_GPS=n
CONFIG_CYPHAL_CANFD_SUPPORT=y
CONFIG_CYPHAL_UORB_PCA_PWM_SUBSCRIBER=y
CONFIG_DRIVERS_PCA9685_UCAN=y
CONFIG_EXAMPLES_PCA_PWM_TEST=y
+4 -1
View File
@@ -56,8 +56,11 @@ int CanardSocketCAN::init()
struct ifreq ifr;
//FIXME HOTFIX to make this code compile
#if CONFIG_CYPHAL_CANFD_SUPPORT
bool can_fd = 1;
#else
bool can_fd = 0;
#endif
_can_fd = can_fd;
/* open socket */
+4
View File
@@ -117,7 +117,11 @@ int CyphalNode::start(uint32_t node_id, uint32_t bitrate)
return -1;
}
#if CONFIG_CYPHAL_CANFD_SUPPORT
bool can_fd = true;
#else
bool can_fd = false;
#endif
if (can_fd) {
_instance = new CyphalNode(node_id, 8, CANARD_MTU_CAN_FD);
+8
View File
@@ -41,6 +41,9 @@ if DRIVERS_CYPHAL
help
When the board uses the UAVCANv0 bootloader functionality you need a AppImageDescriptor defined
config CYPHAL_CANFD_SUPPORT
bool "Enable CANFD Support in Cyphal"
default n
menu "Publisher support"
@@ -87,6 +90,11 @@ if DRIVERS_CYPHAL
config CYPHAL_UORB_SENSOR_GPS_SUBSCRIBER
bool "uORB sensor_gps Subscriber"
default n
config CYPHAL_UORB_PCA_PWM_SUBSCRIBER
bool "uORB pca_pwm Subscriber"
default n
endmenu
menu "Advertised Services"
@@ -47,6 +47,7 @@
#include <uORB/topics/actuator_outputs.h>
#include <uORB/topics/sensor_gps.h>
#include <uORB/topics/pca_pwm.h>
template <class T>
class uORB_over_UAVCAN_Subscriber : public UavcanDynamicPortSubscriber
@@ -71,6 +71,8 @@ void SubscriptionManager::subscribe()
void SubscriptionManager::updateDynamicSubscriptions()
{
PX4_INFO("Cyphal sub count: %d", UAVCAN_SUB_COUNT);
for (auto &sub : _uavcan_subs) {
bool found_subscriber = false;