*/
static void stop(struct rpi_state* state){
sem_wait(&state->thd_par_sem);
- state->commutate=0;
+ setCommutationOff(state);
state->pos_reg_ena=0;
state->spd_reg_ena=0;
state->duty=0;
state->duty=duty;
state->pos_reg_ena=0;
state->spd_reg_ena=0;
- state->commutate=1;
+ setCommutationOn(state);
sem_post(&state->thd_par_sem);
}
sem_wait(&state->thd_par_sem);
state->spd_reg_ena=0;
state->pos_reg_ena=1;
- state->commutate=1;
+ setCommutationOn(state);
state->desired_pos=pos;
sem_post(&state->thd_par_sem);
}
sem_wait(&state->thd_par_sem);
state->pos_reg_ena=0;
state->spd_reg_ena=1;
- state->commutate=1;
+ setCommutationOn(state);
state->desired_spd=speed;
sem_post(&state->thd_par_sem);
}