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 HardwareTimersLib by
Diff: Timer_LPTMR.cpp
- Revision:
- 12:cb395e4be69e
- Parent:
- 11:e0442c8b182b
- Child:
- 13:3564122e9c10
diff -r e0442c8b182b -r cb395e4be69e Timer_LPTMR.cpp
--- a/Timer_LPTMR.cpp Tue Mar 11 04:54:13 2014 +0000
+++ b/Timer_LPTMR.cpp Tue Mar 11 05:38:56 2014 +0000
@@ -89,9 +89,10 @@
void Timer_LPTMR::__timer_isr() {
LPTMR0->CSR |= LPTMR_CSR_TCF_MASK; //Write 1 to TCF to clear the LPT timer compare flag
- if ((__periodic || __call_user_function) && __user_fptr != NULL) { //user callback
+ if ((__periodic || __num_callbacks > 0) && __user_fptr != NULL) { //user callback
__user_fptr->call();
- __call_user_function = false;
+ if (!__periodic)
+ __num_callbacks--;
}
__count++;
}
