Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of master_sample by
Diff: main.cpp
- Revision:
- 3:583585376a2d
- Parent:
- 2:385ef26be324
--- a/main.cpp Sun Dec 07 09:11:25 2014 +0000
+++ b/main.cpp Mon Dec 08 03:58:18 2014 +0000
@@ -17,7 +17,7 @@
char *data_rec = new char;
*data_rec = 'b';
bool master_status_write = true;
- master.start();
+ //master.start();
master_status_write = (bool) master.write(addr|0x00,data_send,1);
bool write_loop;
//m2s_interrupt=0;
@@ -33,25 +33,25 @@
// wait(10);
master_status_write = true;
//bool master_status_read = true;
-
+ // bool read_loop = true;
-
- // bool read_loop = true;
- while(write_loop ){
- printf("2 master clk freq setup and addressing slave\n\r");
- master.frequency(100000); //set clock frequency
+
+ master.frequency(100000); //set clock frequency
+ while(write_loop ){
+ printf("2 master clk freq setup and addressing slave\n\r");
master.start(); //initiating the data transfer
master_status_write = (bool) master.write(addr|0x00,data_send,1);
if(master_status_write==0){
printf("3 master has written %c to slave\n\r",*data_send);
write_loop=false;
}
- }
+
printf("done\n\r");
+ }
}
}
-
+
\ No newline at end of file
