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.
Diff: Arduino-mbed-APIs/arduino-mbed.cpp
- Revision:
- 88:d120930aeb13
- Parent:
- 84:3428e25c7157
- Child:
- 90:d98572047c9c
--- 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)
{