Seeker of Truth , / Mbed 2 deprecated master_sample

Dependencies:   mbed-rtos mbed

Fork of master_sample by sakthi priya amirtharaj

Files at this revision

API Documentation at this revision

Comitter:
raizel_varun
Date:
Mon Dec 08 03:58:18 2014 +0000
Parent:
2:385ef26be324
Commit message:
master1;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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