mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-23 09:03:40 +08:00
Don't reset count if we've already found the index...
This commit is contained in:
@@ -530,12 +530,14 @@ void step_cb(uint16_t GPIO_Pin) {
|
||||
}
|
||||
}
|
||||
|
||||
void enc_index_cb(uint16_t GPIO_Pin, int index){
|
||||
setEncoderCount(&motors[index], 0);
|
||||
motors[index].IndexFound = true;
|
||||
// Triggered when an encoder passes over the "Index" pin
|
||||
void enc_index_cb(uint16_t GPIO_Pin, int index) {
|
||||
if (!motors[index].encoder.index_found) {
|
||||
setEncoderCount(&motors[index], 0);
|
||||
motors[index].encoder.index_found = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void vbus_sense_adc_cb(ADC_HandleTypeDef* hadc, bool injected) {
|
||||
static const float voltage_scale = 3.3f * 11.0f / (float)(1 << 12);
|
||||
// Only one conversion in sequence, so only rank1
|
||||
|
||||
Reference in New Issue
Block a user