Skip to content

Commit 0d4e447

Browse files
Add workaround for changes to cyhal_lptimer_irq_trigger.
1 parent 0cf1589 commit 0d4e447

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

targets/TARGET_Cypress/TARGET_PSOC6/cy_lp_ticker_api.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ void lp_ticker_clear_interrupt(void)
7979

8080
void lp_ticker_fire_interrupt(void)
8181
{
82-
cyhal_lptimer_irq_trigger(&cy_lptimer0);
82+
// mbed expects this function to trigger an actual interrupt (not just call
83+
// the callback). Since recent changes made to cyhal_lptimer_irq_trigger
84+
// do, in fact, just call the callback directly, set a pending irq here and
85+
// don't call the cyhal function.
86+
CY_ASSERT(CYHAL_RSC_INVALID != cy_lptimer0.resource.block_num);
87+
IRQn_Type irqn = (IRQn_Type)(srss_interrupt_mcwdt_0_IRQn + cy_lptimer0.resource.block_num);
88+
NVIC_SetPendingIRQ(irqn);
8389
}
8490

8591
const ticker_info_t *lp_ticker_get_info(void)

0 commit comments

Comments
 (0)