pref: 上电复位到指定位置
This commit is contained in:
@@ -18,7 +18,6 @@
|
|||||||
<ParametersSub name="RSAW" value="CAN_RSAW_1TQ"/>
|
<ParametersSub name="RSAW" value="CAN_RSAW_1TQ"/>
|
||||||
<ParametersSub name="Filter_0_Mode" value="CAN_FILTER_MODE_ID_LIST"/>
|
<ParametersSub name="Filter_0_Mode" value="CAN_FILTER_MODE_ID_LIST"/>
|
||||||
<ParametersSub name="Filter_0_ID1" value="006"/>
|
<ParametersSub name="Filter_0_ID1" value="006"/>
|
||||||
<ParametersSub name="Filter_0_ID2" value="000"/>
|
|
||||||
<ParametersSub name="Filter_0_ID3" value="007"/>
|
<ParametersSub name="Filter_0_ID3" value="007"/>
|
||||||
</Parameters>
|
</Parameters>
|
||||||
</CAN1>
|
</CAN1>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
"titleBar.activeBackground": "#3B3485",
|
"titleBar.activeBackground": "#3B3485",
|
||||||
"titleBar.activeForeground": "#FCFCFE"
|
"titleBar.activeForeground": "#FCFCFE"
|
||||||
},
|
},
|
||||||
"EIDE.OpenOCD.ExePath": "C:/toolchains/openocd-arterytek/bin/openocd.exe",
|
"EIDE.OpenOCD.ExePath": "D:/Program Files (x86)/at32_OpenOCD_V2.0.2/bin/openocd.exe",
|
||||||
"cortex-debug.variableUseNaturalFormat": true
|
"cortex-debug.variableUseNaturalFormat": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,13 +108,13 @@ void by_stepper_init(void)
|
|||||||
gpio_bits_write(GPIOB, GPIO_PINS_15, FALSE); // CLK
|
gpio_bits_write(GPIOB, GPIO_PINS_15, FALSE); // CLK
|
||||||
|
|
||||||
by_stepper_set_dir(0);
|
by_stepper_set_dir(0);
|
||||||
by_stepper_set_speed(STEPPER_SPEED_DIV2);
|
// by_stepper_set_speed(STEPPER_SPEED_DIV2);
|
||||||
|
|
||||||
while (gpio_input_data_bit_read(GPIOB, GPIO_PINS_10) == SET && slow_start_cnt--) {
|
// while (gpio_input_data_bit_read(GPIOB, GPIO_PINS_10) == SET && slow_start_cnt--) {
|
||||||
gpio_bits_write(GPIOA, GPIO_PINS_8, by_stepper.dir ? TRUE : FALSE); // DIR
|
// gpio_bits_write(GPIOA, GPIO_PINS_8, by_stepper.dir ? TRUE : FALSE); // DIR
|
||||||
gpio_bits_write(GPIOB, GPIO_PINS_15, !gpio_output_data_bit_read(GPIOB, GPIO_PINS_15)); // CLK
|
// gpio_bits_write(GPIOB, GPIO_PINS_15, !gpio_output_data_bit_read(GPIOB, GPIO_PINS_15)); // CLK
|
||||||
DWT_Delay(40U * (uint16_t)by_stepper.speed);
|
// DWT_Delay(40U * (uint16_t)by_stepper.speed);
|
||||||
}
|
// }
|
||||||
|
|
||||||
by_stepper_set_speed(STEPPER_SPEED_DIV1);
|
by_stepper_set_speed(STEPPER_SPEED_DIV1);
|
||||||
|
|
||||||
@@ -130,6 +130,9 @@ void by_stepper_init(void)
|
|||||||
tmr_counter_value_set(TMR3, 0);
|
tmr_counter_value_set(TMR3, 0);
|
||||||
|
|
||||||
LOGD("by_stepper init ok");
|
LOGD("by_stepper init ok");
|
||||||
|
|
||||||
|
by_stepper_set_dir(1);
|
||||||
|
by_stepper_set_position_millimeter(-160.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void by_stepper_loop(void)
|
void by_stepper_loop(void)
|
||||||
@@ -165,7 +168,7 @@ void by_stepper_loop(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
by_stepper_stop(0);
|
by_stepper_stop(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (position_offset) {
|
// if (position_offset) {
|
||||||
|
|||||||
Reference in New Issue
Block a user