![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fault final (may be)
Fork of fault_man by
Diff: main.cpp
- Revision:
- 1:cde488f73488
- Parent:
- 0:e5e97851bbd6
- Child:
- 2:12445d744dfd
--- a/main.cpp Tue Dec 02 05:49:38 2014 +0000 +++ b/main.cpp Tue Dec 02 07:25:23 2014 +0000 @@ -11,15 +11,15 @@ #define FAULT8 D7 #define FAULT_CLEAR1 D8 -#define FAULT_CLEAR1 D9 -#define FAULT_CLEAR1 D10 -#define FAULT_CLEAR1 D11 -#define FAULT_CLEAR1 D12 -#define FAULT_CLEAR1 D13 -#define FAULT_CLEAR1 PTC10 -#define FAULT_CLEAR1 PTC11 +#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); @@ -40,27 +40,54 @@ 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) { - if(!fault1) - { clear1 = 1; } - if(!fault2) - { clear2 = 1; } - if(!fault3) - { clear3 = 1; } - if(!fault4) - { clear4 = 1; } - if(!fault5) - { clear5 = 1; } - if(!fault6) - { clear6 = 1; } - if(!fault7) - { clear7 = 1; } - if(!fault8) - { clear8 = 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); + + } + } \ No newline at end of file