Added a few debugging messages.

This commit is contained in:
Florian Pose 2008-06-12 13:05:05 +00:00
parent e581c899f6
commit d3f7c7bbd8
1 changed files with 15 additions and 0 deletions

View File

@ -325,6 +325,9 @@ void ec_master_thread_stop(ec_master_t *master /**< EtherCAT master */)
return;
}
if (master->debug_level)
EC_DBG("Stopping master thread.\n");
kill_proc(master->thread_id, SIGTERM, 1);
wait_for_completion(&master->thread_exit);
EC_INFO("Master thread exited.\n");
@ -347,6 +350,9 @@ int ec_master_enter_idle_mode(ec_master_t *master /**< EtherCAT master */)
master->release_cb = ec_master_release_cb;
master->cb_data = master;
if (master->debug_level)
EC_DBG("ORPHANED -> IDLE.\n");
master->mode = EC_MASTER_MODE_IDLE;
if (ec_master_thread_start(master, ec_master_idle_thread)) {
master->mode = EC_MASTER_MODE_ORPHANED;
@ -362,6 +368,9 @@ int ec_master_enter_idle_mode(ec_master_t *master /**< EtherCAT master */)
*/
void ec_master_leave_idle_mode(ec_master_t *master /**< EtherCAT master */)
{
if (master->debug_level)
EC_DBG("IDLE -> ORPHANED.\n");
master->mode = EC_MASTER_MODE_ORPHANED;
#ifdef EC_EOE
@ -382,6 +391,9 @@ int ec_master_enter_operation_mode(ec_master_t *master /**< EtherCAT master */)
ec_eoe_t *eoe;
#endif
if (master->debug_level)
EC_DBG("IDLE -> OPERATION.\n");
down(&master->config_sem);
master->allow_config = 0; // temporarily disable slave configuration
if (master->config_busy) {
@ -458,6 +470,9 @@ void ec_master_leave_operation_mode(ec_master_t *master
ec_eoe_t *eoe;
#endif
if (master->debug_level)
EC_DBG("OPERATION -> IDLE.\n");
master->mode = EC_MASTER_MODE_IDLE;
#ifdef EC_EOE