From 3bb489469baff840c3b513d01788d0969c3463c5 Mon Sep 17 00:00:00 2001 From: Andreas Karlsson Date: Sat, 25 Feb 2023 10:32:18 +0100 Subject: [PATCH] Add support for CoE flags requried by MFC2020 Backup Settings RWop RWpre_safe (defined in ETG1000-6) fixes #142 --- soes/esc_coe.c | 7 ++++--- soes/esc_coe.h | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/soes/esc_coe.c b/soes/esc_coe.c index 796db6c..2e35391 100644 --- a/soes/esc_coe.c +++ b/soes/esc_coe.c @@ -872,13 +872,14 @@ static void SDO_download (void) } else { - if (access == ATYPE_RWpre) + if (access == ATYPE_RO) { - SDO_abort (0, index, subindex, ABORT_NOTINTHISSTATE); + SDO_abort (0, index, subindex, ABORT_READONLY); + } else { - SDO_abort (0, index, subindex, ABORT_READONLY); + SDO_abort (0, index, subindex, ABORT_NOTINTHISSTATE); } } } diff --git a/soes/esc_coe.h b/soes/esc_coe.h index b54ac7b..17aee0c 100644 --- a/soes/esc_coe.h +++ b/soes/esc_coe.h @@ -96,11 +96,15 @@ typedef struct #define ATYPE_Wop 0x20 #define ATYPE_RXPDO 0x40 #define ATYPE_TXPDO 0x80 +#define ATYPE_BACKUP 0x100 +#define ATYPE_SETTING 0x200 #define ATYPE_RO (ATYPE_Rpre | ATYPE_Rsafe | ATYPE_Rop) #define ATYPE_WO (ATYPE_Wpre | ATYPE_Wsafe | ATYPE_Wop) #define ATYPE_RW (ATYPE_RO | ATYPE_WO) #define ATYPE_RWpre (ATYPE_Wpre | ATYPE_RO) +#define ATYPE_RWop (ATYPE_Wop | ATYPE_RO) +#define ATYPE_RWpre_safe (ATYPE_Wpre | ATYPE_Wsafe | ATYPE_RO) #define TX_PDO_OBJIDX 0x1c13 #define RX_PDO_OBJIDX 0x1c12