Fixed bug that caused the configuration not to be cleared when reserved but
not activated and then releasing.
This commit is contained in:
parent
c442beaa02
commit
8b6d5f8af3
1
TODO
1
TODO
|
|
@ -42,7 +42,6 @@ Version 1.5.0:
|
||||||
* Output SoE IDN configurations in 'ethercat config'.
|
* Output SoE IDN configurations in 'ethercat config'.
|
||||||
* Fix casting away constness during expected WC calculation.
|
* Fix casting away constness during expected WC calculation.
|
||||||
* Read AL status code on spontaneous state change.
|
* Read AL status code on spontaneous state change.
|
||||||
* Fix clearing domains etc. when not activated and releasing.
|
|
||||||
* Only output watchdog config if not default.
|
* Only output watchdog config if not default.
|
||||||
|
|
||||||
Future issues:
|
Future issues:
|
||||||
|
|
|
||||||
|
|
@ -439,6 +439,20 @@ void ec_master_clear_domains(ec_master_t *master)
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/** Clear the configuration applied by the application.
|
||||||
|
*/
|
||||||
|
void ec_master_clear_config(
|
||||||
|
ec_master_t *master /**< EtherCAT master. */
|
||||||
|
)
|
||||||
|
{
|
||||||
|
down(&master->master_sem);
|
||||||
|
ec_master_clear_domains(master);
|
||||||
|
ec_master_clear_slave_configs(master);
|
||||||
|
up(&master->master_sem);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
/** Internal sending callback.
|
/** Internal sending callback.
|
||||||
*/
|
*/
|
||||||
void ec_master_internal_send_cb(
|
void ec_master_internal_send_cb(
|
||||||
|
|
@ -653,15 +667,17 @@ void ec_master_leave_operation_phase(
|
||||||
ec_master_t *master /**< EtherCAT master */
|
ec_master_t *master /**< EtherCAT master */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (master->active)
|
if (master->active) {
|
||||||
ecrt_master_deactivate(master);
|
ecrt_master_deactivate(master); // also clears config
|
||||||
|
} else {
|
||||||
|
ec_master_clear_config(master);
|
||||||
|
}
|
||||||
|
|
||||||
EC_MASTER_DBG(master, 1, "OPERATION -> IDLE.\n");
|
EC_MASTER_DBG(master, 1, "OPERATION -> IDLE.\n");
|
||||||
|
|
||||||
master->phase = EC_IDLE;
|
master->phase = EC_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
/** Injects external datagrams that fit into the datagram queue.
|
/** Injects external datagrams that fit into the datagram queue.
|
||||||
|
|
@ -1989,8 +2005,7 @@ void ecrt_master_deactivate(ec_master_t *master)
|
||||||
int eoe_was_running;
|
int eoe_was_running;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EC_MASTER_DBG(master, 1, "ecrt_master_deactivate(master = 0x%p)\n",
|
EC_MASTER_DBG(master, 1, "%s(master = 0x%p)\n", __func__, master);
|
||||||
master);
|
|
||||||
|
|
||||||
if (!master->active) {
|
if (!master->active) {
|
||||||
EC_MASTER_WARN(master, "%s: Master not active.\n", __func__);
|
EC_MASTER_WARN(master, "%s: Master not active.\n", __func__);
|
||||||
|
|
@ -2007,10 +2022,7 @@ void ecrt_master_deactivate(ec_master_t *master)
|
||||||
master->receive_cb = ec_master_internal_receive_cb;
|
master->receive_cb = ec_master_internal_receive_cb;
|
||||||
master->cb_data = master;
|
master->cb_data = master;
|
||||||
|
|
||||||
down(&master->master_sem);
|
ec_master_clear_config(master);
|
||||||
ec_master_clear_domains(master);
|
|
||||||
ec_master_clear_slave_configs(master);
|
|
||||||
up(&master->master_sem);
|
|
||||||
|
|
||||||
for (slave = master->slaves;
|
for (slave = master->slaves;
|
||||||
slave < master->slaves + master->slave_count;
|
slave < master->slaves + master->slave_count;
|
||||||
|
|
|
||||||
|
|
@ -170,11 +170,12 @@ struct ec_master {
|
||||||
unsigned int injection_seq_rt; /**< Datagram injection sequence number
|
unsigned int injection_seq_rt; /**< Datagram injection sequence number
|
||||||
for the realtime side. */
|
for the realtime side. */
|
||||||
|
|
||||||
|
|
||||||
ec_slave_t *slaves; /**< Array of slaves on the bus. */
|
ec_slave_t *slaves; /**< Array of slaves on the bus. */
|
||||||
unsigned int slave_count; /**< Number of slaves on the bus. */
|
unsigned int slave_count; /**< Number of slaves on the bus. */
|
||||||
|
|
||||||
|
/* Configuration applied by the application. */
|
||||||
struct list_head configs; /**< List of slave configurations. */
|
struct list_head configs; /**< List of slave configurations. */
|
||||||
|
struct list_head domains; /**< List of domains. */
|
||||||
|
|
||||||
u64 app_time; /**< Time of the last ecrt_master_sync() call. */
|
u64 app_time; /**< Time of the last ecrt_master_sync() call. */
|
||||||
u64 app_start_time; /**< Application start time. */
|
u64 app_start_time; /**< Application start time. */
|
||||||
|
|
@ -213,7 +214,6 @@ struct ec_master {
|
||||||
struct list_head external_datagram_queue; /**< External Datagram queue. */
|
struct list_head external_datagram_queue; /**< External Datagram queue. */
|
||||||
unsigned int send_interval; /**< Interval between calls to ecrt_master_send */
|
unsigned int send_interval; /**< Interval between calls to ecrt_master_send */
|
||||||
size_t max_queue_size; /**< Maximum size of datagram queue */
|
size_t max_queue_size; /**< Maximum size of datagram queue */
|
||||||
struct list_head domains; /**< List of domains. */
|
|
||||||
|
|
||||||
unsigned int debug_level; /**< Master debug level. */
|
unsigned int debug_level; /**< Master debug level. */
|
||||||
ec_stats_t stats; /**< Cyclic statistics. */
|
ec_stats_t stats; /**< Cyclic statistics. */
|
||||||
|
|
@ -242,7 +242,6 @@ struct ec_master {
|
||||||
|
|
||||||
struct list_head reg_requests; /**< Register requests. */
|
struct list_head reg_requests; /**< Register requests. */
|
||||||
wait_queue_head_t reg_queue; /**< Wait queue for register requests. */
|
wait_queue_head_t reg_queue; /**< Wait queue for register requests. */
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue