generation_mbed2

Dependencies:   202hm2_slave mbed

Fork of 202hm2_slave by Yujing Qian

Files at this revision

API Documentation at this revision

Comitter:
allonq
Date:
Sun Mar 16 08:13:39 2014 +0000
Parent:
3:7544d38698a3
Commit message:
//EE 202 hm2; //This is a program built for the mbed3 in monitoring mode; //This code has been tested and should be function, if you has any problem,; //please mail me.;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 7544d38698a3 -r 54fbe45eef1c main.cpp
--- a/main.cpp	Sun Mar 16 07:18:16 2014 +0000
+++ b/main.cpp	Sun Mar 16 08:13:39 2014 +0000
@@ -1,4 +1,9 @@
-//this is a program built for the slave mbed(bed1)
+//EE 202 hm2
+//This is a program built for the mbed2(slave) in generation mode
+//This code has been tested and should be function, if you has any problem,
+//please mail me.
+//Author: Yujing Qian
+//y.qian42@gmail.com
 #include "mbed.h"
 #include "MKL46Z4.h"
 
@@ -49,22 +54,11 @@
             buffer[3]=uart.getc();//pc.printf("3=%d\n",buffer[0]);
             uart.putc(0);
             per=((int)buffer[3]<<24)+((int)buffer[2]<<16)+((int)buffer[1]<<8)+((int)buffer[0]);
-            /*pc.printf("0=%d\n",buffer[0]);
-            pc.printf("1=%d\n",buffer[1]);
-            pc.printf("2=%d\n",buffer[2]);
-            pc.printf("3=%d\n",buffer[3]);*/
-
-            
 
             Syc();
-            //pc.printf("per=%d\n",per);
-            //pc.printf("Syc_over\n");
+
             loop_num=0;
             Period=per;
-            //NVIC_EnableIRQ(TPM0_IRQn);
-            //pc.printf("T2=%d\n",T2);    
-            //pc.printf("T3=%d\n",T3);
-            //flag=true;
 
     }
     
@@ -74,22 +68,8 @@
 
             if(loop_num==Period){
                 out=!out;LED=!LED;per_num++;loop_num=0;
-        //if((TPM0->SC & 0x0080)==0x0080){
-            
-            //pc.printf("per=%d",Period);
-            
-            //pc.printf("syc_cnt=%d",syc_cnt);
-            //pc.printf("flag=%d\n",flag);
-            //pc.printf("Global_time=%f\n",(float)(TIME()%48000));
-            //pc.printf(": %d\n",TPM0->CNT);
             }
-            //else if(flag&&(syc_cnt>=syc_interval)){
-                //Syc();syc_cnt=0;pc.printf("!!!!!syced\n");  
-              //  }
             TPM0->SC|= 0x000000c8;
-            //NVIC_ClearPendingIRQ(TPM0_IRQn); 
-            //pc.printf("SC_after=%d\n",TPM0->SC);
-            //}//pc.printf("count=%d",TPM0->CNT);
             
             return;               
     }