test
Dependents: Telemetria_RX_SD_GPS_copy Telemetria_RX_SD_GPS Telemetria_TX Telemetria_TX ... more
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) {