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.
Dependencies: FreescaleIAP SimpleDMA eeprom mbed-rtos mbed
Fork of CDMS_QM_03MAR2017_Flash_with_obsrs by
Diff: Compression.h
- Revision:
- 203:424308159a56
- Parent:
- 199:9f03d6ca94c9
- Child:
- 204:72f52e74e0e4
- Child:
- 214:6848a51af734
- Child:
- 261:1e54415b34d3
--- a/Compression.h Fri Jul 01 08:56:27 2016 +0000
+++ b/Compression.h Fri Jul 01 17:41:48 2016 +0000
@@ -56,7 +56,8 @@
uint8_t position_tm_frame[3] = {8,11,5} , position_tm_starting[3] = {8,11,5}; //{sc,sf-bt,sf-at}
uint8_t id; //sf = 0,sc-at = 1,sc-bt = 2;
uint8_t TM_interleave_data[512] , TM_convoluted_data[270] = {0};
-int proton_scp_sum,electron_scp_sum,length, temp_crc,attitude = 0,FSC_science = 1,debug_cntr = 0, size,space;
+int proton_scp_sum,electron_scp_sum,length, temp_crc,attitude = 0,debug_cntr = 0, size,space;
+uint32_t FSC_science;
uint8_t *ptr ,* pointer;
long long int sci_time = 0x221000000; //call some function and get the time or get in the starting, what ever akshay says
int test_cntr = 0;
@@ -77,17 +78,8 @@
//Call FCTN_SD_MNGR for latest fsc
FCTN_SD_MNGR();
- uint32_t FSC[6];
uint8_t sd_stat;
- for(int i =1; i<6;i++)
- {
- FSC[i] = FSC_CURRENT[i];
- }
-
-
-
-
for (int i = 0; i < 52 ; i++){
scp_bin[i] = 0;
}
@@ -299,8 +291,8 @@
if(id == 1){ //below thereshold
space = adjust(1,0,pointer,8);
space = adjust(4,3,pointer,space);
- FSC[3]++;
- gPC.printf("SID = 3, FSC = %02X\r\n", FSC[3]);
+ FSC_science = FSC_CURRENT[3]+1;
+ gPC.printf("SID = 3, FSC = %02X\r\n", FSC_CURRENT[3]+1);
frames[id][1] = (FSC_science>>24)&0xff;
frames[id][2] = (FSC_science>>16)&0xff;
frames[id][3] = (FSC_science>>8)&0xff;
@@ -313,9 +305,8 @@
}else if(id == 2){
space = adjust(1,0,pointer,8);
space = adjust(4,2,pointer,space);
- //FSC_science = FCTN_SD_MNGR(2);
- FSC[2]++;
- gPC.printf("SID = 2, FSC = %02X\r\n", FSC[2]);
+ FSC_science = FSC_CURRENT[2]+1;
+ gPC.printf("SID = 2, FSC = %02X\r\n", FSC_science);
frames[id][1] = (FSC_science>>16)&0xff;
frames[id][2] = (FSC_science>>8)&0xff;
frames[id][3] = FSC_science&0xff;
@@ -338,10 +329,10 @@
interleave(TM_convoluted_data+ 135,TM_interleave_data + 144);
if(id == 1){
- sd_stat = SD_WRITE(TM_interleave_data,FSC[3],3);
+ sd_stat = SD_WRITE(TM_interleave_data,FSC_CURRENT[3]+1,3);
}
else if (id == 2){
- sd_stat = SD_WRITE(TM_interleave_data,FSC[2],2);
+ sd_stat = SD_WRITE(TM_interleave_data,FSC_CURRENT[2]+1,2);
}
if(sd_stat)
{
@@ -602,8 +593,8 @@
pointer = frames[id];
space = adjust(1,0,pointer,8);
space = adjust(4,1,pointer,space);
- FSC[1]++;
- gPC.printf("SID = 1, FSC = %02X\r\n", FSC[1]);
+ FSC_science = FSC_CURRENT[1]+1;
+ gPC.printf("SID = 1, FSC = %02X\r\n", FSC_science);
frames[id][1] = (FSC_science>>16)&0xff;
frames[id][2] = (FSC_science>>8)&0xff;
frames[id][3] = (FSC_science)&0xff;
@@ -622,7 +613,7 @@
convolution(frames[id]);
interleave(TM_convoluted_data,TM_interleave_data);
interleave(TM_convoluted_data+ 135,TM_interleave_data + 144);
- sd_stat = SD_WRITE(TM_interleave_data,FSC[1],1);
+ sd_stat = SD_WRITE(TM_interleave_data,FSC_CURRENT[1]+1,1);
if(sd_stat)
{
gPC.puts("sd write failure");
