werwere

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of COM_MNG_TMTC_SIMPLE_pl123 by Siva ram

Files at this revision

API Documentation at this revision

Comitter:
ee12b079
Date:
Sat Feb 27 10:22:40 2016 +0000
Parent:
130:d5b53088270b
Commit message:
PL not receving data, to be tested; ;

Changed in this revision

COM_MNG_TMTC.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
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	Sat Feb 27 07:12:04 2016 +0000
+++ b/COM_MNG_TMTC.h	Sat Feb 27 10:22:40 2016 +0000
@@ -995,12 +995,19 @@
             #if DEBUG
             printf("Telecommand is for PL\r\n");
             #endif
+            char data_dum[] = "dummy";
+            FCTN_I2C_WRITE_PL(data_dum,5);
+            #if DEBUG
+            printf("dummy data sent\r\n");
+            #endif
+            
             // printf("Informing PL about TC using I2C\r\n"); //interrupt to be sent to the bae
-            if(GETshort_or_long_tc(tc_ptr) == LONG_TC_CODE)
+            /*if(GETshort_or_long_tc(tc_ptr) == LONG_TC_CODE)
                 FCTN_I2C_WRITE_PL((char*)tc_ptr->TC_string,TC_LONG_SIZE);
             else 
+            {
                 FCTN_I2C_WRITE_PL((char*)tc_ptr->TC_string,TC_SHORT_SIZE);
-            
+            }*/
             
             
             while(1)
--- a/DefinitionsAndGlobals.h	Sat Feb 27 07:12:04 2016 +0000
+++ b/DefinitionsAndGlobals.h	Sat Feb 27 10:22:40 2016 +0000
@@ -26,7 +26,7 @@
     #define ADF_IRQ PTA14
     
 //I2C - Payload to CDMS (need to change while using CDMS hardware)
-I2C master(D7,D6);
+I2C master(PTE0,PTE1);
 InterruptIn PYLD_I2C_Int(PTA13);
 
 // TC LIST
--- a/i2c.h	Sat Feb 27 07:12:04 2016 +0000
+++ b/i2c.h	Sat Feb 27 10:22:40 2016 +0000
@@ -19,7 +19,7 @@
 void FCTN_I2C_WRITE_PL(char *data2,uint8_t tc_len2)
 {
     write_ack = master.write(addr_pl|0x00,data2,tc_len2);//address to be defined in payload
-    if(write_ack == 0)
+    if(write_ack == 1)
     {
         #if DEBUG
         gPC.printf("\n\r data not sent \n");
--- a/main.cpp	Sat Feb 27 07:12:04 2016 +0000
+++ b/main.cpp	Sat Feb 27 10:22:40 2016 +0000
@@ -3,6 +3,7 @@
 #include "mbed.h"
 
 #define DEBUG 1
+#define SDCARD 0
 
 #include "SimpleDMA.h"
 #include "dmaSPIslave.h"
@@ -60,7 +61,9 @@
     gCS_ADF = 1;
     
     //FCTN_CDMS_INIT_RTC();/* rtc initialization*/
+    #if SDCARD
     FCTN_CDMS_SD_INIT();/* sd card initialization*/
+    #endif
     
     #if DEBUG
     gPC.puts("welcome to mng_tmtc\r\n");
@@ -72,14 +75,18 @@
     #if DEBUG
     gPC.puts("allocating threads\r\n");
     #endif
+    #if SDCARD
     gSCIENCE_THREAD = new Thread(SCIENCE_FUN);
    // gPC.puts("step one complete\r\n");
     gSCIENCE_THREAD->set_priority(osPriorityBelowNormal);
+    #endif
     
     #if DEBUG
     gPC.puts("competed allocating threads\r\n");
     #endif
     
+    char data_dum[] = "dummy12345";
+    FCTN_I2C_WRITE_PL(data_dum,10);
     
     // *******************INITIALISATIONS END********************