diff --git a/soes/esc.c b/soes/esc.c index 093ff68..582c1e0 100644 --- a/soes/esc.c +++ b/soes/esc.c @@ -1160,6 +1160,7 @@ void ESC_config (esc_cfg_t * cfg) ESCvar.mbboot[0] = mbboot0; ESCvar.mbboot[1] = mbboot1; + ESCvar.skip_default_initialization = cfg->skip_default_initialization; ESCvar.set_defaults_hook = cfg->set_defaults_hook; ESCvar.pre_state_change_hook = cfg->pre_state_change_hook; ESCvar.post_state_change_hook = cfg->post_state_change_hook; diff --git a/soes/esc.h b/soes/esc.h index a225ee8..5f55788 100644 --- a/soes/esc.h +++ b/soes/esc.h @@ -308,6 +308,7 @@ typedef struct esc_cfg void * user_arg; int use_interrupt; int watchdog_cnt; + bool skip_default_initialization; void (*set_defaults_hook) (void); void (*pre_state_change_hook) (uint8_t * as, uint8_t * an); void (*post_state_change_hook) (uint8_t * as, uint8_t * an); @@ -431,6 +432,7 @@ typedef struct int use_interrupt; sm_cfg_t mb[2]; sm_cfg_t mbboot[2]; + bool skip_default_initialization; void (*set_defaults_hook) (void); void (*pre_state_change_hook) (uint8_t * as, uint8_t * an); void (*post_state_change_hook) (uint8_t * as, uint8_t * an); diff --git a/soes/esc_coe.c b/soes/esc_coe.c index 35ea265..a1440ec 100644 --- a/soes/esc_coe.c +++ b/soes/esc_coe.c @@ -1630,6 +1630,12 @@ void COE_initDefaultValues (void) int n; uint8_t maxsub; + /* Let application decide if initialization will be skipped */ + if (ESCvar.skip_default_initialization) + { + return; + } + /* Set default values from object descriptor */ for (n = 0; SDOobjects[n].index != 0xffff; n++) {