Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-dev by
Diff: targets/TARGET_NUVOTON/TARGET_M451/us_ticker.c
- Revision:
- 175:b96e65c34a4d
- Parent:
- 160:d5399cc887bb
diff -r e131a1973e81 -r b96e65c34a4d targets/TARGET_NUVOTON/TARGET_M451/us_ticker.c
--- a/targets/TARGET_NUVOTON/TARGET_M451/us_ticker.c Fri Sep 15 14:59:18 2017 +0100
+++ b/targets/TARGET_NUVOTON/TARGET_M451/us_ticker.c Mon Oct 02 15:33:19 2017 +0100
@@ -150,19 +150,19 @@
{
TIMER_Stop((TIMER_T *) NU_MODBASE(timer1hires_modinit.modname));
- int delta = (int) (timestamp - us_ticker_read());
- if (delta > 0) {
- cd_major_minor_us = delta * US_PER_TICK;
- us_ticker_arm_cd();
- }
- else {
- cd_major_minor_us = cd_minor_us = 0;
- /**
- * This event was in the past. Set the interrupt as pending, but don't process it here.
- * This prevents a recurive loop under heavy load which can lead to a stack overflow.
- */
- NVIC_SetPendingIRQ(timer1hires_modinit.irq_n);
- }
+ uint32_t delta = timestamp - us_ticker_read();
+ cd_major_minor_us = delta * US_PER_TICK;
+ us_ticker_arm_cd();
+}
+
+void us_ticker_fire_interrupt(void)
+{
+ cd_major_minor_us = cd_minor_us = 0;
+ /**
+ * This event was in the past. Set the interrupt as pending, but don't process it here.
+ * This prevents a recurive loop under heavy load which can lead to a stack overflow.
+ */
+ NVIC_SetPendingIRQ(timer1hires_modinit.irq_n);
}
static void tmr0_vec(void)
