
Repository for CDMS code
Dependencies: SimpleDMA mbed-rtos mbed eeprom
Fork of COM_MNG_TMTC_SIMPLE by
Revision 193:f76b475d7807, committed 2016-06-29
- Comitter:
- ee12b079
- Date:
- Wed Jun 29 14:12:43 2016 +0000
- Parent:
- 192:f0d5fde60221
- Child:
- 194:ab528911780d
- Commit message:
- memset(0) added, checking sdcard in obsrs.h and main, commented mng_sd_card(), transmit_adf() uncommented for obsrs
Changed in this revision
--- a/COM_MNG_TMTC.h Tue Jun 28 09:51:56 2016 +0000 +++ b/COM_MNG_TMTC.h Wed Jun 29 14:12:43 2016 +0000 @@ -1232,7 +1232,7 @@ /*SEND call sign, ACK_L1, NON OBSRS TM TO GS*/\ snd_tm.head_pointer(tm_ptr_head);\ gPC.puts("enter_adf\r\n");\ - /*transmit_adf;*/\ + transmit_adf;\ gPC.puts("exit_adf\r\n");\ /*DELETE THE TM AFTER USE*/\ tm_ptr = tm_ptr_head;\ @@ -1260,7 +1260,7 @@ /*read_TC(current_TC);*/\ execute_OBSRS_TC(current_TC);\ gPC.puts("enter_adf\r\n");\ - /*transmit_adf;*/\ + transmit_adf;\ gPC.puts("exit_adf\r\n");\ uint8_t tempExec = TC_STATE_SUCCESSFULLY_EXECUTED;\ PUTexec_status(current_TC, tempExec);\
--- a/Compression.h Tue Jun 28 09:51:56 2016 +0000 +++ b/Compression.h Wed Jun 29 14:12:43 2016 +0000 @@ -284,7 +284,7 @@ if(id == 1){ //below thereshold space = adjust(1,0,pointer,8); space = adjust(4,3,pointer,space); - FSC_science = FCTN_SD_MNGR(3); + //FSC_science = FCTN_SD_MNGR(3); gPC.printf("SID = 3, FSC = %02X\r\n", FSC_science); frames[id][1] = (FSC_science>>24)&0xff; frames[id][2] = (FSC_science>>16)&0xff; @@ -298,7 +298,7 @@ }else if(id == 2){ space = adjust(1,0,pointer,8); space = adjust(4,2,pointer,space); - FSC_science = FCTN_SD_MNGR(2); + //FSC_science = FCTN_SD_MNGR(2); gPC.printf("SID = 2, FSC = %02X\r\n", FSC_science); frames[id][1] = (FSC_science>>16)&0xff; @@ -308,13 +308,13 @@ temp_crc = crc16_gen(frames[id],132); frames[id][132] = temp_crc>>8; frames[id][133] = temp_crc & 0xff; - if(test_cntr++ == 0){ - gPC.puts("frame start\r\n"); - for(int i = 0; i<134; i++){ - gPC.printf("%02X",frames[id][i]); - } - gPC.puts("frame ends\r\n"); - } + //if(test_cntr++ == 0){ + //gPC.puts("frame start\r\n"); +// for(int i = 0; i<134; i++){ +// gPC.printf("%02X",frames[id][i]); +// } +// gPC.puts("frame ends\r\n"); + //} exor(frames[id]);
--- a/OBSRS.h Tue Jun 28 09:51:56 2016 +0000 +++ b/OBSRS.h Wed Jun 29 14:12:43 2016 +0000 @@ -578,11 +578,15 @@ // for(int i=0;i<512;i++){ // printf("0x%02X,",write_buffer[i]); // } - int write_success = SD_WRITE(write_buffer,FSC + block_counter,SID); + int write_success = SD_WRITE(write_buffer,FSC + block_counter,SID); // wait_ms(8); read_success = SD_READ(buffer_512, FSC + block_counter,SID); -/* gPC.printf("read block %d \n\r",read_success);*/ - } + for(int i = 0; i<512;i++) + if(write_buffer[i] != buffer_512[i]) + gPC.printf("incorrect"); + + gPC.printf("read block %d \n\r",read_success); + } else{ read_success = SD_READ(buffer_512, list_of_FSC[block_counter],SID); }
--- a/cdms_sd.h Tue Jun 28 09:51:56 2016 +0000 +++ b/cdms_sd.h Wed Jun 29 14:12:43 2016 +0000 @@ -531,9 +531,9 @@ } // send the data block - write(buffer, 512); + return write(buffer, 512); //printf("Written Successfully bro \n"); - return 0; + } int write(const uint8_t*buffer, uint32_t length)
--- a/main.cpp Tue Jun 28 09:51:56 2016 +0000 +++ b/main.cpp Wed Jun 29 14:12:43 2016 +0000 @@ -119,9 +119,17 @@ master.frequency(400000); PL_wo_dma = new RtosTimer(payload_isr_fun_dma, osTimerPeriodic,(void * )NULL); - PL_wo_dma->start(6000);// + //PL_wo_dma->start(6000);// + + uint8_t buffer1[512],buffer2[512]; + for(int i = 0;i<512;i++) + buffer1[i] = 3; - + int r = SD_WRITE(buffer1,0,2); +// wait_ms(8); + int q = SD_READ(buffer2, 0,2); + for(int i = 0; i<512;i++) + gPC.printf(" 0x%02X 0x%02X %d %d\r\n",buffer1[i],buffer2[i],r,q); // *******************INITIALISATIONS END******************** @@ -130,7 +138,8 @@ //gCDMS_HK_TIMER.start(5000); /*starting the thread with signal*/ -// set_sig(); + //set_sig(); + //payload_isr_fun(); /*Calculating Stack used*/