![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
i2c slave integrated
Fork of BAE_FRDM_INTEGRATION by
Diff: fault.cpp
- Revision:
- 5:255b43e8e21a
- Parent:
- 4:8f6c24eca109
- Child:
- 6:e65b1ab79f36
--- a/fault.cpp Wed Dec 03 11:23:37 2014 +0000 +++ b/fault.cpp Thu Dec 04 07:17:44 2014 +0000 @@ -21,12 +21,13 @@ DigitalOut clear7(FAULT_CLEAR7); DigitalOut clear8(FAULT_CLEAR8); +DigitalOut acs_active(ACS); -BusOut clear(FAULT_CLEAR1,FAULT_CLEAR2,FAULT_CLEAR3,FAULT_CLEAR4,FAULT_CLEAR5,FAULT_CLEAR6,FAULT_CLEAR7,FAULT_CLEAR8); -BusOut MODE(ACS,TX,PAYLOAD); +BusOut clear(FAULT_CLEAR1,FAULT_CLEAR2,FAULT_CLEAR3,FAULT_CLEAR4,FAULT_CLEAR5,FAULT_CLEAR6,FAULT_CLEAR7,FAULT_CLEAR8);//to send fault data along with hk + extern SensorData Sensor; -//char flag; -extern beacon_sc; +extern int beacon_sc; //to switch beacon between low and high power mode +extern int acs_pflag; //to activate/deactivate control algo void FAULTS() @@ -46,29 +47,35 @@ } -void POWER(char flag) +void POWER(char flag) //flag corresponds to the power mode { printf("Entered Power Management \n"); printf("Entering mode %c \n", flag); switch (flag) { - case '1': ACTIVE = 7; - break; - case '2': ACTIVE = 6; + case '0': beacon_sc = 6; //least power mode + acs_pflag = 0; + acs_active = 0; //switching off a component of acs break; - case '3': ACTIVE = 5; - break; - case '4': ACTIVE = 4; + case '1': beacon_sc = 3; + acs_pflag = 0; + acs_active = 0; break; - case '5': ACTIVE = 2; - break; - case '6': ACTIVE = 0; + case '2': beacon_sc = 3; + acs_pflag = 0; + acs_active = 0; break; - case '7': ACTIVE = 0; - break; + case '3': beacon_sc = 3; //normal mode + acs_pflag = 1; + acs_active = 1; + break; } - if (flag == 7) + /* if (flag == '0') beacon_sc = 30; else beacon_sc = 3; + if (flag == '3') + acs_pflag = 1; + else + acs_pflag = 0; */ } \ No newline at end of file