defining the mock function pointer using the __attribute__((section(...))) trick
This commit is contained in:
parent
4754b65041
commit
833d604b2f
2 changed files with 19 additions and 33 deletions
20
dmahelper.h
20
dmahelper.h
|
@ -13,8 +13,8 @@
|
|||
#ifndef DECLARE_MOCKPTR
|
||||
#define DECLARE_MOCKPTR(...)
|
||||
#endif
|
||||
#ifndef MOCKABLE
|
||||
#define MOCKABLE(x) x
|
||||
#ifndef MAKE_MOCKABLE
|
||||
#define MAKE_MOCKABLE(x) x
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -44,14 +44,14 @@ DECLARE_MOCKPTR(uint32_t, Dma_GetFeMask, uint32_t)
|
|||
DECLARE_MOCKPTR(void, Dma_Init, struct dmainfo_t*, DMA_TypeDef*, uint32_t)
|
||||
#endif // UNITTEST
|
||||
|
||||
volatile uint32_t* MOCKABLE(Dma_GetIsReg)(DMA_TypeDef *dma, uint32_t stream);
|
||||
volatile uint32_t* MOCKABLE(Dma_GetIfcReg)(DMA_TypeDef *dma, uint32_t stream);
|
||||
uint32_t MOCKABLE(Dma_GetDmeMask)(uint32_t stream);
|
||||
uint32_t MOCKABLE(Dma_GetTeMask)(uint32_t stream);
|
||||
uint32_t MOCKABLE(Dma_GetHtMask)(uint32_t stream);
|
||||
uint32_t MOCKABLE(Dma_GetTcMask)(uint32_t stream);
|
||||
uint32_t MOCKABLE(Dma_GetFeMask)(uint32_t stream);
|
||||
void MOCKABLE(Dma_Init)(struct dmainfo_t *info, DMA_TypeDef *dma, uint32_t stream);
|
||||
volatile uint32_t* MAKE_MOCKABLE(Dma_GetIsReg)(DMA_TypeDef *dma, uint32_t stream);
|
||||
volatile uint32_t* MAKE_MOCKABLE(Dma_GetIfcReg)(DMA_TypeDef *dma, uint32_t stream);
|
||||
uint32_t MAKE_MOCKABLE(Dma_GetDmeMask)(uint32_t stream);
|
||||
uint32_t MAKE_MOCKABLE(Dma_GetTeMask)(uint32_t stream);
|
||||
uint32_t MAKE_MOCKABLE(Dma_GetHtMask)(uint32_t stream);
|
||||
uint32_t MAKE_MOCKABLE(Dma_GetTcMask)(uint32_t stream);
|
||||
uint32_t MAKE_MOCKABLE(Dma_GetFeMask)(uint32_t stream);
|
||||
void MAKE_MOCKABLE(Dma_Init)(struct dmainfo_t *info, DMA_TypeDef *dma, uint32_t stream);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue