Rev 57 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 57 | Rev 59 | ||
---|---|---|---|
Line 89... | Line 89... | ||
89 | int cnt0 = __HAL_TIM_GET_COUNTER(&htim9) >> SHIFT; // counts 4 per step |
89 | int cnt0 = __HAL_TIM_GET_COUNTER(&htim9) >> SHIFT; // counts 4 per step |
90 | int cnt1 = __HAL_TIM_GET_COUNTER(&htim3) >> SHIFT; // counts 4 per step |
90 | int cnt1 = __HAL_TIM_GET_COUNTER(&htim3) >> SHIFT; // counts 4 per step |
91 | 91 | ||
92 | // always count up, or count down to zero but dont wrap |
92 | // always count up, or count down to zero but dont wrap |
93 | 93 | ||
94 | if ((dial_pos[0] != 0) || (cnt0 > dial_count[0])) |
94 | //if ((dial_pos[0] != 0) || (cnt0 > dial_count[0])) |
95 | dial_pos[0] += cnt0 - dial_count[0]; |
95 | dial_pos[0] += cnt0 - dial_count[0]; |
96 | dial_count[0] = cnt0; |
96 | dial_count[0] = cnt0; |
97 | 97 | ||
98 | if ((dial_pos[1] != 0) || (cnt1 > dial_count[1])) |
98 | // if ((dial_pos[1] != 0) || (cnt1 > dial_count[1])) |
99 | dial_pos[1] += cnt1 - dial_count[1]; |
99 | dial_pos[1] += cnt1 - dial_count[1]; |
100 | dial_count[1] = cnt1; |
100 | dial_count[1] = cnt1; |
101 | 101 | ||
102 | } |
102 | } |
103 | 103 |