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 Jan 05 17:38:21 2017 +0000
Parent:
338:d63eb331a67d
Child:
346:204497974293
Commit message:
Added few printf statements

Changed in this revision

CDMS_HK.h Show annotated file Show diff for this revision Revisions of this file
CDMS_PL.h Show annotated file Show diff for this revision Revisions of this file
COM_MNG_TMTC.h Show annotated file Show diff for this revision Revisions of this file
COM_RCV_TC.h Show annotated file Show diff for this revision Revisions of this file
Compression.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
adf.h Show annotated file Show diff for this revision Revisions of this file
--- a/CDMS_HK.h	Mon Jan 02 14:21:44 2017 +0000
+++ b/CDMS_HK.h	Thu Jan 05 17:38:21 2017 +0000
@@ -48,18 +48,22 @@
     uint8_t sd_stat = 0;
     uint8_t hk_count=0;
     while(1) {
+        gPC.printf("waiting for HK sig\n\r");
         gHK_THREAD->signal_wait(HK_SIGNAL);
+        gPC.printf("checking mutex in HK\n\r");
         gMutex.lock();
+        gPC.printf("locked mutex, entered in HK \n\r");
         if(hk_count == 1 || hk_count == 2) {
             FCTN_CDMS_PL_MAIN((void const *)NULL);
             hk_count--;
+            gPC.printf("releasing mutex for HK_PL \n\r");
             gMutex.unlock();
             continue;
         } else if(hk_count == 0) {
             FCTN_CDMS_PL_MAIN((void const *)NULL);
             hk_count = 2;
         }
-        //  gPC.printf("\n\rEntering HK thread\n");
+          
         //gPC.printf("\n\r%d\n",CDMS_WR_SD_FAULT_COUNTER);
         if(EN_CDMS_HK == 0x00)
             continue;
@@ -244,6 +248,7 @@
         } else
             gPC.printf("long Bcn not sent\r\n");
         //gPC.printf("\rCompleted Beacon\n");
+        gPC.printf("\rreleasing mutex for HK_MAIN \n\r");
         gMutex.unlock();
     }
 }
--- a/CDMS_PL.h	Mon Jan 02 14:21:44 2017 +0000
+++ b/CDMS_PL.h	Thu Jan 05 17:38:21 2017 +0000
@@ -379,7 +379,7 @@
         if(pl_next_index==-1)
         {
             //gPC.printf("\n\rFuture block not found");
-            gPC.printf("\n\rpl_next_index = %d",pl_next_index);
+            gPC.printf("\n\rpl_next_index = %d\n\r",pl_next_index);
         }
         //gPC.printf("\n\rNew pl_state  = %d",(pl_main_flag&(~STATE_SCIENCE))>>2);
     }           
--- a/COM_MNG_TMTC.h	Mon Jan 02 14:21:44 2017 +0000
+++ b/COM_MNG_TMTC.h	Thu Jan 05 17:38:21 2017 +0000
@@ -1142,8 +1142,8 @@
                     Base_tm *tm_ptr = new Long_tm;
                     y=FCTN_I2C_READ_PL((char*)tm_ptr->TM_string,TM_LONG_SIZE);
                     gPC.printf("\n\r");
-                    for(int i = 0;i<134;i++)
-                    gPC.printf("%X",(int)(tm_ptr->TM_string[i]));
+                    //for(int i = 0;i<134;i++)
+                    //gPC.printf("%X",(int)(tm_ptr->TM_string[i]));
                     if(y==0)
                     {
                         TIME_LATEST_I2C_SPEED = FCTN_CDMS_RD_RTC() >> 7;
--- a/COM_RCV_TC.h	Mon Jan 02 14:21:44 2017 +0000
+++ b/COM_RCV_TC.h	Thu Jan 05 17:38:21 2017 +0000
@@ -122,12 +122,12 @@
     COM_RX_DATA_NODE *data_node = gRX_HEAD_DATA_NODE;
     // read byte by byte
     
-    gPC.puts("received data : \n");
+    //gPC.puts("received data : \n");
     
     while( data_node != NULL ){
         for(int iBuf = 0 ; iBuf < RX_BUFFER_LENGTH ; ++iBuf ){
             uint8_t test_this = data_node->values[iBuf];
-            gPC.printf("0x%02X ",test_this);
+            //gPC.printf("0x%02X ",test_this);
             ++bytes_read;
     
             // read bit by bit
--- a/Compression.h	Mon Jan 02 14:21:44 2017 +0000
+++ b/Compression.h	Thu Jan 05 17:38:21 2017 +0000
@@ -2803,7 +2803,7 @@
     #if test_science
     dma_packets_info();
     #endif
-    gPC.printf("\n\rEnd of SRP function"); 
+    gPC.printf("End of SRP function\n\r"); 
     //SCI_LED1 = !SCI_LED1;
     SCI_LED1 = 0;
 }
--- a/ThreadsAndFunctions.h	Mon Jan 02 14:21:44 2017 +0000
+++ b/ThreadsAndFunctions.h	Thu Jan 05 17:38:21 2017 +0000
@@ -26,9 +26,11 @@
     //AY_SPI->bulkRead_pause();
     //AY_SPI->bulkRead_resume(&payload_isr_fun);
     while(true){
-        //gPC.puts("entering sci\r\n");
+        gPC.printf("waiting for Sci sig\n\r");
         gSCIENCE_THREAD->signal_wait(SCIENCE_SIGNAL);
-        gMutex.lock(); 
+        gPC.printf("checking mutex in Sci\n\r");
+        gMutex.lock();
+        gPC.printf("locked mutex,entered in Sci thread\n\r"); 
         PL_RCV_SC_DATA_STATUS = 1;
         //gPC.puts("sig_set\r\n");
         //for(int i =0; i<PAYLOAD_BUFFER_LENGTH; i++)
@@ -52,6 +54,7 @@
     
         /*else
         gPC.printf("\n\rDMA error");*/
+        gPC.printf("\r\nreleasing mutex for Sci\n\r");
         gMutex.unlock(); 
     }
 }
@@ -188,7 +191,7 @@
             }
         }
         else if( gFLAGS & NEW_TC_RECEIVED ){
-            gPC.puts("\n\n\rNEW TC RECEIVED\r\n");
+            gPC.puts("\n\n\n\r\rNEW TC RECEIVED\r\n");
             /*Thread::wait(2000);*/
             gFLAGS = gFLAGS & (~NEW_TC_RECEIVED);
             gFLAGS = gFLAGS | COM_MNG_TMTC_RUNNING_FLAG;
--- a/adf.h	Mon Jan 02 14:21:44 2017 +0000
+++ b/adf.h	Thu Jan 05 17:38:21 2017 +0000
@@ -130,7 +130,7 @@
     }\
     gCS_ADF=1;\
     if(!bbram_err)\
-        gPC.printf("BBRAM verified \r\n");\
+        /*gPC.printf("BBRAM verified \r\n")*/;\
     else\
         gPC.printf("BBRAM error \r\n");\
  
@@ -389,7 +389,7 @@
     if(reg_err)\
         gPC.printf("Reg_err_ignored %x \r\n",(int)temp);\
     else\
-        gPC.printf("reg written successful %x \r\n",(int)temp);\
+        /*gPC.printf("reg written successful %x \r\n",(int)temp)*/;\
     reg_err=true;\
     for(reg_err_cnt=0;reg_err_cnt<REG_ERR_THRS && reg_err;reg_err_cnt++){\
         gCS_ADF=0;\
@@ -499,7 +499,7 @@
             spi.write(0xB1);\
             gCS_ADF=1;\
             gPC.puts("transmission done\r\n");\
-            gPC.printf("Time taken by last write_data %f msecs\n", T.read_ms());\
+            /*gPC.printf("Time taken by last write_data %f msecs\n", T.read_ms())*/;\
             T.stop();\
             T.reset();\
             loop_on=false;\
@@ -616,7 +616,7 @@
                             }\
                         else{\
                             rbp_err_cnt=0;\
-                            gPC.printf("NO Reg err\r\n");\
+                            /*gPC.printf("NO Reg err\r\n")*/;\
                             CMD(CMD_CONFIG_DEV);\
                             if(cmd_err_flag){\
                                 reset_flag=1;\
@@ -624,7 +624,7 @@
                             }\
                             else{\
                                 reset_flag=0;\
-                                gPC.printf("NO CMD ERR CONFIG_DONE\r\n");\
+                                /*gPC.printf("NO CMD ERR CONFIG_DONE\r\n")*/;\
                                 quit_configuration=true;\
                             }\
                         }\