![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fault final (may be)
Fork of fault_man by
main.cpp@0:e5e97851bbd6, 2014-12-02 (annotated)
- Committer:
- sakthipriya
- Date:
- Tue Dec 02 05:49:38 2014 +0000
- Revision:
- 0:e5e97851bbd6
- Child:
- 1:cde488f73488
rr
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sakthipriya | 0:e5e97851bbd6 | 1 | #include "mbed.h" |
sakthipriya | 0:e5e97851bbd6 | 2 | #include "rtos.h" |
sakthipriya | 0:e5e97851bbd6 | 3 | |
sakthipriya | 0:e5e97851bbd6 | 4 | #define FAULT1 D0 |
sakthipriya | 0:e5e97851bbd6 | 5 | #define FAULT2 D1 |
sakthipriya | 0:e5e97851bbd6 | 6 | #define FAULT3 D2 |
sakthipriya | 0:e5e97851bbd6 | 7 | #define FAULT4 D3 |
sakthipriya | 0:e5e97851bbd6 | 8 | #define FAULT5 D4 |
sakthipriya | 0:e5e97851bbd6 | 9 | #define FAULT6 D5 |
sakthipriya | 0:e5e97851bbd6 | 10 | #define FAULT7 D6 |
sakthipriya | 0:e5e97851bbd6 | 11 | #define FAULT8 D7 |
sakthipriya | 0:e5e97851bbd6 | 12 | |
sakthipriya | 0:e5e97851bbd6 | 13 | #define FAULT_CLEAR1 D8 |
sakthipriya | 0:e5e97851bbd6 | 14 | #define FAULT_CLEAR1 D9 |
sakthipriya | 0:e5e97851bbd6 | 15 | #define FAULT_CLEAR1 D10 |
sakthipriya | 0:e5e97851bbd6 | 16 | #define FAULT_CLEAR1 D11 |
sakthipriya | 0:e5e97851bbd6 | 17 | #define FAULT_CLEAR1 D12 |
sakthipriya | 0:e5e97851bbd6 | 18 | #define FAULT_CLEAR1 D13 |
sakthipriya | 0:e5e97851bbd6 | 19 | #define FAULT_CLEAR1 PTC10 |
sakthipriya | 0:e5e97851bbd6 | 20 | #define FAULT_CLEAR1 PTC11 |
sakthipriya | 0:e5e97851bbd6 | 21 | |
sakthipriya | 0:e5e97851bbd6 | 22 | |
sakthipriya | 0:e5e97851bbd6 | 23 | |
sakthipriya | 0:e5e97851bbd6 | 24 | DigitalIn fault1(FAULT1); |
sakthipriya | 0:e5e97851bbd6 | 25 | DigitalIn fault2(FAULT2); |
sakthipriya | 0:e5e97851bbd6 | 26 | DigitalIn fault3(FAULT3); |
sakthipriya | 0:e5e97851bbd6 | 27 | DigitalIn fault4(FAULT4); |
sakthipriya | 0:e5e97851bbd6 | 28 | DigitalIn fault5(FAULT5); |
sakthipriya | 0:e5e97851bbd6 | 29 | DigitalIn fault6(FAULT6); |
sakthipriya | 0:e5e97851bbd6 | 30 | DigitalIn fault7(FAULT7); |
sakthipriya | 0:e5e97851bbd6 | 31 | DigitalIn fault8(FAULT8); |
sakthipriya | 0:e5e97851bbd6 | 32 | |
sakthipriya | 0:e5e97851bbd6 | 33 | |
sakthipriya | 0:e5e97851bbd6 | 34 | DigitalOut clear1(FAULT_CLEAR1); |
sakthipriya | 0:e5e97851bbd6 | 35 | DigitalOut clear2(FAULT_CLEAR2); |
sakthipriya | 0:e5e97851bbd6 | 36 | DigitalOut clear3(FAULT_CLEAR3); |
sakthipriya | 0:e5e97851bbd6 | 37 | DigitalOut clear4(FAULT_CLEAR4); |
sakthipriya | 0:e5e97851bbd6 | 38 | DigitalOut clear5(FAULT_CLEAR5); |
sakthipriya | 0:e5e97851bbd6 | 39 | DigitalOut clear6(FAULT_CLEAR6); |
sakthipriya | 0:e5e97851bbd6 | 40 | DigitalOut clear7(FAULT_CLEAR7); |
sakthipriya | 0:e5e97851bbd6 | 41 | DigitalOut clear8(FAULT_CLEAR8); |
sakthipriya | 0:e5e97851bbd6 | 42 | |
sakthipriya | 0:e5e97851bbd6 | 43 | |
sakthipriya | 0:e5e97851bbd6 | 44 | void FAULTS(void const *args) |
sakthipriya | 0:e5e97851bbd6 | 45 | { |
sakthipriya | 0:e5e97851bbd6 | 46 | while(1) |
sakthipriya | 0:e5e97851bbd6 | 47 | { |
sakthipriya | 0:e5e97851bbd6 | 48 | if(!fault1) |
sakthipriya | 0:e5e97851bbd6 | 49 | { clear1 = 1; } |
sakthipriya | 0:e5e97851bbd6 | 50 | if(!fault2) |
sakthipriya | 0:e5e97851bbd6 | 51 | { clear2 = 1; } |
sakthipriya | 0:e5e97851bbd6 | 52 | if(!fault3) |
sakthipriya | 0:e5e97851bbd6 | 53 | { clear3 = 1; } |
sakthipriya | 0:e5e97851bbd6 | 54 | if(!fault4) |
sakthipriya | 0:e5e97851bbd6 | 55 | { clear4 = 1; } |
sakthipriya | 0:e5e97851bbd6 | 56 | if(!fault5) |
sakthipriya | 0:e5e97851bbd6 | 57 | { clear5 = 1; } |
sakthipriya | 0:e5e97851bbd6 | 58 | if(!fault6) |
sakthipriya | 0:e5e97851bbd6 | 59 | { clear6 = 1; } |
sakthipriya | 0:e5e97851bbd6 | 60 | if(!fault7) |
sakthipriya | 0:e5e97851bbd6 | 61 | { clear7 = 1; } |
sakthipriya | 0:e5e97851bbd6 | 62 | if(!fault8) |
sakthipriya | 0:e5e97851bbd6 | 63 | { clear8 = 1; } |
sakthipriya | 0:e5e97851bbd6 | 64 | |
sakthipriya | 0:e5e97851bbd6 | 65 | } |
sakthipriya | 0:e5e97851bbd6 | 66 | } |