Skip to content

Commit b5db960

Browse files
0xc0170Bartek Szatkowski
authored andcommitted
MAX32630FTHR: fix IAR error for NVIC_SetVector in HAL
The error: Error[Pe167]: argument of type "void (*)(void)" is incompatible with parameter of type "uint32_t".
1 parent 83345ad commit b5db960

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
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/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)