From a17ad75673cdf39e5220b49ec1d7a4b8a4e7d505 Mon Sep 17 00:00:00 2001 From: Attila BODY Date: Thu, 21 Nov 2019 12:38:35 +0100 Subject: [PATCH] removing DMAINFO typedef --- application/application.c | 2 +- application/globals.c | 2 +- application/globals.h | 2 +- components/f4ll_c/consolehandler.c | 4 ++-- components/f4ll_c/consolehandler.h | 4 ++-- components/f4ll_c/crcscheduler.h | 2 +- components/f4ll_c/dmahelper.c | 2 +- components/f4ll_c/dmahelper.h | 6 +++--- components/f4ll_c/memcpydma.c | 4 ++-- components/f4ll_c/packetusart.h | 4 ++-- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/application/application.c b/application/application.c index 4485bb6..c296925 100644 --- a/application/application.c +++ b/application/application.c @@ -52,7 +52,7 @@ void MainLoop() while((randmask = randmask >> 1)); randmask -= 1; - Crc_InitStatus(&g_crcStatus, DMA2, LL_DMA_STREAM_4); + Crc_InitStatus(&g_crcStatus, CRC, DMA2, LL_DMA_STREAM_4); for(uint16_t idx = 0; idx < sizeof(g_uartStatuses) / sizeof(g_uartStatuses[0]); ++idx) { struct initdata_t const *id = &initdata[idx]; diff --git a/application/globals.c b/application/globals.c index 5edc7dd..f70e4b6 100644 --- a/application/globals.c +++ b/application/globals.c @@ -11,6 +11,6 @@ struct usartstatus_t g_uartStatuses[USARTCOUNT]; struct crcstatus_t g_crcStatus; -DMAINFO g_ConsoleTxDmaInfo; +struct dmainfo_t g_ConsoleTxDmaInfo; uint8_t g_statsBuf[256]; diff --git a/application/globals.h b/application/globals.h index 2b89278..b1c2ade 100644 --- a/application/globals.h +++ b/application/globals.h @@ -18,7 +18,7 @@ extern struct usartstatus_t g_uartStatuses[USARTCOUNT]; extern struct crcstatus_t g_crcStatus; -extern DMAINFO g_ConsoleTxDmaInfo; +extern struct dmainfo_t g_ConsoleTxDmaInfo; extern uint8_t g_statsBuf[256]; #endif /* GLOBALS_H_ */ diff --git a/components/f4ll_c/consolehandler.c b/components/f4ll_c/consolehandler.c index 7b6e944..cc19494 100644 --- a/components/f4ll_c/consolehandler.c +++ b/components/f4ll_c/consolehandler.c @@ -17,7 +17,7 @@ # define DIAG_INTERRUPT_OUT() #endif -void Con_HandleTxDmaIrq(DMAINFO *info, USART_TypeDef *usart) // debug usart +void Con_HandleTxDmaIrq(struct dmainfo_t *info, USART_TypeDef *usart) // debug usart { DIAG_INTERRUPT_IN(); if(*info->isReg & info->tcMask) { // DMA transfer complete @@ -40,7 +40,7 @@ void Con_HandleUsartIrq(USART_TypeDef *usart) b += strcpy_ex(b,s); \ b += uitodec(b,u); -void Con_PrintStats(char *buffer, uint8_t id, struct usart_stats *stats, USART_TypeDef *usart, DMAINFO *dmaInfo) +void Con_PrintStats(char *buffer, uint8_t id, struct usart_stats *stats, USART_TypeDef *usart, struct dmainfo_t *dmaInfo) { char ids[] = " : "; char *bs = buffer; diff --git a/components/f4ll_c/consolehandler.h b/components/f4ll_c/consolehandler.h index cbb9207..c9a0167 100644 --- a/components/f4ll_c/consolehandler.h +++ b/components/f4ll_c/consolehandler.h @@ -12,9 +12,9 @@ #include "f4ll_c/dmahelper.h" #include "f4ll_c/packetusart.h" -void Con_HandleTxDmaIrq(DMAINFO *info, USART_TypeDef *usart); +void Con_HandleTxDmaIrq(struct dmainfo_t *info, USART_TypeDef *usart); void Con_HandleUsartIrq(USART_TypeDef *usart); -void Con_PrintStats(char *buffer, uint8_t id, struct usart_stats *stats, USART_TypeDef *usart, DMAINFO *dmaInfo); +void Con_PrintStats(char *buffer, uint8_t id, struct usart_stats *stats, USART_TypeDef *usart, struct dmainfo_t *dmaInfo); #endif /* INTERRUPT_HANDLERS_H_ */ diff --git a/components/f4ll_c/crcscheduler.h b/components/f4ll_c/crcscheduler.h index b82a1e0..2d9d851 100644 --- a/components/f4ll_c/crcscheduler.h +++ b/components/f4ll_c/crcscheduler.h @@ -30,7 +30,7 @@ struct crcslotlistitem_t { }; struct crcstatus_t { - DMAINFO dmaInfo; + struct dmainfo_t dmaInfo; struct crcslotlistitem_t *activeSlot; uint8_t activeTask; struct crcslotlistitem_t *first; diff --git a/components/f4ll_c/dmahelper.c b/components/f4ll_c/dmahelper.c index b516d43..867cdf4 100644 --- a/components/f4ll_c/dmahelper.c +++ b/components/f4ll_c/dmahelper.c @@ -64,7 +64,7 @@ uint32_t Dma_GetTcMask(uint32_t stream) return tcMasks[stream]; } -void Dma_Init(DMAINFO *info, DMA_TypeDef *dma, uint32_t stream) +void Dma_Init(struct dmainfo_t *info, DMA_TypeDef *dma, uint32_t stream) { info->dma = dma; info->stream = stream; diff --git a/components/f4ll_c/dmahelper.h b/components/f4ll_c/dmahelper.h index d54e22c..221a4f2 100644 --- a/components/f4ll_c/dmahelper.h +++ b/components/f4ll_c/dmahelper.h @@ -10,7 +10,7 @@ #include #include -typedef struct { +struct dmainfo_t { DMA_TypeDef *dma; uint32_t stream; volatile uint32_t *isReg; @@ -20,7 +20,7 @@ typedef struct { uint32_t teMask; uint32_t htMask; uint32_t tcMask; -} DMAINFO; +}; volatile uint32_t* Dma_GetIsReg(DMA_TypeDef *dma, uint32_t stream); volatile uint32_t* Dma_GetIfcReg(DMA_TypeDef *dma, uint32_t stream); @@ -30,6 +30,6 @@ uint32_t Dma_GetHtMask(uint32_t stream); uint32_t Dma_GetTcMask(uint32_t stream); uint32_t Dma_GetFeMask(uint32_t stream); -void Dma_Init(DMAINFO *info, DMA_TypeDef *dma, uint32_t stream); +void Dma_Init(struct dmainfo_t *info, DMA_TypeDef *dma, uint32_t stream); #endif /* DMA_HELPER_H_ */ diff --git a/components/f4ll_c/memcpydma.c b/components/f4ll_c/memcpydma.c index 68b725e..17938cd 100644 --- a/components/f4ll_c/memcpydma.c +++ b/components/f4ll_c/memcpydma.c @@ -15,9 +15,9 @@ # define DIAG_INTERRUPT_OUT() #endif -volatile uint8_t g_memcpyDmaBusy = 0; +volatile uint8_t g_memcpyDmaBusy = 0; -static DMAINFO g_memcpyDmaInfo; +static struct dmainfo_t g_memcpyDmaInfo; void Mcd_Init(DMA_TypeDef *dma, uint32_t stream) { diff --git a/components/f4ll_c/packetusart.h b/components/f4ll_c/packetusart.h index c980a8b..8c4f202 100644 --- a/components/f4ll_c/packetusart.h +++ b/components/f4ll_c/packetusart.h @@ -79,8 +79,8 @@ struct usart_buffer_t { struct usartstatus_t { USART_TypeDef *usart; - DMAINFO rxDmaInfo; - DMAINFO txDmaInfo; + struct dmainfo_t rxDmaInfo; + struct dmainfo_t txDmaInfo; struct crcstatus_t *crcStatus; struct crcslotlistitem_t crcSlot; struct crcslottask_t crcTasks[2];