diff --git a/include/villas/nodes/ethercat.hpp b/include/villas/nodes/ethercat.hpp index bd16c7b65..0476ac1da 100644 --- a/include/villas/nodes/ethercat.hpp +++ b/include/villas/nodes/ethercat.hpp @@ -18,22 +18,17 @@ #include #include -namespace villas { -namespace node { +// Include hard-coded Ethercat Bus configuration +#include + +#define DEFAULT_ETHERCAT_QUEUE_LENGTH (DEFAULT_QUEUE_LENGTH * 64) + +namespace villas::node { // Forward declarations class NodeCompat; class SuperNode; -// Include hard-coded Ethercat Bus configuration -#include - -extern "C" { -#include -} - -#define DEFAULT_ETHERCAT_QUEUE_LENGTH (DEFAULT_QUEUE_LENGTH * 64) - // Internal data per ethercat node struct ethercat { // Settings @@ -91,5 +86,4 @@ int ethercat_read(NodeCompat *n, struct Sample *const smps[], unsigned cnt); int ethercat_write(NodeCompat *n, struct Sample *const smps[], unsigned cnt); -} // namespace node -} // namespace villas +} // namespace villas::node diff --git a/include/villas/nodes/ethercat_config.hpp b/include/villas/nodes/ethercat_config.hpp index 4b1c2816f..819adfde2 100644 --- a/include/villas/nodes/ethercat_config.hpp +++ b/include/villas/nodes/ethercat_config.hpp @@ -25,6 +25,8 @@ #define ETHERCAT_PID_EL3008 0x0bc03052 #define ETHERCAT_PID_FC1100 0x044c0c62 +namespace villas::node { + // TODO: Make PDO entry tables configurable /* Master 0, Slave 3, "EL4038" @@ -168,3 +170,5 @@ static ec_sync_info_t slave_4_syncs[] = { {2, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE}, {3, EC_DIR_INPUT, 8, slave_4_pdos + 0, EC_WD_DISABLE}, {0xff}}; + +} // namespace villas::node