mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-21 15:34:33 +08:00
Create setEncoderCount function
This commit is contained in:
@@ -1379,3 +1379,10 @@ void motor_thread(void const * argument) {
|
||||
}
|
||||
motor->thread_ready = false;
|
||||
}
|
||||
|
||||
|
||||
void setEncoderCount(Motor_t* motor, uint16_t count){
|
||||
motor->encoder.encoder_state = count;
|
||||
motor->motor_timer->Instance->CNT = count;
|
||||
motor->encoder.pll_pos = count;
|
||||
}
|
||||
@@ -172,6 +172,8 @@ void step_cb(uint16_t GPIO_Pin);
|
||||
void pwm_trig_adc_cb(ADC_HandleTypeDef* hadc, bool injected);
|
||||
void vbus_sense_adc_cb(ADC_HandleTypeDef* hadc, bool injected);
|
||||
|
||||
void setEncoderCount(Motor_t* motor, uint16_t count);
|
||||
|
||||
bool anti_cogging_calibration(Motor_t* motor);
|
||||
|
||||
//@TODO move motor thread to high level file
|
||||
|
||||
Reference in New Issue
Block a user