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:
- 7:5f6e31faa08e
- Parent:
- 6:6a04210a3f4f
- Child:
- 12:e0adb697fcdb
--- a/PollSwitch/PollSwitch.h Fri Oct 10 20:24:22 2014 +0000
+++ b/PollSwitch/PollSwitch.h Fri Oct 10 20:59:36 2014 +0000
@@ -1,42 +1,16 @@
+#ifndef _FILE_POLLSWITCH_H
+#define _FILE_POLLSWITCH_H
+
#include "LPCDigitalOut.h"
#include "LPCDigitalIn.h"
+#include "CANBuffer.h"
+#include "rtos.h"
-
+const int TX_POLL_ID = ((4 << 8) | 6);
-uint16_t PollSwitch()
-{
- uint16_t a=0;
- int switchn=0, i=0;
- LPC_pin PollPin[12]={p1_0, p1_1, p1_4, p1_8, p1_9, p1_10, p1_14, p1_15, p1_16, p1_17, p1_27, p1_28};
- LPCDigitalOut poll[12]={ LPCDigitalOut(PollPin[0]),
- LPCDigitalOut(PollPin[1]),
- LPCDigitalOut(PollPin[2]),
- LPCDigitalOut(PollPin[3]),
- LPCDigitalOut(PollPin[4]),
- LPCDigitalOut(PollPin[5]),
- LPCDigitalOut(PollPin[6]),
- LPCDigitalOut(PollPin[7]),
- LPCDigitalOut(PollPin[8]),
- LPCDigitalOut(PollPin[9]),
- LPCDigitalOut(PollPin[10]),
- LPCDigitalOut(PollPin[11])};
-
- // poll each switch 1 at a time
- // first failed switch is returned
-
- for(i=0; i<11; i++){
- ++switchn;
-
- poll[i].write(1);
-
- wait_ms(25);
-
- //poll[i+1].mode(PullDown);
- a|=((1 - poll[i+1].read()) << switchn);
-
- //poll[i].mode(PullNone);
- //poll[i+1].mode(PullNone);
- }
- // poll[i].mode(neither);
- return a;
-}
\ No newline at end of file
+class PollSwitch{
+ public:
+ PollSwitch(CANBuffer *can);
+ void start_update();
+};
+#endif
\ No newline at end of file
