Repository for CDMS code

Dependencies:   SimpleDMA mbed-rtos mbed eeprom

Fork of COM_MNG_TMTC_SIMPLE by Shreesha S

Revision:
227:05e929bdd4dc
Parent:
224:3ac1f91e0ebc
diff -r 3ac1f91e0ebc -r 05e929bdd4dc main.cpp
--- a/main.cpp	Mon Jul 04 14:31:30 2016 +0000
+++ b/main.cpp	Mon Jul 04 20:27:37 2016 +0000
@@ -37,23 +37,23 @@
 #include "TEST_PL.h"
 
 #define PL_TC(tm_ptr){\
-    Base_tc *beacon_tc = new Short_tc;\
+    Base_tc *beacon_tc = new Long_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] = 0xE0;\
+    beacon_tc->TC_string[1] = 0x60;\
     beacon_tc->TC_string[2] = 0x81;\
-    beacon_tc->TC_string[3] = 0xD0;\
+    beacon_tc->TC_string[3] = 0x21;\
     beacon_tc->TC_string[4] = 0x00;\
     beacon_tc->TC_string[5] = 0;\
     beacon_tc->TC_string[6] = 0;\
     beacon_tc->TC_string[7] = 0;\
     beacon_tc->TC_string[8] = 0;\
-    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);\
+    beacon_tc->TC_string[9] = 0x1d;\
+    beacon_tc->TC_string[10] = 0xd9;\
+    for(uint8_t z=11;z<135;z++){beacon_tc->TC_string[z] = 0;}\
     tm_ptr =  FCTN_CDMS_RLY_TMTC(beacon_tc);\
 }
 #define OBSRS_TC(tm_ptr){\
@@ -106,7 +106,7 @@
     
     // DEBUG
     //gPC.puts("welcome to mng_tm_tc\r\n");
-    gPC.baud(115200);//changed for bypassing COM
+    gPC.baud(9600);//changed for bypassing COM
     
     // COMMON SPI
     spi.format(8,0);
@@ -145,20 +145,26 @@
     
     
     master.frequency(400000);
-    PL_wo_dma = new RtosTimer(payload_isr_fun_dma, osTimerPeriodic,(void * )NULL);
+    //PL_wo_dma = new RtosTimer(payload_isr_fun_dma, osTimerPeriodic,(void * )NULL);
     //PL_wo_dma->start(6000);//
-    gSCIENCE_THREAD->signal_set(SCIENCE_SIGNAL);
+    //gSCIENCE_THREAD->signal_set(SCIENCE_SIGNAL);
     
-    
-    
+    while(1)
+    {
+        CDMS_I2C_GPIO = ~CDMS_I2C_GPIO;
+        wait(2);
+    }
     
-    /*gPC.printf("PL_TC sending\r\n");
+    while(1)
+    {
+        wait(5);
+        gPC.printf("PL_TC sending\r\n");    
+        Base_tm *tm_ptr = new Long_tm;
+        PL_TC(tm_ptr);
+    }
     
-    Base_tm *tm_ptr = new Short_tm;
-    OBSRS_TC(tm_ptr);
+    //gPC.printf("PL_TC sent");
     
-    gPC.printf("PL_TC sent");
-    */
     // *******************INITIALISATIONS END********************
     
     FCTN_CDMS_HK_MAIN((void *)NULL);