Creating a project for TT_Mxx

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DoorStatus.cpp Source File

DoorStatus.cpp

00001 #include "DoorStatus.h"
00002 
00003 
00004 
00005 
00006 #if defined(__TT_M4G9__)
00007 #define DEFAULT_DOR_PIN PL0
00008 #endif
00009 
00010 
00011 #if defined(__TT_M3HQ__)
00012 #define DEFAULT_DOR_PIN PK7
00013 #endif
00014 
00015 
00016 DoorStatus::DoorStatus()
00017 {
00018      interruptPin = new InterruptIn(DEFAULT_DOR_PIN);
00019 }
00020 
00021 DoorStatus::DoorStatus(PinName pin)
00022 {
00023     interruptPin = new InterruptIn(pin);
00024 }
00025 
00026 void DoorStatus::handleCallback(Callback<void()> func)
00027 {
00028     interruptPin->fall(func);
00029 }