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.h
- Revision:
- 6:6a04210a3f4f
- Parent:
- 0:e516fcccccda
- Child:
- 7:5f6e31faa08e
--- a/PollSwitch/PollSwitch.h Wed Oct 08 20:56:41 2014 +0000
+++ b/PollSwitch/PollSwitch.h Fri Oct 10 20:24:22 2014 +0000
@@ -1,7 +1,7 @@
-#include"LPCDigitalOut.h"
-#include"LPCDigitalIn.h"
+#include "LPCDigitalOut.h"
+#include "LPCDigitalIn.h"
-//Serial pc(USBTX,USBRX);
+
uint16_t PollSwitch()
{
@@ -21,13 +21,10 @@
LPCDigitalOut(PollPin[10]),
LPCDigitalOut(PollPin[11])};
- /*
- _(invariant each iteration input is mode neither)
- _(ensures all are inputs mode neither)
- _(at a time only one is ioutput)
- */
-
- for(i=0; i<11; i++){
+ // poll each switch 1 at a time
+ // first failed switch is returned
+
+ for(i=0; i<11; i++){
++switchn;
poll[i].write(1);
