mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
Timer code simplification in preparation of led strip being assignable.
Moved some repeated code into timer.c - preparation for allowing resource command for led strip
This commit is contained in:
parent
d5e20232be
commit
fe3ac4754e
14 changed files with 103 additions and 136 deletions
|
@ -87,3 +87,16 @@ void dmaSetHandler(dmaHandlerIdentifier_e identifier, dmaCallbackHandlerFuncPtr
|
|||
NVIC_Init(&NVIC_InitStructure);
|
||||
}
|
||||
|
||||
#define RETURN_TCIF_FLAG(s, n) if (s == DMA1_Stream ## n || s == DMA2_Stream ## n) return DMA_IT_TCIF ## n
|
||||
|
||||
uint32_t dmaFlag_IT_TCIF(const DMA_Stream_TypeDef *stream)
|
||||
{
|
||||
RETURN_TCIF_FLAG(stream, 0);
|
||||
RETURN_TCIF_FLAG(stream, 1);
|
||||
RETURN_TCIF_FLAG(stream, 2);
|
||||
RETURN_TCIF_FLAG(stream, 3);
|
||||
RETURN_TCIF_FLAG(stream, 4);
|
||||
RETURN_TCIF_FLAG(stream, 5);
|
||||
RETURN_TCIF_FLAG(stream, 6);
|
||||
RETURN_TCIF_FLAG(stream, 7);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue