Repository for CDMS code

Dependencies:   SimpleDMA mbed-rtos mbed eeprom

Fork of COM_MNG_TMTC_SIMPLE by Shreesha S

Files at this revision

API Documentation at this revision

Comitter:
ee12b079
Date:
Thu Jun 30 10:51:38 2016 +0000
Parent:
196:c51bf4993f75
Child:
198:17200a427e71
Commit message:
latest revision (before sdcard testing) ready to be tested bypassing COM

Changed in this revision

COM_MNG_TMTC.h Show annotated file Show diff for this revision Revisions of this file
COM_SND_TM_functions.h Show annotated file Show diff for this revision Revisions of this file
DefinitionsAndGlobals.h Show annotated file Show diff for this revision Revisions of this file
ThreadsAndFunctions.h Show annotated file Show diff for this revision Revisions of this file
cdms_rtc.h Show annotated file Show diff for this revision Revisions of this file
cdms_sd.h Show annotated file Show diff for this revision Revisions of this file
i2c.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/COM_MNG_TMTC.h	Thu Jun 30 10:19:00 2016 +0000
+++ b/COM_MNG_TMTC.h	Thu Jun 30 10:51:38 2016 +0000
@@ -781,7 +781,7 @@
         case 3:
         {
             #if DEBUG
-            printf("Telecommand is for PL\r\n");
+            gPC.printf("Telecommand is for PL\r\n");
             #endif
             received = 0;
 
@@ -816,7 +816,7 @@
             }
             if(received < 1 )
             {
-                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);
--- a/COM_SND_TM_functions.h	Thu Jun 30 10:19:00 2016 +0000
+++ b/COM_SND_TM_functions.h	Thu Jun 30 10:51:38 2016 +0000
@@ -81,7 +81,7 @@
         unsigned int outByte = 0;
         
         for(unsigned int j = 0 ; j < 536 ; ++j){
-//          printf("j = %u, inByte = %u\n", j, inByte);
+//          gPC.printf("j = %u, inByte = %u\n", j, inByte);
             // read a new bit from input stream
 //          cout << "inByte " <<inByte;
             unsigned char tempBit = (input[inByte] >> inBit) & 1;
@@ -124,7 +124,7 @@
             }
             
             if(inBit == -1){
-//              printf("in byte = %u\n", inByte);
+//              gPC.printf("in byte = %u\n", inByte);
                 ++inByte;
                 inBit = 7;
             }
--- a/DefinitionsAndGlobals.h	Thu Jun 30 10:19:00 2016 +0000
+++ b/DefinitionsAndGlobals.h	Thu Jun 30 10:51:38 2016 +0000
@@ -1,14 +1,14 @@
 // **************DEFINITIONS*********************
 
-#define bypass_adf 0
+#define bypass_adf 1
 
 // COM_RX
     #define RX_TIMEOUT_LIMIT 0.5
-    #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
+    //#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
     
-    //#define COM_RX_UART_TX USBTX
-    //#define COM_RX_UART_RX USBRX
+    #define COM_RX_UART_TX USBTX
+    #define COM_RX_UART_RX USBRX
     
 // COMMON SPI
     #define SPI_MOSI PTE1
--- a/ThreadsAndFunctions.h	Thu Jun 30 10:19:00 2016 +0000
+++ b/ThreadsAndFunctions.h	Thu Jun 30 10:51:38 2016 +0000
@@ -134,7 +134,7 @@
         }
         else if( gFLAGS & NEW_TC_RECEIVED ){
             gPC.puts("NEW TC RECEIVED\r\n");
-            Thread::wait(10000);
+            Thread::wait(1000);
             gFLAGS = gFLAGS & (~NEW_TC_RECEIVED);
             gFLAGS = gFLAGS | COM_MNG_TMTC_RUNNING_FLAG;
 
--- a/cdms_rtc.h	Thu Jun 30 10:19:00 2016 +0000
+++ b/cdms_rtc.h	Thu Jun 30 10:51:38 2016 +0000
@@ -82,7 +82,7 @@
 {    
     SPI_mutex.lock();
     uint8_t response;
-    //printf("\n\r Entered rtc\n");
+    //gPC.printf("\n\r Entered rtc\n");
     gCS_RTC=1;
     gCS_RTC=0;
     spi.write(0x00); //reading milliseconds register
@@ -145,8 +145,8 @@
     time = time|(((uint64_t)(month&0x07))<<29);
     time = time|(((uint64_t)(year&0x03))<<33);
     time = (time&0x00000007FFFFFFFF);
-    //printf("\n\r%x%x", (int)(time >> 32), (int)(time));
-    //printf("\n\r0x%016llx\n\r", time);
+    //gPC.printf("\n\r%x%x", (int)(time >> 32), (int)(time));
+    //gPC.printf("\n\r0x%016llx\n\r", time);
    return time;
    SPI_mutex.unlock();
 }
\ No newline at end of file
--- a/cdms_sd.h	Thu Jun 30 10:19:00 2016 +0000
+++ b/cdms_sd.h	Thu Jun 30 10:51:38 2016 +0000
@@ -596,7 +596,7 @@
 
     // send the data block
     write(buffer, 512);
-    //printf("Written Successfully bro \n");
+    //gPC.printf("Written Successfully bro \n");
     return 0;
 }
 
--- a/i2c.h	Thu Jun 30 10:19:00 2016 +0000
+++ b/i2c.h	Thu Jun 30 10:51:38 2016 +0000
@@ -58,7 +58,7 @@
 //pc.printf("\n \r data not received \n");
 
     CDMS_I2C_GPIO = 0;
-    //printf("\n\r %d \n",t.read_us());
+    //gPC.printf("\n\r %d \n",t.read_us());
     //t.reset();
 }
 
--- a/main.cpp	Thu Jun 30 10:19:00 2016 +0000
+++ b/main.cpp	Thu Jun 30 10:51:38 2016 +0000
@@ -5,7 +5,6 @@
 #include "mbed.h"
 
 #define DEBUG 1
-#define power_tx 0
 
 #include "SimpleDMA.h"
 #include "dmaSPIslave.h"
@@ -83,7 +82,7 @@
     
     // DEBUG
     //gPC.puts("welcome to mng_tm_tc\r\n");
-    gPC.baud(1200);
+    gPC.baud(115200);//changed for bypassing COM
     
     // COMMON SPI
     spi.format(8,0);