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
Revision 14:6bf547e1e62d, committed 2014-07-30
- Comitter:
- Sissors
- Date:
- Wed Jul 30 20:39:57 2014 +0000
- Parent:
- 13:fd24cec76d5a
- Child:
- 15:b2a710aca356
- Commit message:
- Calibrate on LPC1114 now restores pin function settings afterwards (previously this broke wakeups were dp24 was used).
;
; Moved WakeInterruptIn to Device folder.
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Device/LPC1114_WakeInterruptIn.lib Wed Jul 30 20:39:57 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Sissors/code/LPC1114_WakeInterruptIn/#128f3fe79240
--- 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) {
--- a/LPC1114_WakeInterruptIn.lib Wed Jul 30 20:02:47 2014 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/Sissors/code/LPC1114_WakeInterruptIn/#128f3fe79240
