|
@@ -41,7 +41,7 @@ static void _init_pll(void) {
|
|
|
|
|
|
|
|
|
|
|
|
|
void encoder_init(void) {
|
|
void encoder_init(void) {
|
|
|
- encoder_init_clear(POSITIVE);
|
|
|
|
|
|
|
+ encoder_init_clear();
|
|
|
enc_intf_init(ENC_MAX_RES);
|
|
enc_intf_init(ENC_MAX_RES);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -54,13 +54,13 @@ void encoder_set_bandwidth(float bandwidth) {
|
|
|
g_encoder.pll_bandwidth_shadow = bandwidth;
|
|
g_encoder.pll_bandwidth_shadow = bandwidth;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void encoder_init_clear(s8 diretcion) {
|
|
|
|
|
|
|
+void encoder_init_clear(void) {
|
|
|
_init_pll();
|
|
_init_pll();
|
|
|
g_encoder.cpr = ENC_MAX_RES;
|
|
g_encoder.cpr = ENC_MAX_RES;
|
|
|
g_encoder.enc_offset = nv_get_motor_params()->offset;
|
|
g_encoder.enc_offset = nv_get_motor_params()->offset;
|
|
|
g_encoder.motor_poles = nv_get_motor_params()->poles;
|
|
g_encoder.motor_poles = nv_get_motor_params()->poles;
|
|
|
g_encoder.b_index_found = false;
|
|
g_encoder.b_index_found = false;
|
|
|
- g_encoder.direction = diretcion;
|
|
|
|
|
|
|
+ g_encoder.direction = POSITIVE;
|
|
|
g_encoder.abi_angle = 0.0f;
|
|
g_encoder.abi_angle = 0.0f;
|
|
|
g_encoder.pwm_angle = 0.0f;
|
|
g_encoder.pwm_angle = 0.0f;
|
|
|
g_encoder.est_angle_counts = 0;
|
|
g_encoder.est_angle_counts = 0;
|