File tree Expand file tree Collapse file tree
src/hal/drivers/mesa-hostmot2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ static void hm2_encoder_read_control_register(hostmot2_t *hm2) {
151151 * e -> hal .pin .input_a = hm2 -> encoder .read_control_reg [i ] & HM2_ENCODER_INPUT_A ;
152152 * e -> hal .pin .input_b = hm2 -> encoder .read_control_reg [i ] & HM2_ENCODER_INPUT_B ;
153153 * e -> hal .pin .input_idx = hm2 -> encoder .read_control_reg [i ] & HM2_ENCODER_INPUT_INDEX ;
154+
154155 }
155156}
156157
@@ -926,7 +927,6 @@ static void hm2_encoder_instance_process_tram_read(hostmot2_t *hm2, int instance
926927 e -> hal .param .scale = 1.0 ;
927928 }
928929
929- hm2_encoder_read_control_register (hm2 );
930930
931931 switch (e -> state ) {
932932
@@ -1098,7 +1098,9 @@ void hm2_encoder_process_tram_read(hostmot2_t *hm2, long l_period_ns) {
10981098 int i ;
10991099
11001100 if (hm2 -> encoder .num_instances <= 0 ) return ;
1101-
1101+
1102+ hm2_encoder_read_control_register (hm2 );
1103+
11021104 // process each encoder instance independently
11031105 for (i = 0 ; i < hm2 -> encoder .num_instances ; i ++ ) {
11041106 hm2_encoder_instance_process_tram_read (hm2 , i );
You can’t perform that action at this time.
0 commit comments