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:
- 11:e0442c8b182b
- Parent:
- 9:dff7c891ec77
- Child:
- 12:cb395e4be69e
--- a/Timer_PIT.cpp Tue Mar 11 04:18:04 2014 +0000
+++ b/Timer_PIT.cpp Tue Mar 11 04:54:13 2014 +0000
@@ -39,10 +39,14 @@
uint32_t tick;
uint32_t count;
- __disable_irq(); //CRITICAL SECTION -- ALL INTERRUPTS MUST BE STOPPED!
+ //__disable_irq(); //CRITICAL SECTION -- ALL INTERRUPTS MUST BE STOPPED!
tick = PIT->CHANNEL[0].CVAL; //counts down
+
+ //It is theoretically possible that the timer interrupt is invoked here, between these two lines.
+ //However, the timer doesn't appear to work properly if I put these two in a critical section.
+
count = __count;
- __enable_irq(); //END CRITICAL SECTION
+ //__enable_irq(); //END CRITICAL SECTION
//Convert to ticks
return (__rolloverValue - tick) + count * __rolloverValue;
