]> rtime.felk.cvut.cz Git - fpga/rpi-motor-control.git/blobdiff - pmsm-control/test_sw/cmd_proc.c
Commutation function now implemented with use of polymorphism.
[fpga/rpi-motor-control.git] / pmsm-control / test_sw / cmd_proc.c
index 8f49e91595b677a47377f8183a1844ab0adc2c7d..bb3be078ba6978eee202e7c7fa8bc01328b1974d 100644 (file)
@@ -61,7 +61,7 @@ static void start(struct rpi_state* state){
  */
 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;
@@ -82,7 +82,7 @@ static void dutySet(struct rpi_state* state, int duty){
        state->duty=duty;
        state->pos_reg_ena=0;
        state->spd_reg_ena=0;
-       state->commutate=1;
+       setCommutationOn(state);
        sem_post(&state->thd_par_sem);
 }
 
@@ -94,7 +94,7 @@ static void goAbsolute(struct rpi_state* state, int pos){
        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);
 }
@@ -126,7 +126,7 @@ static void setSpeed(struct rpi_state* state, int speed){
        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);
 }