Steven Osborn / SX1276RonothLib

Dependents:   LoDev_RXTX

Files at this revision

API Documentation at this revision

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

Arduino-mbed-APIs/arduino-mbed.cpp Show annotated file Show diff for this revision Revisions of this file
Arduino-mbed-APIs/arduino-mbed.h Show annotated file Show diff for this revision Revisions of this file
--- 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: