dshot: fix spikes/parse errors

Somehow shifting the timer enable around made a big difference and got
rid of the spikes.

Signed-off-by: Julian Oes <julian@oes.ch>
This commit is contained in:
Julian Oes 2023-05-19 09:36:01 +12:00
parent 7eb919a78c
commit 833be7ec7b
No known key found for this signature in database
GPG Key ID: F0ED380FEA56DE41
1 changed files with 3 additions and 3 deletions

View File

@ -370,6 +370,9 @@ void up_dshot_trigger(void)
} }
} }
io_timer_set_enable(true, bidirectional_dshot_enabled ? IOTimerChanMode_DshotInverted : IOTimerChanMode_Dshot,
IO_TIMER_ALL_MODES_CHANNELS);
for (unsigned timer = 0; timer < DSHOT_TIMERS; ++timer) { for (unsigned timer = 0; timer < DSHOT_TIMERS; ++timer) {
if (_timers_init_mask & (1 << timer)) { if (_timers_init_mask & (1 << timer)) {
@ -407,9 +410,6 @@ void up_dshot_trigger(void)
io_timer_update_dma_req(timer, true); io_timer_update_dma_req(timer, true);
} }
} }
io_timer_set_enable(true, bidirectional_dshot_enabled ? IOTimerChanMode_DshotInverted : IOTimerChanMode_Dshot,
IO_TIMER_ALL_MODES_CHANNELS);
} }
void do_capture(DMA_HANDLE handle, uint8_t status, void *arg) void do_capture(DMA_HANDLE handle, uint8_t status, void *arg)