digital_signal: keep lock until all DMA transfers have finished

This commit is contained in:
g3gg0.de
2023-01-16 18:09:35 +01:00
parent 34d9fa4529
commit 19bcf0e44a

View File

@@ -490,7 +490,6 @@ bool digital_sequence_send(DigitalSequence* sequence) {
break; break;
} }
} }
FURI_CRITICAL_EXIT();
/* wait until last dma transaction was finished */ /* wait until last dma transaction was finished */
while(LL_DMA_GetDataLength(DMA1, LL_DMA_CHANNEL_2)) { while(LL_DMA_GetDataLength(DMA1, LL_DMA_CHANNEL_2)) {
@@ -498,6 +497,7 @@ bool digital_sequence_send(DigitalSequence* sequence) {
digital_signal_stop_timer(); digital_signal_stop_timer();
digital_signal_stop_dma(); digital_signal_stop_dma();
FURI_CRITICAL_EXIT();
/* undo previously prolonged edges */ /* undo previously prolonged edges */
for(uint32_t pos = 0; pos < sequence->signals_size; pos++) { for(uint32_t pos = 0; pos < sequence->signals_size; pos++) {