generated from hulk/gd32e23x_template_cmake_vscode
fix(command):修复一些规范性问题,无实质修改。
This commit is contained in:
+4
-4
@@ -111,17 +111,17 @@ void actuator_stop(actuator_channel_t channel) {
|
||||
if(channel == ACTUATOR_CH1) {
|
||||
SEGGER_RTT_printf(0, "[ACTUATOR] Stopping Actuator CH1\n");
|
||||
timer_channel_output_pulse_value_config(ACTUATOR_PWM_TIMER, ACTUATOR_CH1_PWM_TIMER_CH, 999); // Ensure CH1 is off
|
||||
gpio_bit_set(ACTUATOR_CH1_GPIO_PORT, ACTUATOR_CH1_GPIO_PIN); // Set CH1 direction LOW
|
||||
gpio_bit_set(ACTUATOR_CH1_GPIO_PORT, ACTUATOR_CH1_GPIO_PIN); // Set CH1 direction High
|
||||
} else if(channel == ACTUATOR_CH2) {
|
||||
SEGGER_RTT_printf(0, "[ACTUATOR] Stopping Actuator CH2\n");
|
||||
timer_channel_output_pulse_value_config(ACTUATOR_PWM_TIMER, ACTUATOR_CH2_PWM_TIMER_CH, 999); // Ensure CH2 is off
|
||||
gpio_bit_set(ACTUATOR_CH2_GPIO_PORT, ACTUATOR_CH2_GPIO_PIN); // Set CH2 direction LOW
|
||||
gpio_bit_set(ACTUATOR_CH2_GPIO_PORT, ACTUATOR_CH2_GPIO_PIN); // Set CH2 direction High
|
||||
} else {
|
||||
// Invalid channel, handle error if necessary
|
||||
SEGGER_RTT_printf(0, "[ACTUATOR] Invalid channel specified for stop: %d\n", channel);
|
||||
timer_channel_output_pulse_value_config(ACTUATOR_PWM_TIMER, ACTUATOR_CH1_PWM_TIMER_CH, 999); // Ensure CH1 is off
|
||||
timer_channel_output_pulse_value_config(ACTUATOR_PWM_TIMER, ACTUATOR_CH2_PWM_TIMER_CH, 999); // Ensure CH2 is off
|
||||
gpio_bit_set(ACTUATOR_CH1_GPIO_PORT, ACTUATOR_CH1_GPIO_PIN); // Set CH1 direction LOW
|
||||
gpio_bit_set(ACTUATOR_CH2_GPIO_PORT, ACTUATOR_CH2_GPIO_PIN); // Set CH2 direction LOW
|
||||
gpio_bit_set(ACTUATOR_CH1_GPIO_PORT, ACTUATOR_CH1_GPIO_PIN); // Set CH1 direction High
|
||||
gpio_bit_set(ACTUATOR_CH2_GPIO_PORT, ACTUATOR_CH2_GPIO_PIN); // Set CH2 direction High
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user