![](/media/cache/group/nine_tails_kurama_by_zubair43-d4zyf5s.jpg.50x50_q85.jpg)
ACS completed fully. All cases to be tested
Dependencies: FreescaleIAP mbed-rtos mbed
Fork of ACS_Flowchart_BAE by
Diff: ACS.cpp
- Revision:
- 9:194afacf7449
- Parent:
- 8:82250e41da81
- Child:
- 10:f93407b97750
--- a/ACS.cpp Sat Mar 12 12:54:14 2016 +0000 +++ b/ACS.cpp Fri Apr 01 21:13:16 2016 +0000 @@ -11,15 +11,15 @@ //********************************flags******************************************// extern uint32_t BAE_STATUS; extern uint32_t BAE_ENABLE; -extern char ACS_INIT_STATUS; -extern char ACS_DATA_ACQ_STATUS; -extern char ACS_ATS_STATUS; -extern char ACS_MAIN_STATUS; -extern char ACS_STATUS; +extern uint8_t ACS_INIT_STATUS; +extern uint8_t ACS_DATA_ACQ_STATUS; +extern uint8_t ACS_ATS_STATUS; +extern uint8_t ACS_MAIN_STATUS; +extern uint8_t ACS_STATUS; -extern char ACS_ATS_ENABLE; -extern char ACS_DATA_ACQ_ENABLE; -extern char ACS_STATE; +extern uint8_t ACS_ATS_ENABLE; +extern uint8_t ACS_DATA_ACQ_ENABLE; +extern uint8_t ACS_STATE; DigitalOut phase_TR_x(PIN27); // PHASE pin for x-torquerod DigitalOut phase_TR_y(PIN28); // PHASE pin for y-torquerod @@ -37,8 +37,8 @@ extern BAE_HK_actual actual_data; -//DigitalOut gpo1(PTC0); // enable of att sens2 switch -//DigitalOut gpo2(PTC16); // enable of att sens switch +//DigitalOut ATS1_SW_ENABLE(PTC0); // enable of att sens2 switch +//DigitalOut ATS2_SW_ENABLE(PTC16); // enable of att sens switch Serial pc_acs(USBTX,USBRX); //for usb communication @@ -199,7 +199,7 @@ void FCTN_ACS_INIT() { - ACS_INIT_STATUS = 's'; //set ACS_INIT_STATUS flag + ACS_INIT_STATUS = 1; //set ACS_INIT_STATUS flag //FLAG(); pc_acs.printf("Attitude sensor init called \n \r"); //FLAG(); @@ -247,13 +247,13 @@ cmd[1]=BIT_EVT_ENB; i2c.write(SLAVE_ADDR,cmd,2); wait_ms(100); - ACS_INIT_STATUS = 'c'; //set ACS_INIT_STATUS flag + ACS_INIT_STATUS = 0; //set ACS_INIT_STATUS flag } void FCTN_ATS_DATA_ACQ() { - ACS_DATA_ACQ_STATUS = 's'; //set ACS_DATA_ACQ_STATUS flag for att sens 2 - if( ACS_ATS_ENABLE == 'e') + ACS_DATA_ACQ_STATUS = 1; //set ACS_DATA_ACQ_STATUS flag for att sens 2 + if( ACS_ATS_ENABLE == 1) { FLAG(); pc_acs.printf("attitude sensor execution called \n \r"); @@ -307,9 +307,9 @@ } else //ACS_DATA_ACQ_STATUS = ACS_DATA_ACQ_FAILURE { - ACS_DATA_ACQ_STATUS = 'f'; + ACS_DATA_ACQ_STATUS = 1; } - ACS_DATA_ACQ_STATUS = 'c'; //clear ACS_DATA_ACQ_STATUS flag for att sens 2 + ACS_DATA_ACQ_STATUS = 0; //clear ACS_DATA_ACQ_STATUS flag for att sens 2 } void FCTN_ACS_GENPWM_MAIN(float Moment[3])