Skip to content

Commit

Permalink
dshot: fix motor pin init for bidir
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Dec 11, 2024
1 parent 431e1b3 commit 6ed571d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/driver/mcu/at32/motor_dshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void dshot_dma_isr(dma_device_t dev) {
if (profile.motor.dshot_telemetry && dshot_phase == dshot_gpio_port_count) {
// output phase done, lets swap to input
for (uint32_t i = 0; i < MOTOR_PIN_MAX; i++) {
dshot_gpio_init_input(i);
dshot_gpio_init_input(target.motor_pins[i]);
}
for (uint32_t j = 0; j < dshot_gpio_port_count; j++) {
dshot_dma_setup_input(j);
Expand Down
2 changes: 1 addition & 1 deletion src/driver/mcu/stm32/motor_dshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void dshot_dma_isr(dma_device_t dev) {
if (profile.motor.dshot_telemetry && dshot_phase == dshot_gpio_port_count) {
// output phase done, lets swap to input
for (uint32_t i = 0; i < MOTOR_PIN_MAX; i++) {
dshot_gpio_init_input(i);
dshot_gpio_init_input(target.motor_pins[i]);
}
for (uint32_t j = 0; j < dshot_gpio_port_count; j++) {
dshot_dma_setup_input(j);
Expand Down
2 changes: 1 addition & 1 deletion src/driver/motor_dshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void dshot_dma_start() {
for (uint32_t i = 0; i < MOTOR_PIN_MAX; i++) {
const uint32_t port = dshot_pins[i].dshot_port;
state.dshot_rpm[i] = dshot_decode_eRPM_telemetry_value(dshot_decode_gcr((uint16_t *)dshot_input_buffer[port], dshot_pins[i].pin_mask));
dshot_gpio_init_output(i);
dshot_gpio_init_output(target.motor_pins[i]);
}
}

Expand Down

0 comments on commit 6ed571d

Please sign in to comment.