Skip to content

Commit 0501a14

Browse files
Merge pull request ARMmbed#4308 from c1728p9/MAX32630FTHR_fix_NVIC_SetVector
Fix NVIC_SetVector type in HAL for MAX32630FTHR
2 parents d7594f6 + d4bab30 commit 0501a14

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

targets/TARGET_Maxim/TARGET_MAX32630/gpio_irq_api.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ int gpio_irq_init(gpio_irq_t *obj, PinName name, gpio_irq_handler handler, uint3
100100

101101
/* register handlers */
102102
irq_handler = handler;
103-
NVIC_SetVector(GPIO_P0_IRQn, gpio_irq_0);
104-
NVIC_SetVector(GPIO_P1_IRQn, gpio_irq_1);
105-
NVIC_SetVector(GPIO_P2_IRQn, gpio_irq_2);
106-
NVIC_SetVector(GPIO_P3_IRQn, gpio_irq_3);
107-
NVIC_SetVector(GPIO_P4_IRQn, gpio_irq_4);
108-
NVIC_SetVector(GPIO_P5_IRQn, gpio_irq_5);
109-
NVIC_SetVector(GPIO_P6_IRQn, gpio_irq_6);
110-
NVIC_SetVector(GPIO_P7_IRQn, gpio_irq_7);
111-
NVIC_SetVector(GPIO_P8_IRQn, gpio_irq_8);
103+
NVIC_SetVector(GPIO_P0_IRQn, (uint32_t)gpio_irq_0);
104+
NVIC_SetVector(GPIO_P1_IRQn, (uint32_t)gpio_irq_1);
105+
NVIC_SetVector(GPIO_P2_IRQn, (uint32_t)gpio_irq_2);
106+
NVIC_SetVector(GPIO_P3_IRQn, (uint32_t)gpio_irq_3);
107+
NVIC_SetVector(GPIO_P4_IRQn, (uint32_t)gpio_irq_4);
108+
NVIC_SetVector(GPIO_P5_IRQn, (uint32_t)gpio_irq_5);
109+
NVIC_SetVector(GPIO_P6_IRQn, (uint32_t)gpio_irq_6);
110+
NVIC_SetVector(GPIO_P7_IRQn, (uint32_t)gpio_irq_7);
111+
NVIC_SetVector(GPIO_P8_IRQn, (uint32_t)gpio_irq_8);
112112

113113
/* disable the interrupt locally */
114114
MXC_GPIO->int_mode[port] &= ~(0xF << (pin*4));

targets/TARGET_Maxim/TARGET_MAX32630/mxc/nvic_table.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void NVIC_SetRAM(void)
7676
}
7777

7878
/* ************************************************************************* */
79-
int NVIC_SetVector(IRQn_Type irqn, void(*irq_handler)(void))
79+
int NVIC_SetVector(IRQn_Type irqn, uint32_t irq_handler)
8080
{
8181
int index = irqn + 16; /* offset for externals */
8282

@@ -85,7 +85,7 @@ int NVIC_SetVector(IRQn_Type irqn, void(*irq_handler)(void))
8585
NVIC_SetRAM();
8686
}
8787

88-
ramVectorTable[index] = irq_handler;
88+
ramVectorTable[index] = (void(*)(void))irq_handler;
8989
NVIC_EnableIRQ(irqn);
9090

9191
return 0;

targets/TARGET_Maxim/TARGET_MAX32630/mxc/nvic_table.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ typedef void (*irq_fn)(void);
7171
* @param irqn ARM external IRQ number, see #IRQn_Type
7272
* @param irq_handler Function to be called at IRQ context
7373
*/
74-
int NVIC_SetVector(IRQn_Type irqn, irq_fn irq_handler);
74+
int NVIC_SetVector(IRQn_Type irqn, uint32_t irq_handler);
7575

7676
/**
7777
* @brief Copy NVIC vector table to RAM and set NVIC to RAM based table.

targets/TARGET_Maxim/TARGET_MAX32630/rtc_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ void rtc_init(void)
7171
CLKMAN_SetClkScale(CLKMAN_CLK_SYNC, CLKMAN_SCALE_DIV_1);
7272

7373
// Prepare interrupt handlers
74-
NVIC_SetVector(RTC0_IRQn, lp_ticker_irq_handler);
74+
NVIC_SetVector(RTC0_IRQn, (uint32_t)lp_ticker_irq_handler);
7575
NVIC_EnableIRQ(RTC0_IRQn);
76-
NVIC_SetVector(RTC3_IRQn, overflow_handler);
76+
NVIC_SetVector(RTC3_IRQn, (uint32_t)overflow_handler);
7777
NVIC_EnableIRQ(RTC3_IRQn);
7878

7979
// Enable wakeup on RTC rollover

targets/TARGET_Maxim/TARGET_MAX32630/serial_api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,19 +202,19 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
202202
{
203203
switch (obj->index) {
204204
case 0:
205-
NVIC_SetVector(UART0_IRQn, uart0_handler);
205+
NVIC_SetVector(UART0_IRQn, (uint32_t)uart0_handler);
206206
NVIC_EnableIRQ(UART0_IRQn);
207207
break;
208208
case 1:
209-
NVIC_SetVector(UART1_IRQn, uart1_handler);
209+
NVIC_SetVector(UART1_IRQn, (uint32_t)uart1_handler);
210210
NVIC_EnableIRQ(UART1_IRQn);
211211
break;
212212
case 2:
213-
NVIC_SetVector(UART2_IRQn, uart2_handler);
213+
NVIC_SetVector(UART2_IRQn, (uint32_t)uart2_handler);
214214
NVIC_EnableIRQ(UART2_IRQn);
215215
break;
216216
case 3:
217-
NVIC_SetVector(UART3_IRQn, uart3_handler);
217+
NVIC_SetVector(UART3_IRQn, (uint32_t)uart3_handler);
218218
NVIC_EnableIRQ(UART3_IRQn);
219219
break;
220220
default:

targets/TARGET_Maxim/TARGET_MAX32630/us_ticker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void us_ticker_init(void)
140140
cfg.compareCount = 0xFFFFFFFF;
141141
TMR32_Config(US_TIMER, &cfg);
142142

143-
NVIC_SetVector(US_TIMER_IRQn, tmr_handler);
143+
NVIC_SetVector(US_TIMER_IRQn, (uint32_t)tmr_handler);
144144
NVIC_EnableIRQ(US_TIMER_IRQn);
145145
TMR32_EnableINT(US_TIMER);
146146

0 commit comments

Comments
 (0)