Implement parallel slave configuration (Steps 2–4)#154
Merged
sittner merged 2 commits intoparallel-slave-configfrom Mar 2, 2026
Merged
Implement parallel slave configuration (Steps 2–4)#154sittner merged 2 commits intoparallel-slave-configfrom
sittner merged 2 commits intoparallel-slave-configfrom
Conversation
Co-authored-by: sittner <1475582+sittner@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add remaining steps for parallel slave configuration
Implement parallel slave configuration (Steps 2–4)
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Steps 2–4 of the parallel slave configuration design, enabling all slaves requiring configuration to be driven concurrently rather than sequentially one at a time.
Changes
fsm_slave_config.h— Exposeec_fsm_slave_config_running()fsm_slavecan query config FSM liveness.fsm_slave.h/fsm_slave.c— Embed config FSM in each slave FSMec_fsm_slave_tnow owns a full config FSM stack:fsm_slave_config,fsm_change,fsm_coe_config,fsm_soe_config,fsm_eoe_config,fsm_pdo.config_requested:1/config_running:1bitfields.ec_fsm_slave_exec()runs the embedded config FSM first (consuming the datagram) before falling through to request handling.ec_fsm_slave_request_config()sets theconfig_requestedflag; the FSM picks it up on the next execution cycle.fsm_master.c— Delegate configuration in parallelec_fsm_master_action_configure()now iterates all slaves in a single pass, callingec_fsm_slave_request_config()on every slave that needs it, then transitions to the newec_fsm_master_state_wait_configstate.ec_fsm_master_state_wait_config()pollsconfig_requested/config_runningacross all slaves; releasesconfig_busyand wakesconfig_queueonce all are done.master.c— Schedule config-active slaves onto external datagramsec_master_exec_slave_fsms()pick-up loop now includes slaves withconfig_requestedorconfig_running(previously onlyec_fsm_slave_is_ready()slaves were scheduled).Original prompt
Overview
Implement the remaining steps (2, 3, 4) described in
PARALLEL_SLAVE_CONFIG_IMPL.md(at commitf295ad8b80ee9018eeb024e26f11d3b6edb6bcbbon branchparallel-slave-config) to enable parallel slave configuration in the IgH EtherCAT Master.Step 1 is already complete —
fsm_slave_configalready uses external datagram/FSM pointers. The remaining work is Steps 2–4.Read
PARALLEL_SLAVE_CONFIG_IMPL.mdon theparallel-slave-configbranch carefully — it contains the exact code snippets and instructions for each step. Follow it precisely.Step 2: Add Configuration State Machine to
fsm_slaveFiles:
master/fsm_slave.h,master/fsm_slave.c2.1 Update
master/fsm_slave.hAdd new includes at the top (after existing includes):
Add the following new members to
struct ec_fsm_slave(between the existing request pointers and the existing sub-FSMs):Add new function declarations:
2.2 Update
master/fsm_slave.cIn
ec_fsm_slave_init(), add initialization of configuration flags and sub-FSMs before the existingec_fsm_coe_init/ec_fsm_foe_init/ec_fsm_soe_initcalls:IMPORTANT: Check how
ec_fsm_change_initis called infsm_master.con this branch to determine the correct number of parameters (it may take a datagram pointer). Use the same pattern but passNULL.IMPORTANT: The
ec_fsm_slave_config_initcall must match the actual signature infsm_slave_config.hon the branch:Note it takes 7 parameters (fsm, datagram, change, coe, soe, pdo, eoe). When
EC_EOEis not defined, check if there's a conditional version or if the EoE parameter is always required.In
ec_fsm_slave_clear(), add cleanup of configuration sub-FSMs before the existing cleanup:Add two new functions:
Modify
ec_fsm_slave_exec()to handle configuration before the existing state machine execution. Add at the beginning of the function:Then continue with the existing
fsm->state(fsm, datagram);call and the rest of the existing logic.2.3 Expose
ec_fsm_slave_config_running()in `...This pull request was created from Copilot chat.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.