![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fault final (may be)
Fork of fault_man by
main.cpp
- Committer:
- sakthipriya
- Date:
- 2014-12-02
- Revision:
- 1:cde488f73488
- Parent:
- 0:e5e97851bbd6
- Child:
- 2:12445d744dfd
File content as of revision 1:cde488f73488:
#include "mbed.h" #include "rtos.h" #define FAULT1 D0 #define FAULT2 D1 #define FAULT3 D2 #define FAULT4 D3 #define FAULT5 D4 #define FAULT6 D5 #define FAULT7 D6 #define FAULT8 D7 #define FAULT_CLEAR1 D8 #define FAULT_CLEAR2 D9 #define FAULT_CLEAR3 D10 #define FAULT_CLEAR4 D11 #define FAULT_CLEAR5 D12 #define FAULT_CLEAR6 D13 #define FAULT_CLEAR7 PTC10 #define FAULT_CLEAR8 PTC11 Serial pc(USBTX,USBRX); DigitalIn fault1(FAULT1); DigitalIn fault2(FAULT2); DigitalIn fault3(FAULT3); DigitalIn fault4(FAULT4); DigitalIn fault5(FAULT5); DigitalIn fault6(FAULT6); DigitalIn fault7(FAULT7); DigitalIn fault8(FAULT8); DigitalOut clear1(FAULT_CLEAR1); DigitalOut clear2(FAULT_CLEAR2); DigitalOut clear3(FAULT_CLEAR3); DigitalOut clear4(FAULT_CLEAR4); DigitalOut clear5(FAULT_CLEAR5); DigitalOut clear6(FAULT_CLEAR6); DigitalOut clear7(FAULT_CLEAR7); DigitalOut clear8(FAULT_CLEAR8); /*bool fault1 = 0; bool fault2 = 0; bool fault3 = 0; bool fault4 = 0; bool fault5 = 0; bool fault6 = 0; bool fault7 = 0; bool fault8 = 0; */ void FAULTS(void const *args) { while(1) { Thread :: signal_wait(0x1); printf("\nEntered fault thred\n"); //if(fault1 == 0) { clear1 = !fault1; } //if(fault2 == 0) { clear2 = !fault2; } //if(fault3 == 0) { clear3 = !fault3; } //if(fault4 == 0) { clear4 = !fault4; } //if(fault5 == 0) { clear5 = !fault5; } //if(fault6 == 0) { clear6 = !fault6; } //if(fault7 == 0) { clear7 = !fault7; } //if(fault8 == 0) { clear8 = !fault8; } } } //void faults_2_cdms(void const *args) //{ int main() { Thread f1(FAULTS, (void *) "faults"); while(1) { //Thread :: wait(5000); f1.signal_set(0x1); //printf(" %d %d %d %d %d %d %d %d \n",clear1,clear2,clear3,clear4,clear5,clear6,clear7,clear8); } }