Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
Diff: PollSwitch/PollSwitch.cpp
- Revision:
- 30:91af74a299e1
- Parent:
- 24:f58a3c0071c3
- Child:
- 31:7eaa5e881b56
--- a/PollSwitch/PollSwitch.cpp Fri Nov 07 21:26:46 2014 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#include "PollSwitch.h"
-
-LPCDigitalIn sw[]={ LPCDigitalIn(p1_0, PullDown),
- LPCDigitalIn(p1_1, PullDown),
- LPCDigitalIn(p1_4, PullDown),
- LPCDigitalIn(p1_8, PullDown),
- LPCDigitalIn(p1_9, PullDown),
- LPCDigitalIn(p1_10, PullDown),
- LPCDigitalIn(p1_14, PullDown),
- LPCDigitalIn(p1_15, PullDown),
- LPCDigitalIn(p1_16, PullDown),
- LPCDigitalIn(p1_17, PullDown),
- LPCDigitalIn(p1_27, PullDown),
- LPCDigitalIn(p1_28, PullDown)
- };
-
-PollSwitch::PollSwitch(){
- switchState = 0;
-}
-
-uint16_t PollSwitch::poll(){
- int i = 0;
-
- // if a low signal is detected, previous switch is broken
- for(i = 1; i < sizeof(sw)/sizeof(sw[0]); i++){
- if(!sw[i].read())
- break;
- }
-
- // bit on: switch may be broken
- switchState = (1 << i);
- return (1 << i);
-}
\ No newline at end of file
