![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
slave integrated
Fork of BAE_FRDMTESIN2 by
fault.cpp
- Committer:
- sakthipriya
- Date:
- 2014-12-03
- Revision:
- 4:8f6c24eca109
- Parent:
- 3:02b45de29c0f
- Child:
- 5:255b43e8e21a
File content as of revision 4:8f6c24eca109:
#include "fault.h" #include "HK.h" 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); BusOut clear(FAULT_CLEAR1,FAULT_CLEAR2,FAULT_CLEAR3,FAULT_CLEAR4,FAULT_CLEAR5,FAULT_CLEAR6,FAULT_CLEAR7,FAULT_CLEAR8); BusOut MODE(ACS,TX,PAYLOAD); extern SensorData Sensor; //char flag; extern beacon_sc; void FAULTS() { printf("Entered Fault management \n"); clear1 = !fault1; clear2 = !fault2; clear3 = !fault3; clear4 = !fault4; clear5 = !fault5; clear6 = !fault6; clear7 = !fault7; clear8 = !fault8; Sensor.fault = clear; printf(" %d \n",Sensor.fault); } void POWER(char flag) { printf("Entered Power Management \n"); printf("Entering mode %c \n", flag); switch (flag) { case '1': ACTIVE = 7; break; case '2': ACTIVE = 6; break; case '3': ACTIVE = 5; break; case '4': ACTIVE = 4; break; case '5': ACTIVE = 2; break; case '6': ACTIVE = 0; break; case '7': ACTIVE = 0; break; } if (flag == 7) beacon_sc = 30; else beacon_sc = 3; }