43 #define EC_FSM_ERR(fsm, fmt, args...) \ 46 EC_SLAVE_ERR(fsm->slave, fmt, ##args); \ 48 EC_MASTER_ERR(fsm->master, fmt, ##args); \ 186 EC_FSM_ERR(fsm,
"Failed to receive reboot 1 datagram: ");
199 EC_FSM_ERR(fsm,
"Failed to reboot 1\n");
231 EC_FSM_ERR(fsm,
"Failed to receive reboot 2 datagram: ");
238 EC_FSM_ERR(fsm,
"Failed to reboot 2\n");
269 EC_FSM_ERR(fsm,
"Failed to receive reboot 3 datagram: ");
276 EC_FSM_ERR(fsm,
"Failed to reboot 3\n");
ec_slave_t * slave
slave the FSM runs on, if "single"
#define EC_FSM_RETRIES
Number of state machine retries on datagram timeout.
void ec_fsm_reboot_all(ec_fsm_reboot_t *fsm, ec_master_t *master)
Starts the reboot state machine for all slaves on a master.
EtherCAT slave reboot FSM.
void ec_fsm_reboot_state_two(ec_fsm_reboot_t *)
Reboot state: TWO.
void(* state)(ec_fsm_reboot_t *)
slave reboot state function
int ec_fsm_reboot_success(ec_fsm_reboot_t *fsm)
Returns, if the state machine terminated with success.
ec_master_t * master
master the FSM runs on, if "all"
#define EC_WRITE_U8(DATA, VAL)
Write an 8-bit unsigned value to EtherCAT data.
uint16_t working_counter
Working counter.
uint16_t station_address
Configured station address.
void ec_fsm_reboot_state_start(ec_fsm_reboot_t *)
Reboot state: START.
Global definitions and macros.
EtherCAT master structure.
EtherCAT slave reboot FSM.
ec_datagram_state_t state
State.
void ec_fsm_reboot_state_end(ec_fsm_reboot_t *)
State: END.
unsigned int retries
retries upon datagram timeout
void ec_datagram_print_wc_error(const ec_datagram_t *datagram)
Evaluates the working counter of a single-cast datagram.
int ec_fsm_reboot_exec(ec_fsm_reboot_t *fsm)
Executes the current state of the state machine.
ec_master_t * master
Master owning the slave.
int ec_datagram_fpwr(ec_datagram_t *datagram, uint16_t configured_address, uint16_t mem_address, size_t data_size)
Initializes an EtherCAT FPWR datagram.
void ec_fsm_reboot_init(ec_fsm_reboot_t *fsm, ec_datagram_t *datagram)
Constructor.
void ec_fsm_reboot_single(ec_fsm_reboot_t *fsm, ec_slave_t *slave)
Starts the reboot state machine for a single slave.
void ec_fsm_reboot_state_three(ec_fsm_reboot_t *)
Reboot state: THREE.
unsigned long jiffies_timeout
pause timer
#define EC_SLAVE_INFO(slave, fmt, args...)
Convenience macro for printing slave-specific information to syslog.
void ec_datagram_print_state(const ec_datagram_t *datagram)
Prints the state of a datagram.
void ec_fsm_reboot_state_one(ec_fsm_reboot_t *)
Reboot state: ONE.
void ec_fsm_reboot_state_error(ec_fsm_reboot_t *)
State: ERROR.
ec_datagram_t * datagram
datagram used in the state machine
void ec_fsm_reboot_state_wait(ec_fsm_reboot_t *)
Reboot state: WAIT.
uint8_t * data
Datagram payload.
Unused and should not be queued (dequeued).
#define EC_MASTER_INFO(master, fmt, args...)
Convenience macro for printing master-specific information to syslog.
unsigned long jiffies_received
Jiffies, when the datagram was received.
void ec_fsm_reboot_clear(ec_fsm_reboot_t *fsm)
Destructor.
int ec_datagram_bwr(ec_datagram_t *datagram, uint16_t mem_address, size_t data_size)
Initializes an EtherCAT BWR datagram.