mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-22 16:14:37 +08:00
turn off control at start for enc idx testing
This commit is contained in:
@@ -12,8 +12,8 @@ extern "C" {
|
||||
|
||||
// TODO: decide if we want to consolidate all default configs in one file for ease of use?
|
||||
struct AxisConfig {
|
||||
bool enable_control_at_start = true;
|
||||
bool do_calibration_at_start = true;
|
||||
bool enable_control_at_start = false;
|
||||
bool do_calibration_at_start = false;
|
||||
};
|
||||
|
||||
class Axis {
|
||||
|
||||
@@ -537,6 +537,7 @@ void enc_index_cb(uint16_t GPIO_Pin, uint8_t motor_index) {
|
||||
setEncoderCount(&motors[motor_index], 0);
|
||||
motors[motor_index].encoder.index_found = true;
|
||||
}
|
||||
//TODO: Hardcoded EXTI line not portable. Get mapping out of Cubemx by setting EXTI default
|
||||
if(GPIO_Pin == M0_ENC_Z_Pin){
|
||||
HAL_NVIC_DisableIRQ(EXTI3_IRQn);
|
||||
} else {
|
||||
|
||||
@@ -191,6 +191,7 @@ void SetGPIO12toStepDir() {
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIO_2_GPIO_Port, &GPIO_InitStruct);
|
||||
|
||||
//TODO: Hardcoded EXTI line not portable. Get mapping out of Cubemx by setting EXTI default
|
||||
HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI0_IRQn);
|
||||
}
|
||||
@@ -204,6 +205,7 @@ void SetupENCIndexGPIO(){
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
//TODO: Hardcoded EXTI line not portable. Get mapping out of Cubemx by setting EXTI default
|
||||
HAL_NVIC_SetPriority(EXTI15_10_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
|
||||
|
||||
@@ -213,6 +215,7 @@ void SetupENCIndexGPIO(){
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||
|
||||
//TODO: Hardcoded EXTI line not portable. Get mapping out of Cubemx by setting EXTI default
|
||||
HAL_NVIC_SetPriority(EXTI3_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(EXTI3_IRQn);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user