for frequency correction testing
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
Diff: main.cpp
- Revision:
- 199:9f03d6ca94c9
- Parent:
- 197:1369ef45b49e
- Child:
- 201:3410fc4d80f0
diff -r 17200a427e71 -r 9f03d6ca94c9 main.cpp --- a/main.cpp Thu Jun 30 13:01:42 2016 +0000 +++ b/main.cpp Thu Jun 30 21:38:54 2016 +0000 @@ -52,7 +52,34 @@ beacon_tc->TC_string[10] = (crc16 & 0x00FF);\ tm_ptr = FCTN_CDMS_RLY_TMTC(beacon_tc);\ } - +#define OBSRS_TC(tm_ptr){\ + Base_tc *beacon_tc = new Short_tc;\ + beacon_tc->next_TC = NULL;\ + PUTshort_or_long(beacon_tc,SHORT_TC_CODE);\ + PUTcrc_pass(beacon_tc,0x1);\ + PUTexec_status(beacon_tc,0);\ + beacon_tc->TC_string[0] = 0x01;\ + beacon_tc->TC_string[1] = 0x20;\ + beacon_tc->TC_string[2] = 0xf2;\ + beacon_tc->TC_string[3] = 0x00;\ + beacon_tc->TC_string[4] = 0x00;\ + beacon_tc->TC_string[5] = 0;\ + beacon_tc->TC_string[6] = 2;\ + beacon_tc->TC_string[7] = 0;\ + beacon_tc->TC_string[8] = 2;\ + uint16_t crc16 = crc16_gen(beacon_tc->TC_string, 9);\ + beacon_tc->TC_string[9] = (crc16 & 0xFF00)>>8;\ + beacon_tc->TC_string[10] = (crc16 & 0x00FF);\ + Base_tm *tm_ptr_head = NULL;\ + get_call_sign(tm_ptr_head);\ + Base_tm *put_tm_here = NULL;\ + /*execute_obsrs(current_TC, put_tm_here)*/\ + /*read_TC(current_TC);*/\ + execute_OBSRS_TC(beacon_tc);\ + gPC.puts("enter_adf\r\n");\ + transmit_adf;\ + gPC.puts("exit_adf\r\n");\ +} //void set_sig(){gSCIENCE_THREAD->signal_set(SCIENCE_SIGNAL);} int main() { @@ -60,13 +87,6 @@ CDMS_I2C_GPIO = 0; PYLD_I2C_GPIO = 0; - /*gPC.printf("PL_TC sending\r\n"); - - Base_tm *tm_ptr = new Short_tm; - PL_TC(tm_ptr); - - gPC.printf("PL_TC sent");*/ - //gLEDR = 1; // ******************INITIALISATIONS START****************** @@ -94,7 +114,7 @@ gCS_ADF = 1; FCTN_CDMS_INIT_RTC();/* rtc initialization*/ - FCTN_CDMS_SD_INIT();/* sd card initialization*/ + //FCTN_CDMS_SD_INIT();/* sd card initialization*/ uint8_t test[512] = {0}; @@ -125,6 +145,12 @@ PL_wo_dma = new RtosTimer(payload_isr_fun_dma, osTimerPeriodic,(void * )NULL); //PL_wo_dma->start(6000);// + gPC.printf("PL_TC sending\r\n"); + + Base_tm *tm_ptr = new Short_tm; + OBSRS_TC(tm_ptr); + + gPC.printf("PL_TC sent"); // *******************INITIALISATIONS END********************