![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
gotta check ctrl algo - it gives negative value
Fork of BAE_hw_test1_3 by
Diff: main.cpp
- Revision:
- 8:939b37cdcb92
- Parent:
- 7:603c2a89effc
- Child:
- 9:8b74ed33be76
--- a/main.cpp Fri Feb 27 19:06:04 2015 +0000 +++ b/main.cpp Sun Mar 01 05:30:12 2015 +0000 @@ -38,7 +38,7 @@ -I2CSlave slave(D14,D15); //configuring pins p27, p28 as I2Cslave +//I2CSlave slave(D14,D15); //configuring pins p27, p28 as I2Cslave DigitalOut data_ready(D10); @@ -235,7 +235,7 @@ -void FUNC_I2C_WRITE2CDMS(char *data, int length=1) +/*void FUNC_I2C_WRITE2CDMS(char *data, int length=1) { int slave_status = 1; //t2.stop(); @@ -270,8 +270,8 @@ printf("\n\r%d\r",t3.read_us()); t3.reset(); -} - +}*/ +/* char data_send[25],data_receive; void T_I2C_BAE(void const * args) { @@ -284,12 +284,12 @@ { wait_ms(20); FUNC_I2C_WRITE2CDMS(&data_receive,1); - + */ /*i2c_data * i2c_data_r = i2c_data_receive.alloc(); i2c_data_r->data = data_receive; i2c_data_r->length = 1; i2c_data_receive.put(i2c_data_r);*/ - printf("\n\r Data received from CDMS is %c \n\r",data_receive); + /* printf("\n\r Data received from CDMS is %c \n\r",data_receive); FUNC_I2C_TC_EXECUTE(data_receive); // This has to be done from a differen thread } @@ -314,8 +314,8 @@ } - -void FUNC_I2C_INT() +*/ +/*void FUNC_I2C_INT() { t2.start(); @@ -323,11 +323,11 @@ ptr_t_i2c->signal_set(0x4); -} +}*/ void FUNC_I2C_IR2CDMS() -{ - data_ready=0; +{ ; +/* data_ready=0; //char data[25]; //strcpy(data,"sakthi "); //strcat(data,"priya"); @@ -338,11 +338,11 @@ strcat(hk_data,SensorQuantised.AngularSpeed); strcat(hk_data,SensorQuantised.Bnewvalue); char fdata[5] = {SensorQuantised.BatteryTemperature,SensorQuantised.faultpoll,SensorQuantised.faultir,SensorQuantised.power_mode}; - +*/ /*strcat(hk_data,sfaultpoll); strcat(hk_data,sfaultir); strcat(hk_data,spower_mode);*/ - strcat(hk_data,fdata); + /* strcat(hk_data,fdata); printf("\n\rhk data : %s\n\r",hk_data); //data = pcslave.getc(); @@ -353,7 +353,7 @@ i2c_data_s->length = 25; i2c_data_send.put(i2c_data_s); data_ready=1; - //temp = i2c_status; + //temp = i2c_status; */ } @@ -421,7 +421,7 @@ FUNC_ACS_MAG_INIT(); FUNC_ACS_INIT_GYR(); - slave.address(0x20); + //slave.address(0x20); ptr_t_hk_acq = new Thread(T_HK_ACQ); ptr_t_acs = new Thread(T_ACS); @@ -429,7 +429,7 @@ ptr_t_bea = new Thread(T_BEA); //ptr_t_bea_telecommand = new Thread(T_BEA_TELECOMMAND); //ptr_t_fault = new Thread(T_FAULT); - ptr_t_i2c = new Thread(T_I2C_BAE); + // ptr_t_i2c = new Thread(T_I2C_BAE); //ptr_t_sc = new Thread(T_SC); ptr_t_wdt = new Thread(T_WDT); @@ -459,7 +459,7 @@ //master_reset.fall(&FUNC_I2C_RESET); - interrupt.rise(&FUNC_I2C_INT); + // interrupt.rise(&FUNC_I2C_INT); while(1) {