reset state and set error on drives if slave is not operational

This commit is contained in:
Sascha Ittner
2018-03-20 10:12:53 +01:00
parent 568b821505
commit 3a1d3def3e
3 changed files with 27 additions and 0 deletions

View File

@@ -292,6 +292,13 @@ void lcec_stmds5k_read(struct lcec_slave *slave, long period) {
// wait for slave to be operational
if (!slave->state.operational) {
*(hal_data->ready) = 0;
*(hal_data->error) = 1;
*(hal_data->loc_ena) = 0;
*(hal_data->toggle) = 0;
*(hal_data->stopped) = 0;
*(hal_data->at_speed) = 0;
*(hal_data->overload) = 0;
return;
}