lele

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
krishanprajapat
Date:
Fri Jul 31 12:52:23 2015 +0000
Parent:
0:984643af7d81
Commit message:
bro working fine and Sframe and EoS is also done , so put peace;

Changed in this revision

SD_read.h Show annotated file Show diff for this revision Revisions of this file
--- a/SD_read.h	Fri Jul 31 12:30:28 2015 +0000
+++ b/SD_read.h	Fri Jul 31 12:52:23 2015 +0000
@@ -17,9 +17,10 @@
 unsigned long long int Number_of_blocks_to_read ;
 unsigned long long int block_counter = 0;
 unsigned char buffer_512[512], buffer_112[112],counter_in_S_frame=0,counter_in_SCH=0;
-unsigned char S_frame[48]={0x46,0x9D,0xFB,0xF0,0xD2,0xBA,0x89,0xE4,0x46,0x9D,0xFB,0xF0,0xD2,0xBA,0x89,0xE4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+//unsigned char S_frame[48]={0x46,0x9D,0xFB,0xF0,0xD2,0xBA,0x89,0xE4,0x46,0x9D,0xFB,0xF0,0xD2,0xBA,0x89,0xE4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
 //unsigned char SCH[40] = {0x0A,0x3F,0x46,0xB4,0x00};
-unsigned char EoS[120];
+//unsigned char EoS[120];
+unsigned char * S_frame , *EoS;
 unsigned char make_EOS_flag =true;
 
 void differential_encode(unsigned char* ptr, int length){
@@ -35,70 +36,12 @@
         
     } 
 
-void make_EOS()
-{       
-
-for(int i = 0 ; i < 24 ; ++i){
-                    EoS[i] = 0x00;
-            }
-    
-            //~ S-FRAME [1]
-            //~ first two bits of S-FRAME
-            EoS[23] = 0x01;
-            
-            EoS[24] = 0x1a;
-            EoS[25] = 0x77;
-            EoS[26] = 0xef;
-            EoS[27] = 0xc3;
-            EoS[28] = 0x4a;
-            EoS[29] = 0xea;
-            EoS[30] = 0x27;
-            EoS[31] = 0x91;
-            EoS[32] = 0x1a;
-            EoS[33] = 0x77;
-            EoS[34] = 0xef;
-            EoS[35] = 0xc3;
-            EoS[36] = 0x4a;
-            EoS[37] = 0xea;
-            EoS[38] = 0x27;
-            EoS[39] = 0x90;
-    
-            for(int i = 40 ; i < 72 ; ++i){
-                EoS[i] = 0x00;
-            }
-            
-            //~ S-FRAME [2]
-            //~ first two bits of S-FRAME
-            EoS[71] = 0x01;
-            
-            EoS[72] = 0x1a;
-            EoS[73] = 0x77;
-            EoS[74] = 0xef;
-            EoS[75] = 0xc3;
-            EoS[76] = 0x4a;
-            EoS[77] = 0xea;
-            EoS[78] = 0x27;
-            EoS[79] = 0x91;
-            EoS[80] = 0x1a;
-            EoS[81] = 0x77;
-            EoS[82] = 0xef;
-            EoS[83] = 0xc3;
-            EoS[84] = 0x4a;
-            EoS[85] = 0xea;
-            EoS[86] = 0x27;
-            EoS[87] = 0x90;
-            
-            for(int i = 88 ; i < 120 ; ++i){
-                EoS[i] = 0x00;
-            }
-    
-}
-
 void send_tm_from_SD_card(){
     
     
     if(make_EOS_flag == true){
-        make_EOS();
+        EoS = snd_tm.EoS;
+        S_frame = snd_tm.S_frame;
         make_EOS_flag = false;
         Number_of_blocks_to_read = end_block_num - start_block_num +1;
     }