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: libmDot mbed-rtos mbed
Revision 3:238fa32bcb32, committed 2016-05-26
- Comitter:
- boddeke
- Date:
- Thu May 26 09:03:15 2016 +0000
- Parent:
- 2:a2371a150758
- Commit message:
- working wakeup (reed between pa_0 and vss)
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed May 25 23:03:33 2016 +0000
+++ b/main.cpp Thu May 26 09:03:15 2016 +0000
@@ -9,7 +9,11 @@
#define REED_PORT PA_0
-DigitalIn reed_sensor(PA_0, PullUp);
+// PA_0 = WKUP
+// wakeup on rising edge
+// reeed on PA_0 to Vss (3.3V)
+// no internal pull in sleep mode
+DigitalIn reed_sensor(PA_0, PullNone);
RawSerial pc(PA_2,NC);
@@ -28,6 +32,7 @@
mDot* dot = mDot::getInstance();
dot->setLogLevel(MTSLog::TRACE_LEVEL);
+ // clear the EWUP state
if(dot->getStandbyFlag()){
pc.printf("clearing standby flag\r\n");
PWR->CSR &= ~PWR_CSR_EWUP;
@@ -39,7 +44,7 @@
InterruptIn reed_sensor_change(REED_PORT);
reed_sensor_change.fall(&isr_reed_sensor_change);
reed_sensor_change.rise(&isr_reed_sensor_change);
- reed_sensor_change.mode(PullUp);
+ reed_sensor_change.mode(PullNone);
while(1) {
@@ -49,6 +54,6 @@
wait(1.0);
}
- dot->sleep((int)10, mDot::RTC_ALARM_OR_INTERRUPT, true);
+ dot->sleep((int)30, mDot::RTC_ALARM_OR_INTERRUPT, true);
}
}
\ No newline at end of file