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.
Revision 88:d120930aeb13, committed 2017-08-30
- Comitter:
- Helmut Tschemernjak
- Date:
- Wed Aug 30 09:48:34 2017 +0200
- Parent:
- 87:5f31c157ed15
- Child:
- 89:b0203b4a36ec
- Commit message:
- Added Timeout class low/high timeout registration.
Arduino cannot handle edge level interrupts in
deepsleep
Changed in this revision
--- a/Arduino-mbed-APIs/arduino-mbed.cpp Wed Aug 23 16:26:21 2017 +0200
+++ b/Arduino-mbed-APIs/arduino-mbed.cpp Wed Aug 30 09:48:34 2017 +0200
@@ -235,6 +235,34 @@
}
}
+void
+InterruptIn::high(Callback<void()> func) {
+ if (func) {
+ _func = func;
+ intPtrTable[_gpioPin].context = this;
+ attachInterrupt(MYdigitalPinToInterrupt(_gpioPin), intPtrTable[_gpioPin].func, HIGH);
+ } else {
+ _func = InterruptIn::donothing;
+ intPtrTable[_gpioPin].context = NULL;
+ detachInterrupt(_gpioPin);
+ }
+}
+
+void
+InterruptIn::low(Callback<void()> func) {
+ if (func) {
+ _func = func;
+ intPtrTable[_gpioPin].context = this;
+ attachInterrupt(MYdigitalPinToInterrupt(_gpioPin), intPtrTable[_gpioPin].func, LOW);
+ } else {
+ _func = InterruptIn::donothing;
+ intPtrTable[_gpioPin].context = NULL;
+ detachInterrupt(_gpioPin);
+ }
+}
+
+
+
uint32_t s_getTicker(void)
{
--- a/Arduino-mbed-APIs/arduino-mbed.h Wed Aug 23 16:26:21 2017 +0200
+++ b/Arduino-mbed-APIs/arduino-mbed.h Wed Aug 30 09:48:34 2017 +0200
@@ -227,6 +227,10 @@
void fall(Callback<void()> func);
+ void high(Callback<void()> func);
+
+ void low(Callback<void()> func);
+
void mode(PinMode pull) {
switch(pull) {
case PullUp: