Thundersoft
/
ReedSwitch_for_TT_Mxx
Creating a project for TT_Mxx
DoorStatus/DoorStatus.cpp@1:c55bc0872920, 2019-04-26 (annotated)
- Committer:
- ThunderSoft
- Date:
- Fri Apr 26 09:44:03 2019 +0000
- Revision:
- 1:c55bc0872920
- Parent:
- 0:a0f5041497e4
"update the mbed-os code to support TT_M4G9"
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ThunderSoft | 0:a0f5041497e4 | 1 | #include "DoorStatus.h" |
ThunderSoft | 0:a0f5041497e4 | 2 | |
ThunderSoft | 0:a0f5041497e4 | 3 | |
ThunderSoft | 0:a0f5041497e4 | 4 | |
ThunderSoft | 0:a0f5041497e4 | 5 | |
ThunderSoft | 0:a0f5041497e4 | 6 | #if defined(__TT_M4G9__) |
ThunderSoft | 0:a0f5041497e4 | 7 | #define DEFAULT_DOR_PIN PL0 |
ThunderSoft | 0:a0f5041497e4 | 8 | #endif |
ThunderSoft | 0:a0f5041497e4 | 9 | |
ThunderSoft | 0:a0f5041497e4 | 10 | |
ThunderSoft | 0:a0f5041497e4 | 11 | #if defined(__TT_M3HQ__) |
ThunderSoft | 0:a0f5041497e4 | 12 | #define DEFAULT_DOR_PIN PK7 |
ThunderSoft | 0:a0f5041497e4 | 13 | #endif |
ThunderSoft | 0:a0f5041497e4 | 14 | |
ThunderSoft | 0:a0f5041497e4 | 15 | |
ThunderSoft | 0:a0f5041497e4 | 16 | DoorStatus::DoorStatus() |
ThunderSoft | 0:a0f5041497e4 | 17 | { |
ThunderSoft | 0:a0f5041497e4 | 18 | interruptPin = new InterruptIn(DEFAULT_DOR_PIN); |
ThunderSoft | 0:a0f5041497e4 | 19 | } |
ThunderSoft | 0:a0f5041497e4 | 20 | |
ThunderSoft | 0:a0f5041497e4 | 21 | DoorStatus::DoorStatus(PinName pin) |
ThunderSoft | 0:a0f5041497e4 | 22 | { |
ThunderSoft | 0:a0f5041497e4 | 23 | interruptPin = new InterruptIn(pin); |
ThunderSoft | 0:a0f5041497e4 | 24 | } |
ThunderSoft | 0:a0f5041497e4 | 25 | |
ThunderSoft | 0:a0f5041497e4 | 26 | void DoorStatus::handleCallback(Callback<void()> func) |
ThunderSoft | 0:a0f5041497e4 | 27 | { |
ThunderSoft | 0:a0f5041497e4 | 28 | interruptPin->fall(func); |
ThunderSoft | 0:a0f5041497e4 | 29 | } |