mirror of https://github.com/rusefi/bldc.git
Normalize encoder angle
This commit is contained in:
parent
9e45fd9463
commit
898a96478c
|
@ -398,6 +398,8 @@ float encoder_read_deg_multiturn(void) {
|
|||
}
|
||||
|
||||
void encoder_set_deg(float deg) {
|
||||
utils_norm_angle(°);
|
||||
|
||||
if (m_encoder_type_now == ENCODER_TYPE_ABI) {
|
||||
encoder_cfg_ABI.timer->CNT = (uint32_t)(deg / 360.0 * (float)encoder_cfg_ABI.counts);
|
||||
encoder_cfg_ABI.state.index_found = true;
|
||||
|
|
Loading…
Reference in New Issue