Mark processing SDO request as invalid if config is cleared.
--- a/master/fsm_master.c Tue Dec 04 11:57:55 2012 +0100
+++ b/master/fsm_master.c Tue Dec 04 12:09:42 2012 +0100
@@ -435,8 +435,11 @@
for (slave = master->slaves;
slave < master->slaves + master->slave_count;
slave++) {
- if (!slave->config)
+
+ if (!slave->config) {
continue;
+ }
+
list_for_each_entry(req, &slave->config->sdo_requests, list) {
if (req->state == EC_INT_REQUEST_QUEUED) {
@@ -1215,7 +1218,15 @@
{
ec_sdo_request_t *request = fsm->sdo_request;
- if (ec_fsm_coe_exec(&fsm->fsm_coe)) return;
+ if (!request) {
+ // configuration was cleared in the meantime
+ ec_fsm_master_restart(fsm);
+ return;
+ }
+
+ if (ec_fsm_coe_exec(&fsm->fsm_coe)) {
+ return;
+ }
if (!ec_fsm_coe_success(&fsm->fsm_coe)) {
EC_SLAVE_DBG(fsm->slave, 1,
--- a/master/master.c Tue Dec 04 11:57:55 2012 +0100
+++ b/master/master.c Tue Dec 04 12:09:42 2012 +0100
@@ -415,6 +415,7 @@
ec_slave_config_t *sc, *next;
master->dc_ref_config = NULL;
+ master->fsm.sdo_request = NULL; // mark sdo_request as invalid
list_for_each_entry_safe(sc, next, &master->configs, list) {
list_del(&sc->list);