![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
check commmit messgae
Fork of master_working_1_2 by
Revision 3:7a895e0fdd45, committed 2014-12-19
- Comitter:
- greenroshks
- Date:
- Fri Dec 19 18:00:32 2014 +0000
- Parent:
- 2:e80af3c366aa
- Commit message:
- in this writing to slave loop will be exitted if interrupt is 0 and reading from slave will be exitted if data_ready is 0
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Dec 15 05:51:25 2014 +0000 +++ b/main.cpp Fri Dec 19 18:00:32 2014 +0000 @@ -54,7 +54,7 @@ }*/ - + //wait(0.5); while(ack0) { //printf("2 master clk freq setup and addressing slave\n\r"); @@ -62,7 +62,7 @@ master.start(); //initiating the data transfer ack0 = master.read(addr,data,length); } - if(!ack0) + if(!ack0 && data_ready ==1) { printf("\n master has read %c from slave\n\r",*data); loopvariable0=false; @@ -117,7 +117,7 @@ i2c_data *i2c_data_s = (i2c_data*)evt.value.p; *writedata = i2c_data_s -> data; master.frequency(100000); //set clock frequency - while(write2slave) + while(write2slave && interrupt ==1) { printf("master clk freq setup and addressing slave\n\r"); master.start(); //initiating the data transfer