
Compression code changed and RLY_TMTC pointers managed
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
Revision 69:20f09a0c3fd2, committed 2016-01-17
- Comitter:
- aniruddhv
- Date:
- Sun Jan 17 14:04:08 2016 +0000
- Parent:
- 58:5c59f28620bc
- Child:
- 73:6c99294b7802
- Child:
- 75:d03b5d6ef269
- Child:
- 107:396aa26f3fff
- Commit message:
- Integrated shubham's changes
Changed in this revision
--- a/COM_MNG_TMTC.h Fri Jan 15 12:02:12 2016 +0000 +++ b/COM_MNG_TMTC.h Sun Jan 17 14:04:08 2016 +0000 @@ -36,24 +36,6 @@ delete tc_ptr;\ } -#define print_all_tm(tm_ptr_head){\ - Base_tm *temp_tm_ptr = tm_ptr_head;\ - while( temp_tm_ptr != NULL ){\ - int length = TM_SHORT_SIZE;\ - if( GETshort_or_long_tm(temp_tm_ptr->fields) == SHORT_TM_CODE ){\ - length = TM_SHORT_SIZE;\ - }\ - else{\ - length = TM_LONG_SIZE;\ - }\ - for(int i = 0 ; i < length ; ++i){\ - gPC.putc(temp_tm_ptr->TM_string[i]);\ - }\ - temp_tm_ptr = temp_tm_ptr->next_TM;\ - }\ - /*snd_tm.head_pointer(tm_ptr_head);*/\ -} - #define delete_all_tm(tm_ptr_head){\ /*DELETE THE TM AFTER USE*/\ Base_tm *temp_tm_ptr = tm_ptr_head;\ @@ -445,7 +427,7 @@ // CDMS TEAM CODE START inline Base_tm* FCTN_CDMS_RLY_TMTC(Base_tc *tc_ptr){ uint8_t ACKCODE = 0x00; - printf("\rTC execution in progress\r\n"); + //gPC.printf("\rTC execution in progress\r\n"); Base_tm *tm_pointer = new Long_tm; Base_tm *tm_ptr = tm_pointer; received = 0; @@ -453,17 +435,17 @@ { case 1: //apid=01 implies it corresponds to bae { - printf("Telecommand is for BAE\r\n"); - printf("Sending TC to BAE...\r\n"); //interrupt to be sent to the bae + //gPC.printf("Telecommand is for BAE\r\n"); + //gPC.printf("Sending TC to BAE...\r\n"); //interrupt to be sent to the bae FCTN_I2C_WRITE((char*)tc_ptr->TC_string); while(1) { wait(1); //TimeOut instead of wait if(tm_status_4m_slv == 1) { - printf("receiving...\r\n"); + //gPC.printf("receiving...\r\n"); FCTN_I2C_READ((char*)tm_pointer->TM_string); - //printf("%s", tm_pointer->TM_string); + //gPC.printf("%s", tm_pointer->TM_string); received+=1; tm_pointer = tm_pointer->next_TM; break; //only for testing purpose @@ -475,11 +457,11 @@ } if(received >= 1 ) { - printf("Telemetry is received from BAE\r\n"); + //gPC.printf("Telemetry is received from BAE\r\n"); Base_tm *tm_print = tm_ptr; for(uint8_t i=0;i<received;i++) { - printf("%s", tm_print->TM_string); + //gPC.printf("%s", tm_print->TM_string); tm_print = tm_print->next_TM; //for check } received = 0; @@ -487,7 +469,7 @@ } else { - printf("Telemetry is not received from BAE\r\n"); + //gPC.printf("Telemetry is not received from BAE\r\n"); //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -507,17 +489,17 @@ } case 2: { - printf("Telecommand is for CDMS\r\n"); //apid = 10 corresponds to cdms + //gPC.printf("Telecommand is for CDMS\r\n"); //apid = 10 corresponds to cdms switch(GETservice_type(tc_ptr)) { case 0x60: { - printf("service:MMS\r\n"); + //gPC.printf("service:MMS\r\n"); switch(GETservice_subtype(tc_ptr)) { case 0x1: { - printf("sub_service:Read from RAM_Memory\r\n"); + //gPC.printf("sub_service:Read from RAM_Memory\r\n"); mid=(uint16_t)(tc_ptr->TC_string[3]<<4)+(uint16_t)(tc_ptr->TC_string[4]); Data[0] = FCTN_CDMS_RD_FLASH(0); @@ -541,7 +523,7 @@ } case 0x2: { - printf("sub_service:Read from Flash_Memory\r\n"); + //gPC.printf("sub_service:Read from Flash_Memory\r\n"); mid=(uint16_t)(tc_ptr->TC_string[3]<<4)+(uint16_t)(tc_ptr->TC_string[4]); Data[0] = FCTN_CDMS_RD_FLASH(0); @@ -565,7 +547,7 @@ } case 0x5: { - printf("WRITE ON FLASH_MEMORY\r\n"); + //gPC.printf("WRITE ON FLASH_MEMORY\r\n"); mid=(uint16_t)(tc_ptr->TC_string[3]<<4)+(uint16_t)(tc_ptr->TC_string[4]); block = (((uint32_t)(tc_ptr->TC_string[5])<<24)|((uint32_t)(tc_ptr->TC_string[5])<<16)|((uint32_t)(tc_ptr->TC_string[5])<<8)|((uint32_t)(tc_ptr->TC_string[5]))); FCTN_CDMS_WR_FLASH(mid,block); @@ -587,7 +569,7 @@ } default: { - printf("INVALID TC\r\n"); //Send Invalid TC Telemetry + //gPC.printf("INVALID TC\r\n"); //Send Invalid TC Telemetry //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -608,12 +590,12 @@ } case 0x8: { - printf("service:FUNCTION MANAGEMENT SERVICE\r\n"); + //gPC.printf("service:FUNCTION MANAGEMENT SERVICE\r\n"); if(GETservice_subtype(tc_ptr)==0x1) { if(GETpid(tc_ptr)==0x01) { - printf("TC_PL_INIT\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_PL_INIT\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -630,7 +612,7 @@ } else if(GETpid(tc_ptr)==0x02) { - printf("TC_PL_MAIN\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_PL_MAIN\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -647,7 +629,7 @@ } else if(GETpid(tc_ptr)==0x03) { - printf("TC_COM_INIT\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_COM_INIT\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -664,7 +646,7 @@ } else if(GETpid(tc_ptr)==0x04) { - printf("TC_CDMS_HK_MAIN\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_CDMS_HK_MAIN\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -681,7 +663,7 @@ } else if(GETpid(tc_ptr)==0x11) { - printf("TC_SW_ON_SD\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_SW_ON_SD\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -698,7 +680,7 @@ } else if(GETpid(tc_ptr)==0x12) { - printf("TC_SW_ON_RTC\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_SW_ON_RTC\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -715,7 +697,7 @@ } else if(GETpid(tc_ptr)==0x13) { - printf("TC_SW_ON_BAE\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_SW_ON_BAE\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -732,7 +714,7 @@ } else if(GETpid(tc_ptr)==0x14) { - printf("TC_SW_ON_PL_DL\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_SW_ON_PL_DL\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -749,7 +731,7 @@ } else if(GETpid(tc_ptr)==0x15) { - printf("TC_SW_ON_PL_AG_HV\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_SW_ON_PL_AG_HV\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -766,7 +748,7 @@ } else if(GETpid(tc_ptr)==0x16) { - printf("TC_SW_ON_V_A_EN\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_SW_ON_V_A_EN\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -783,7 +765,7 @@ } else if(GETpid(tc_ptr)==0x21) { - printf("TC_SW_OFF_SD\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_SW_OFF_SD\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -800,7 +782,7 @@ } else if(GETpid(tc_ptr)==0x22) { - printf("TC_SW_OFF_RTC\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_SW_OFF_RTC\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -817,7 +799,7 @@ } else if(GETpid(tc_ptr)==0x23) { - printf("TC_SW_OFF_BAE\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_SW_OFF_BAE\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -834,7 +816,7 @@ } else if(GETpid(tc_ptr)==0x24) { - printf("TC_SW_OFF_PL_DL\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_SW_OFF_PL_DL\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -851,7 +833,7 @@ } else if(GETpid(tc_ptr)==0x25) { - printf("TC_SW_OFF_PL_AG_HV\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_SW_OFF_PL_AG_HV\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -868,7 +850,7 @@ } else if(GETpid(tc_ptr)==0x26) { - printf("TC_SW_OFF_V_A_EN\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_SW_OFF_V_A_EN\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -885,7 +867,7 @@ } else if(GETpid(tc_ptr)==0x31) { - printf("TC_RST_SD\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_RST_SD\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -902,7 +884,7 @@ } else if(GETpid(tc_ptr)==0x32) { - printf("TC_RST_RTC\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_RST_RTC\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -919,7 +901,7 @@ } else if(GETpid(tc_ptr)==0x33) { - printf("TC_RST_BAE\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_RST_BAE\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -936,7 +918,7 @@ } else if(GETpid(tc_ptr)==0x34) { - printf("TC_RST_PL_DL\r\n"); // call PWR_SWCH_ON function + //gPC.printf("TC_RST_PL_DL\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -954,7 +936,7 @@ } else if(GETpid(tc_ptr)==0xC1) { - printf("RESET_HK_COUNTER\r\n"); // call PWR_SWCH_ON function + //gPC.printf("RESET_HK_COUNTER\r\n"); // call PWR_SWCH_ON function //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -971,7 +953,7 @@ } else if(GETpid(tc_ptr)==0xF1) { - printf("RD_RTC\r\n"); //call RD_RTC + //gPC.printf("RD_RTC\r\n"); //call RD_RTC //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xD0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -992,7 +974,7 @@ } else { - printf("INVALID TC\r\n"); + //gPC.printf("INVALID TC\r\n"); //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -1014,7 +996,7 @@ } default: { - printf("INVALID TC"); //send invalid TC TM + //gPC.printf("INVALID TC"); //send invalid TC TM //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -1035,10 +1017,10 @@ } case 3: { - printf("Telecommand is for PL\r\n"); - // printf("Informing PL about TC using I2C\r\n"); //interrupt to be sent to the bae + //gPC.printf("Telecommand is for PL\r\n"); + // gPC.printf("Informing PL about TC using I2C\r\n"); //interrupt to be sent to the bae // FCTN_I2C_WRITE((char*)tc_ptr->TC_string); - // printf("sent the Telecommand to BAE\r\n"); //packet along with crc will be sent when bae is ready + // //gPC.printf("sent the Telecommand to BAE\r\n"); //packet along with crc will be sent when bae is ready // wait(1); //wait time is to be optimised // if(tm_status_4m_slv == 1) // { @@ -1047,15 +1029,15 @@ // } // if(received == 1 ) // { - // printf("Telemetry is received from BAE\r\n"); - // printf("%s", tm_ptr->TM_string); + // //gPC.printf("Telemetry is received from BAE\r\n"); + // //gPC.printf("%s", tm_ptr->TM_string); // received = 0; // } // similar to BAE functions break; } default: //invalid TC { - printf("INVALID TC\r\n"); + //gPC.printf("INVALID TC\r\n"); //tm_pointer = new Short_tm; tm_pointer->TM_string[0] = 0xB0; tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr); @@ -1275,8 +1257,8 @@ }\ }\ if( obosc_executed_count != 0 ){\ - print_all_tm(obosc_tm_head);\ - /*adf_not_SDcard();*/\ + snd_tm.head_pointer(obosc_tm_head);\ + adf_not_SDcard;\ }\ delete_all_tm(obosc_tm_head);\ if ( reset_flag == 1 ){\ @@ -1306,7 +1288,9 @@ get_call_sign(tm_ptr_head);\ Base_tm *tm_ptr = tm_ptr_head;\ get_ack_l1(tm_ptr->next_TM);\ - print_all_tm(tm_ptr_head);\ + /*Send only call sign, ACK_L1*/\ + snd_tm.head_pointer(tm_ptr_head);\ + adf_not_SDcard;\ delete_all_tm(tm_ptr_head);\ }\ break;\ @@ -1318,7 +1302,9 @@ get_call_sign(tm_ptr_head);\ Base_tm *tm_ptr = tm_ptr_head;\ get_ack_l1(tm_ptr->next_TM);\ - print_all_tm(tm_ptr_head);\ + /*Send only call sign, ACK_L1*/\ + snd_tm.head_pointer(tm_ptr_head);\ + adf_not_SDcard;\ delete_all_tm(tm_ptr_head);\ break;\ }\ @@ -1406,7 +1392,8 @@ if( tempPAhot == 0x00 ){\ gFLAGS = gFLAGS | COM_PA_HOT_FLAG;\ }\ - print_all_tm(tm_ptr_head);\ + /*Send call sign, ACK_L1, NON OBSRS TM*/\ + snd_tm.head_pointer(tm_ptr_head);\ adf_not_SDcard;\ delete_all_tm(tm_ptr_head);\ }\ @@ -1448,7 +1435,9 @@ if( tempPAhot == 0x00 ){\ gFLAGS = gFLAGS | COM_PA_HOT_FLAG;\ }\ - print_all_tm(tm_ptr_head);\ + /*Send only call sign, ACK_L1, OBSRS TM*/\ + snd_tm.head_pointer(tm_ptr_head);\ + adf_not_SDcard;\ delete_all_tm(tm_ptr_head);\ }\ }\
--- a/COM_POWER_ON_TX.h Fri Jan 15 12:02:12 2016 +0000 +++ b/COM_POWER_ON_TX.h Sun Jan 17 14:04:08 2016 +0000 @@ -70,22 +70,10 @@ }\ }\ get_tc_list(power_on_tm->next_TM, 0x00);\ - power_on_tm = power_on_tm_head;\ - while(power_on_tm != NULL){\ - int length = TM_SHORT_SIZE;\ - if( GETshort_or_long_tm(power_on_tm->fields) == SHORT_TM_CODE ){\ - length = TM_SHORT_SIZE;\ - }\ - else{\ - length = TM_LONG_SIZE;\ - }\ - /*gPC.puts("Printing Call Sign, ACK_L1, TC_LIST inside COM_POWER_ON\r\n");*/\ - for(int i = 0 ; i < length ; ++i){\ - gPC.putc(power_on_tm->TM_string[i]);\ - }\ - power_on_tm = power_on_tm->next_TM;\ - }\ /*PENDING: TRANSMIT ABOVE TM*/\ + /*Call Sign, ACK_L1, TC_LIST*/\ + snd_tm.head_pointer(power_on_tm_head);\ + adf_not_SDcard;\ /*deleting the telemetry*/\ power_on_tm = power_on_tm_head;\ overFlowCountADF = 0;\
--- a/COM_SND_TM.h Fri Jan 15 12:02:12 2016 +0000 +++ b/COM_SND_TM.h Sun Jan 17 14:04:08 2016 +0000 @@ -13,6 +13,12 @@ const unsigned char SCH40[] = {0x0a,0x3f,0x46,0xb4,0x00}; const unsigned char EXOR_SEQ[] = {0x55,0xF1,0x51,0x3D,0xA7,0x42,0xAE,0x2E,0x2E,0x28,0x76,0x80,0x62,0x41,0xC4,0x75,0x4D,0x87,0xDB,0xE1,0x02,0x61,0x60,0x96,0x9C,0xCB,0x8A,0xBD,0x37,0xE4,0x72,0x5D,0xF2,0x19,0x62,0x06,0x9A,0xF9,0x38,0xB0,0x49,0x75,0xD0,0x17,0x1B,0xCC,0x0B,0xEB,0x1B,0x50,0xA2,0x2A,0x8E,0xFA,0x4D,0x6F,0x1B,0xF8,0x0F,0x97,0x39,0x25,0x60,0x55,0x9A,0xDF,0x1D,0x10,0x7F,0xBD,0x3E,0xBF,0xE5,0x68,0x02,0xD1,0x99,0x0D,0xDF,0x84,0x2E,0x15,0xE3,0x08,0xD7,0x44,0x10,0x41,0xCE,0x93,0xF6,0x59,0x71,0xD2,0xF7,0x1C,0x4A,0x44,0x2D,0xA9,0x44,0x98,0x3A,0x00,0x71,0xCC,0x2A,0x35,0xC1,0x81,0xCF,0x44,0xF7,0x6A,0x0E,0xE4,0xF2,0xFC,0xD6,0x0B,0xA8,0x95,0x7B,0x86,0xB5,0xF8,0x33,0xE9,0xBF,0x6A,0x0E,0xE6,0x53,0x82}; +#define print_tm(ptr) {\ + for( int i = 0; i < 134; i++ ){\ + gPC.putc(ptr[i]);\ + }\ +} + class SND_TM{ Base_tm * head_ptr; @@ -167,7 +173,7 @@ }\ }\ TMframe_type1[0] = (1<<7) + (( (i-4)/13 )<<3);\ - TMframe_type1[3] = crc16_gen(TMframe_type1,3);\ + TMframe_type1[3] = crc8_gen(TMframe_type1,3);\ if(T1F_pointer == NULL && i>12){\ for( ; i < 134 ; i++){\ TMframe_type1[i] = TMframe_type1[i-13];\ @@ -228,6 +234,8 @@ DS_state = !DS_state;\ if (DS_f){\ DS_f = false;\ + if(bypass_adf == 1)\ + print_tm(ptr);\ exor(ptr);\ convolution(ptr);\ interleave(convoluted_frame,interleave_data[0]);\
--- a/DefinitionsAndGlobals.h Fri Jan 15 12:02:12 2016 +0000 +++ b/DefinitionsAndGlobals.h Sun Jan 17 14:04:08 2016 +0000 @@ -1,13 +1,12 @@ // **************DEFINITIONS********************* + +#define bypass_adf 1 + // COM_RX #define RX_TIMEOUT_LIMIT 0.5 - #define COM_RX_UART_TX PTE20 - #define COM_RX_UART_RX PTE21 + #define COM_RX_UART_TX PTE20 // For bypassing RX1M (SET BAUD RATE 1200) #define COM_RX_UART_TX USBTX + #define COM_RX_UART_RX PTE21 // For bypassing RX1M (SET BAUD RATE 1200) #define COM_RX_UART_RX USBRX -// For serial port printing(SET BAUD RATE 1200) -// #define COM_RX_UART_TX USBTX -// #define COM_RX_UART_RX USBRX - // COMMON SPI #define SPI_MOSI PTE1 #define SPI_MISO PTE3
--- a/SDC_init.h Fri Jan 15 12:02:12 2016 +0000 +++ b/SDC_init.h Sun Jan 17 14:04:08 2016 +0000 @@ -56,10 +56,10 @@ // start_block_num =10 ; // Read from TC // end_block_num =Science_TMframe::SDC_address ; // Read from TC -// printf("welcome\n"); +// //gPC.printf("welcome\n"); initialise_card(); int result= initialise_card(); -// printf("initialise card result=%d\n",result); +// //gPC.printf("initialise card result=%d\n",result); disk_initialize(); } @@ -84,11 +84,11 @@ // send CMD8 to determine whther it is ver 2.x int r = cmd8(); if (r == R1_IDLE_STATE) { -// printf("Entering v2 bro\n"); +// //gPC.printf("Entering v2 bro\n"); return initialise_card_v2(); } else if (r == (R1_IDLE_STATE | R1_ILLEGAL_COMMAND)) { - printf("Entering v1 bro\n"); + //gPC.printf("Entering v1 bro\n"); return initialise_card_v1(); } else { @@ -102,7 +102,7 @@ for (int i = 0; i < SD_COMMAND_TIMEOUT; i++) { cmd(55, 0); if (cmd(41, 0) == 0) { - // printf("Yuppie v1 successful\n"); + // //gPC.printf("Yuppie v1 successful\n"); cdv = 512; debug_if(SD_DBG, "\n\rInit: SEDCARD_V1\n\r"); @@ -122,7 +122,7 @@ cmd58(); cmd(55, 0); if (cmd(41, 0x40000000) == 0) { - // printf("Yuppie,v2 successful\n"); + // //gPC.printf("Yuppie,v2 successful\n"); cmd58(); debug_if(SD_DBG, "\n\rInit: SDCARD_V2\n\r"); cdv = 1; @@ -328,7 +328,7 @@ debug("Set 512-byte block timed out\n"); return 1; } else { - // printf("Hey,block init succesful\n"); + // //gPC.printf("Hey,block init succesful\n"); } spi.frequency(1000000); // Set to 1MHz for data transfer @@ -345,7 +345,7 @@ // send the data block write(buffer, 512); - //printf("Written Successfully bro \n"); + ////gPC.printf("Written Successfully bro \n"); return 0; }
--- a/SDCread.h Fri Jan 15 12:02:12 2016 +0000 +++ b/SDCread.h Sun Jan 17 14:04:08 2016 +0000 @@ -72,11 +72,11 @@ // cout<<"first block exit\n"; // cout<<Number_of_blocks_to_read; - //printf("\n"); + ////gPC.printf("\n"); // for(int j=0;j<512;j++){ -// printf("%02X ",buffer_512[j]); +// //gPC.printf("%02X ",buffer_512[j]); // } -// printf("\n"); +// //gPC.printf("\n"); // if(block_counter == Number_of_blocks_to_read){ // last_block = true; // } @@ -167,12 +167,12 @@ enable_T_frame = false; new_session = true; EOS_counter =0; -// printf("yoooo %d",int(sent_tm)); +// //gPC.printf("yoooo %d",int(sent_tm)); sent_tm=0; last_block = false; last_buffer = true; - printf("?\r\n"); + //gPC.printf("?\r\n"); break; } }
--- a/ThreadsAndFunctions.h Fri Jan 15 12:02:12 2016 +0000 +++ b/ThreadsAndFunctions.h Sun Jan 17 14:04:08 2016 +0000 @@ -103,6 +103,7 @@ } else if( gFLAGS & NEW_TC_RECEIVED ){ /*gPC.puts("NEW TC RECEIVED\r\n");*/ + Thread::wait(10000); /*To be removed in flight model*/ gFLAGS = gFLAGS & (~NEW_TC_RECEIVED); gFLAGS = gFLAGS | COM_MNG_TMTC_RUNNING_FLAG; @@ -166,16 +167,16 @@ } } else{ - gPC.puts("tc list is not complete\r\n"); + //gPC.puts("tc list is not complete\r\n"); if(tempContinue & 0x01){ - gPC.puts("last packet bit not found\r\n"); + //gPC.puts("last packet bit not found\r\n"); } if( tempContinue & 0x02 ){ - gPC.puts("missing psc found\r\n"); + //gPC.puts("missing psc found\r\n"); } - gPC.printf("crc fail tc = %u\r\n", gTOTAL_CRC_FAIL_TC); - gPC.printf("incorrect size tc = %u\r\n", gTOTAL_INCORRECT_SIZE_TC); - gPC.printf("repeated psc = %u\r\n", gTOTAL_REPEATED_TC); + //gPC.printf("crc fail tc = %u\r\n", gTOTAL_CRC_FAIL_TC); + //gPC.printf("incorrect size tc = %u\r\n", gTOTAL_INCORRECT_SIZE_TC); + //gPC.printf("repeated psc = %u\r\n", gTOTAL_REPEATED_TC); Base_tc *test_tc = gHEAD_NODE_TCL; while( test_tc != NULL ){ int length = 0; @@ -186,12 +187,12 @@ length = TC_LONG_SIZE; } for(int i = 0 ; i < length ; ++i ){ - gPC.printf("%x ", test_tc->TC_string[i]); + //gPC.printf("%x ", test_tc->TC_string[i]); } - gPC.puts("\r\n"); + //gPC.puts("\r\n"); test_tc = test_tc->next_TC; } - gPC.puts("\r\n"); + //gPC.puts("\r\n"); COM_POWER_ON_TX; // PENDING : POWER OFF TX RX1M.attach(&rx_read, Serial::RxIrq);
--- a/adf.h Fri Jan 15 12:02:12 2016 +0000 +++ b/adf.h Sun Jan 17 14:04:08 2016 +0000 @@ -109,11 +109,11 @@ else{\ hardware_reset(0);\ hw_reset_err_cnt++;\ - gPC.puts("Resetting hardware\r\n");\ + /*gPC.puts("Resetting hardware\r\n");*/\ }\ }\ if( flag == false ){\ - gPC.puts("Seems to be SPI problem\r\n");\ + /*gPC.puts("Seems to be SPI problem\r\n");*/\ }\ assrt_phy_off(tempReturn);\ if(!bbram_flag){\ @@ -232,7 +232,7 @@ buffer_state = !buffer_state;\ if(last_buffer){\ finish_write_data = true;\ - gPC.puts("adf_off\r\n");\ + /*gPC.puts("adf_off\r\n");*/\ }\ } @@ -307,7 +307,7 @@ spi.write(0xB1);\ gCS_ADF=1;\ SPI_mutex.unlock();\ - gPC.puts("transmission done\r\n");\ + /*gPC.puts("transmission done\r\n");*/\ loop_on = false;\ }else{\ write_data;\ @@ -318,7 +318,7 @@ } void read_TC(Base_tc* TC_ptr){ - gPC.puts("Inside sd card sending\r\n"); + //gPC.puts("Inside sd card sending\r\n"); unsigned char service_subtype = 0; uint64_t starting_add = 0, ending_add = 0; service_subtype = (TC_ptr->TC_string[2])&0x0f; @@ -327,7 +327,7 @@ starting_add = 10; // for now ending_add = 20; // adf_SND_SDCard(starting_add , ending_add); - gPC.puts("sending from sd card\r\n"); + //gPC.puts("sending from sd card\r\n"); adf_SND_SDCard; } @@ -338,9 +338,9 @@ loop_on = true;\ ADF_off = false;\ initial_adf_check;\ - gPC.puts("initial adf check\r\n");\ + /*gPC.puts("initial adf check\r\n");*/\ initiate;\ - gPC.puts("adf configured\r\n");\ + /*gPC.puts("adf configured\r\n");*/\ gLEDR = !gLEDR;\ } @@ -351,7 +351,7 @@ send_data;\ while(loop_on){\ wait_ms(COM_TX_TICKER_LIMIT);\ - if(IRQ){\ + if(IRQ || bypass_adf){\ if(finish_write_data){\ if(ADF_off){\ SPI_mutex.lock();\ @@ -360,7 +360,7 @@ gCS_ADF=1;\ SPI_mutex.unlock();\ loop_on = false;\ - gPC.puts("Transmission done\r\n");\ + /*gPC.puts("Transmission done\r\n");*/\ }\ else{\ ADF_off = true;\ @@ -371,5 +371,5 @@ }\ }\ }\ - gPC.puts("after while loop\r\n");\ + /*gPC.puts("after while loop\r\n");*/\ } \ No newline at end of file
--- a/i2c.h Fri Jan 15 12:02:12 2016 +0000 +++ b/i2c.h Sun Jan 17 14:04:08 2016 +0000 @@ -23,16 +23,16 @@ write_ack = master.write(addr|0x00,data,tc_len); //t.stop(); //if(write_ack == 0) - //pc.printf("\n\r data not sent \n"); + //gPC.printf("\n\r data not sent \n"); if (write_ack == 1) { led2 = 1; - printf("\n\r data not sent \n"); + //gPC.printf("\n\r data not sent \n"); led2 = 0; } irpt_2_slv = 0; - //pc.printf("\n\r %d \n",t.read_us()); + //gPC.printf("\n\r %d \n",t.read_us()); //t.reset(); } @@ -45,17 +45,17 @@ t_read.stop(); //if(read_ack == 0) - // printf("\n\rData received from BAE %s \n",data); + // gPC.printf("\n\rData received from BAE %s \n",data); if (read_ack == 1) { led2 = 1; - printf("\n \r data not received \n"); + //gPC.printf("\n \r data not received \n"); led2 = 0; } //if(read_ack == 1) -//pc.printf("\n \r data not received \n"); +//gPC.printf("\n \r data not received \n"); irpt_2_slv = 0; - //printf("\n\r %d \n",t.read_us()); + //gPC.printf("\n\r %d \n",t.read_us()); //t.reset(); } \ No newline at end of file