Skip to content

Commit

Permalink
Fix DMA & NVIC driver warnigns. RevB DMA driver had incorrect pointer…
Browse files Browse the repository at this point in the history
… syntax. NVIC driver had an extern inside a function.
  • Loading branch information
Brandon-Hurst committed Oct 13, 2024
1 parent 2e34472 commit 58d6aca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Libraries/PeriphDrivers/Source/DMA/dma_revb.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
* Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
* Analog Devices, Inc.),
* Copyright (C) 2023-2024 Analog Devices, Inc.
*
Expand Down Expand Up @@ -197,7 +197,7 @@ int MXC_DMA_RevB_SetSrcDst(mxc_dma_srcdst_t srcdst)
//TODO(ADI): Necessary?
int MXC_DMA_RevB_GetSrcDst(mxc_dma_srcdst_t *srcdst)
{
if (CHECK_HANDLE(srcdst.ch)) {
if (CHECK_HANDLE(srcdst->ch)) {
srcdst->source = (void *)dma_resource[srcdst->ch].regs->src;
srcdst->dest = (void *)dma_resource[srcdst->ch].regs->dst;
srcdst->len = (dma_resource[srcdst->ch].regs->cnt) & ~MXC_F_DMA_CNTRLD_EN;
Expand Down Expand Up @@ -231,7 +231,7 @@ int MXC_DMA_RevB_SetSrcReload(mxc_dma_srcdst_t srcdst)
//TODO(ADI): Necessary?
int MXC_DMA_RevB_GetSrcReload(mxc_dma_srcdst_t *srcdst)
{
if (CHECK_HANDLE(srcdst.ch)) {
if (CHECK_HANDLE(srcdst->ch)) {
srcdst->source = (void *)dma_resource[srcdst->ch].regs->srcrld;
srcdst->dest = (void *)dma_resource[srcdst->ch].regs->dstrld;
srcdst->len = (dma_resource[srcdst->ch].regs->cntrld) & ~MXC_F_DMA_CNTRLD_EN;
Expand Down
4 changes: 2 additions & 2 deletions Libraries/PeriphDrivers/Source/DMA/dma_revb.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
* Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
* Analog Devices, Inc.),
* Copyright (C) 2023-2024 Analog Devices, Inc.
*
Expand Down Expand Up @@ -47,7 +47,7 @@ int MXC_DMA_RevB_DisableInt(int ch);
int MXC_DMA_RevB_Start(int ch);
int MXC_DMA_RevB_Stop(int ch);
mxc_dma_ch_regs_t *MXC_DMA_RevB_GetCHRegs(int ch);
void MXC_DMA_RevB_Handler();
void MXC_DMA_RevB_Handler(void);
int MXC_DMA_RevB_MemCpy(void *dest, void *src, int len, mxc_dma_complete_cb_t callback);
int MXC_DMA_RevB_DoTransfer(mxc_dma_config_t config, mxc_dma_srcdst_t firstSrcDst,
mxc_dma_trans_chain_t callback);
Expand Down
6 changes: 3 additions & 3 deletions Libraries/PeriphDrivers/Source/SYS/nvic_table.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
* Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
* Analog Devices, Inc.),
* Copyright (C) 2023-2024 Analog Devices, Inc.
*
Expand Down Expand Up @@ -35,15 +35,15 @@ __attribute__((aligned(512)))
#endif
static void (*ramVectorTable[MXC_IRQ_COUNT])(void);

void NVIC_SetRAM(void)
{
#if defined(__ICCARM__)
extern void (*const __isr_vector[])(void);
#else
/* should be defined in starup_<device>.S */
extern uint32_t __isr_vector[MXC_IRQ_COUNT];
#endif

void NVIC_SetRAM(void)
{
memcpy(&ramVectorTable, &__isr_vector, sizeof(ramVectorTable));
SCB->VTOR = (uint32_t)&ramVectorTable;
}
Expand Down

0 comments on commit 58d6aca

Please sign in to comment.