Skip to content

Commit 4a0df44

Browse files
authored
Resolve compiler warning and disable CAN0 IRQ
1 parent 94833a0 commit 4a0df44

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

targets/TARGET_NUVOTON/TARGET_M261/can_api.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void can_init_freq(can_t *obj, PinName rd, PinName td, int hz)
5151

5252
const struct nu_modinit_s *modinit = get_modinit(obj->can, can_modinit_tab);
5353
MBED_ASSERT(modinit != NULL);
54-
MBED_ASSERT(modinit->modname == obj->can);
54+
MBED_ASSERT(modinit->modname == (int)obj->can);
5555

5656
obj->pin_rd = rd;
5757
obj->pin_td = td;
@@ -64,6 +64,9 @@ void can_init_freq(can_t *obj, PinName rd, PinName td, int hz)
6464

6565
// Reset this module
6666
SYS_ResetModule(modinit->rsetidx);
67+
68+
// Disable IRQ
69+
NVIC_DisableIRQ(CAN0_IRQn);
6770

6871
obj->index = 0;
6972

@@ -90,7 +93,7 @@ void can_free(can_t *obj)
9093
const struct nu_modinit_s *modinit = get_modinit(obj->can, can_modinit_tab);
9194

9295
MBED_ASSERT(modinit != NULL);
93-
MBED_ASSERT(modinit->modname == obj->can);
96+
MBED_ASSERT(modinit->modname == (int)obj->can);
9497

9598
// Reset this module
9699
SYS_ResetModule(modinit->rsetidx);

0 commit comments

Comments
 (0)