![](/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:
- 1:deb3c0fafa3a
- Parent:
- 0:ebdf4f859dca
- Child:
- 2:edd107ea4740
diff -r ebdf4f859dca -r deb3c0fafa3a main.cpp --- a/main.cpp Fri Dec 19 06:47:25 2014 +0000 +++ b/main.cpp Sat Dec 20 05:56:04 2014 +0000 @@ -250,7 +250,7 @@ { int slave_status = 1; - while(slave_status) + while(slave_status && interrupt == 1) { slave.address(0x20); if(slave.receive()==1) @@ -280,7 +280,7 @@ //i2c_status = temp; //wait(0.5); printf("\n entered thread %d\n\r",i2c_status); - if(i2c_status == 0 && reset !=1) + if(i2c_status == 0 ) { FUNC_I2C_WRITE2CDMS(&data_receive,1); @@ -293,7 +293,7 @@ FUNC_I2C_TC_EXECUTE(data_receive); // This has to be done from a differen thread } - else if(i2c_status ==1 && reset !=1) + else if(i2c_status ==1) { osEvent evt = i2c_data_send.get(); if (evt.status == osEventMail) @@ -322,10 +322,7 @@ } -void FUNC_I2C_RESET() -{ - reset = 1; -} + @@ -457,7 +454,7 @@ - master_reset.fall(&FUNC_I2C_RESET); + //master_reset.fall(&FUNC_I2C_RESET); interrupt.rise(&FUNC_I2C_INT); while(1)