![](/media/cache/group/Thundersoft-new.png.50x50_q85.png)
Creating a project for TT_Mxx
Diff: DoorStatus/DoorStatus.cpp
- Revision:
- 0:a0f5041497e4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DoorStatus/DoorStatus.cpp Thu Mar 21 10:08:02 2019 +0000 @@ -0,0 +1,29 @@ +#include "DoorStatus.h" + + + + +#if defined(__TT_M4G9__) +#define DEFAULT_DOR_PIN PL0 +#endif + + +#if defined(__TT_M3HQ__) +#define DEFAULT_DOR_PIN PK7 +#endif + + +DoorStatus::DoorStatus() +{ + interruptPin = new InterruptIn(DEFAULT_DOR_PIN); +} + +DoorStatus::DoorStatus(PinName pin) +{ + interruptPin = new InterruptIn(pin); +} + +void DoorStatus::handleCallback(Callback<void()> func) +{ + interruptPin->fall(func); +}