Make possible to mock internal code
This commit is contained in:
parent
7079f939d0
commit
c574fdbe82
2 changed files with 58 additions and 1 deletions
19
dmahelper.c
19
dmahelper.c
|
@ -6,6 +6,25 @@
|
|||
*/
|
||||
#include <f4ll_c/dmahelper.h>
|
||||
|
||||
#ifdef UNITTEST
|
||||
MOCKME_IMPL(volatile uint32_t*, Dma_GetIsReg, DMA_TypeDef*, uint32_t)
|
||||
MOCKME_IMPL(volatile uint32_t*, Dma_GetIfcReg, DMA_TypeDef*, uint32_t)
|
||||
MOCKME_IMPL(uint32_t, Dma_GetDmeMask, uint32_t)
|
||||
MOCKME_IMPL(uint32_t, Dma_GetTeMask, uint32_t)
|
||||
MOCKME_IMPL(uint32_t, Dma_GetHtMask, uint32_t)
|
||||
MOCKME_IMPL(uint32_t, Dma_GetTcMask, uint32_t)
|
||||
MOCKME_IMPL(uint32_t, Dma_GetFeMask, uint32_t)
|
||||
MOCKME_IMPL(void, Dma_Init, struct dmainfo_t*, DMA_TypeDef*, uint32_t)
|
||||
|
||||
#define Dma_GetIsReg(...) Dma_GetIsReg_(__VA_ARGS__)
|
||||
#define Dma_GetIfcReg(...) Dma_GetIfcReg_(__VA_ARGS__)
|
||||
#define Dma_GetDmeMask(...) Dma_GetDmeMask_(__VA_ARGS__)
|
||||
#define Dma_GetTeMask(...) Dma_GetTeMask_(__VA_ARGS__)
|
||||
#define Dma_GetHtMask(...) Dma_GetHtMask_(__VA_ARGS__)
|
||||
#define Dma_GetTcMask(...) Dma_GetTcMask_(__VA_ARGS__)
|
||||
#define Dma_GetFeMask(...) Dma_GetFeMask_(__VA_ARGS__)
|
||||
#define Dma_Init(...) Dma_Init_(__VA_ARGS__)
|
||||
#endif // UNITTEST
|
||||
|
||||
volatile uint32_t* Dma_GetIsReg(DMA_TypeDef *dma, uint32_t stream)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue