@@ -121,16 +121,16 @@ modm::platform::Can{{ id }}::initializeWithPrescaler(
121121 NVIC_EnableIRQ(CEC_CAN_IRQn);
122122%% else
123123 // Set vector priority
124- NVIC_SetPriority({{ reg }}_RX0_IRQn , interruptPriority);
125- NVIC_SetPriority({{ reg }}_RX1_IRQn , interruptPriority);
124+ NVIC_SetPriority({{ irqs.rx0 }}_IRQn , interruptPriority);
125+ NVIC_SetPriority({{ irqs.rx1 }}_IRQn , interruptPriority);
126126
127127 // Register Interrupts at the NVIC
128- NVIC_EnableIRQ({{ reg }}_RX0_IRQn );
129- NVIC_EnableIRQ({{ reg }}_RX1_IRQn );
128+ NVIC_EnableIRQ({{ irqs.rx0 }}_IRQn );
129+ NVIC_EnableIRQ({{ irqs.rx1 }}_IRQn );
130130
131131 %% if options["buffer.tx"] > 0
132- NVIC_EnableIRQ({{ reg }}_TX_IRQn );
133- NVIC_SetPriority({{ reg }}_TX_IRQn , interruptPriority);
132+ NVIC_EnableIRQ({{ irqs.tx }}_IRQn );
133+ NVIC_SetPriority({{ irqs.tx }}_IRQn , interruptPriority);
134134 %% endif
135135%% endif
136136
@@ -220,8 +220,11 @@ readMailbox(modm::can::Message& message, uint32_t mailboxId, uint8_t* filter_id)
220220 *
221221 * Generated when Transmit Mailbox 0..2 becomes empty.
222222 */
223-
224- MODM_ISR({{ reg }}_TX)
223+ %% if combined_isr
224+ void MODM_ISR_NAME({{ irqs.tx }})()
225+ %% else
226+ MODM_ISR({{ irqs.tx }})
227+ %% endif
225228{
226229%% if options["buffer.tx"] > 0
227230 uint32_t mailbox;
@@ -254,7 +257,11 @@ MODM_ISR({{ reg }}_TX)
254257 * Generated on a new received message, FIFO0 full condition and Overrun
255258 * Condition.
256259 */
257- MODM_ISR({{ reg }}_RX0)
260+ %% if combined_isr
261+ void MODM_ISR_NAME({{ irqs.rx0 }})()
262+ %% else
263+ MODM_ISR({{ irqs.rx0 }})
264+ %% endif
258265{
259266 if (not modm_assert_continue_ignore(not ({{ reg }}->RF0R & CAN_RF0R_FOVR0),
260267 "can.rx.hw0", "CAN receive hardware buffer overflowed!", {{ 0 if id == '' else id }}))
@@ -280,7 +287,11 @@ MODM_ISR({{ reg }}_RX0)
280287 *
281288 * See FIFO0 Interrupt
282289 */
283- MODM_ISR({{ reg }}_RX1)
290+ %% if combined_isr
291+ void MODM_ISR_NAME({{ irqs.rx1 }})()
292+ %% else
293+ MODM_ISR({{ irqs.rx1 }})
294+ %% endif
284295{
285296 if (not modm_assert_continue_ignore(not ({{ reg }}->RF1R & CAN_RF1R_FOVR1),
286297 "can.rx.hw1", "CAN receive hardware buffer overflowed!", {{ 0 if id == '' else id }}))
@@ -301,7 +312,7 @@ MODM_ISR({{ reg }}_RX1)
301312%% endif
302313}
303314
304- %% if target["family"] == "f0"
315+ %% if combined_isr
305316// On stm32f0, ST has decided to use only one interrupt vector for all
306317// CAN interrupts. In order to avoide duplicate code, we try to determine
307318// the interrupt source and call the correct interrupts function defined above.
@@ -310,15 +321,15 @@ MODM_ISR({{ reg }}_RX1)
310321MODM_ISR(CEC_CAN)
311322{
312323 if({{ reg }}->TSR & (CAN_TSR_RQCP0 | CAN_TSR_RQCP1 | CAN_TSR_RQCP2)) {
313- MODM_ISR_CALL ({{ reg }}_TX );
324+ MODM_ISR_NAME ({{ irqs.tx }})( );
314325 }
315326
316327 if({{ reg }}->RF0R & (CAN_RF0R_FMP0 | CAN_RF0R_FULL0 | CAN_RF0R_FOVR0)) {
317- MODM_ISR_CALL ({{ reg }}_RX0 );
328+ MODM_ISR_NAME ({{ irqs.rx0 }})( );
318329 }
319330
320331 if({{ reg }}->RF1R & (CAN_RF1R_FMP1 | CAN_RF1R_FULL1 | CAN_RF1R_FOVR1)) {
321- MODM_ISR_CALL ({{ reg }}_RX1 );
332+ MODM_ISR_NAME ({{ irqs.rx1 }})( );
322333 }
323334
324335 // TODO: we do not handle status changes at the moment.
0 commit comments