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_PIT.cpp
- Revision:
- 12:cb395e4be69e
- Parent:
- 11:e0442c8b182b
--- a/Timer_PIT.cpp Tue Mar 11 04:54:13 2014 +0000
+++ b/Timer_PIT.cpp Tue Mar 11 05:38:56 2014 +0000
@@ -79,9 +79,10 @@
void Timer_PIT::__timer_isr() {
PIT->CHANNEL[0].TFLG |= PIT_TFLG_TIF_MASK; //Clear the timer interrupt flag bit
- 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++;
}
