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.
Dependencies: LPC1114_WakeInterruptIn
Fork of WakeUp by
Diff: Device/WakeUp_LPC11XX.cpp
- Revision:
- 14:6bf547e1e62d
- Parent:
- 13:fd24cec76d5a
--- a/Device/WakeUp_LPC11XX.cpp Wed Jul 30 20:02:47 2014 +0000
+++ b/Device/WakeUp_LPC11XX.cpp Wed Jul 30 20:39:57 2014 +0000
@@ -108,6 +108,10 @@
void WakeUp::calibrate(void)
{
+ //Save current pin function
+ __IO uint32_t *reg = (__IO uint32_t*)(LPC_IOCON_BASE + (dp24 & 0xFF));
+ uint32_t old_pinfun = *reg;
+
//Set oscillator for 20kHz
LPC_SYSCON->PDRUNCFG &= ~PDRUNCFG_WDTOSC_PD;
LPC_SYSCON->WDTOSCCTRL = 14 | (1<<5);
@@ -130,6 +134,10 @@
count++;
}
cycles_per_ms = (float)count / 100.0f;
+
+ //Set old pin function back, disable CLKOUT
+ *reg = old_pinfun;
+ LPC_SYSCON->CLKOUTDIV = 0;
}
static inline void restore(void) {
