From 42ec9bf238ae617068a3adafd4c659573bdf29ec Mon Sep 17 00:00:00 2001 From: lbckmnn <66389377+lbckmnn@users.noreply.github.com> Date: Sat, 2 Jul 2022 11:32:02 +0200 Subject: [PATCH] also configure the last SM (#622) fixes #617 --- soem/ethercatconfig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soem/ethercatconfig.c b/soem/ethercatconfig.c index 47c5c94..21b3346 100644 --- a/soem/ethercatconfig.c +++ b/soem/ethercatconfig.c @@ -919,7 +919,7 @@ static void ecx_config_create_input_mappings(ecx_contextt *context, void *pIOmap } } /* search for SM that contribute to the input mapping */ - while ((SMc < (EC_MAXSM - 1)) && (FMMUdone < ((context->slavelist[slave].Ibits + 7) / 8))) + while ((SMc < EC_MAXSM) && (FMMUdone < ((context->slavelist[slave].Ibits + 7) / 8))) { EC_PRINT(" FMMU %d\n", FMMUc); while ((SMc < (EC_MAXSM - 1)) && (context->slavelist[slave].SMtype[SMc] != 4)) @@ -1057,7 +1057,7 @@ static void ecx_config_create_output_mappings(ecx_contextt *context, void *pIOma configadr = context->slavelist[slave].configadr; /* search for SM that contribute to the output mapping */ - while ((SMc < (EC_MAXSM - 1)) && (FMMUdone < ((context->slavelist[slave].Obits + 7) / 8))) + while ((SMc < EC_MAXSM) && (FMMUdone < ((context->slavelist[slave].Obits + 7) / 8))) { EC_PRINT(" FMMU %d\n", FMMUc); while ((SMc < (EC_MAXSM - 1)) && (context->slavelist[slave].SMtype[SMc] != 3))