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:
- 8:23c04123395c
- Parent:
- 7:78f6ee57d324
- Child:
- 9:dff7c891ec77
diff -r 78f6ee57d324 -r 23c04123395c Timer_LPTMR.cpp
--- a/Timer_LPTMR.cpp Tue Mar 11 00:52:13 2014 +0000
+++ b/Timer_LPTMR.cpp Tue Mar 11 02:42:03 2014 +0000
@@ -36,12 +36,12 @@
if (!__valid)
return 0;
- // CRITICAL SECTION
- NVIC_DisableIRQ(LPTimer_IRQn);
+ // CRITICAL SECTION -- ALL INTERRUPTS MUST BE STOPPED!
+ __disable_irq();
LPTMR0->CNR = 0; //need to write to the register in order to read it due to buffering
uint16_t ticks = LPTMR0->CNR;
uint32_t count = __count;
- NVIC_EnableIRQ(LPTimer_IRQn);
+ __enable_irq();
// END CRITICAL SECTION
//Convert to ticks
