From 9de08898025ea975d90b2ffe538a9c89ce35d1ff Mon Sep 17 00:00:00 2001 From: andreas karlsson Date: Wed, 2 Jun 2021 20:18:25 +0200 Subject: [PATCH] Adjust size of ec_EOE_t to max mailbox size fix #514 --- soem/ethercateoe.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/soem/ethercateoe.h b/soem/ethercateoe.h index 930403a..67ef329 100644 --- a/soem/ethercateoe.h +++ b/soem/ethercateoe.h @@ -16,10 +16,12 @@ extern "C" { #endif -#include "ethercattype.h" +#include "ethercat.h" -/* use maximum size for EOE mailbox data */ -#define EC_MAXEOEDATA EC_MAXMBX +/* use maximum size for EOE mailbox data - mbxheader and 2x frameinfo */ +#define EC_MAXEOEDATA (EC_MAXMBX - (sizeof(ec_mbxheadert) +\ + sizeof(uint16_t) +\ + sizeof(uint16_t))) /** DNS length according to ETG 1000.6 */ #define EOE_DNS_NAME_LENGTH 32