vr1.1

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of CDMS_RTOS_v1_1 by Team Fox

Revision:
3:0c3f7c3fabc9
Parent:
2:4c79b3dfef31
Child:
4:cc85cfaa2086
--- a/main.cpp	Mon Jun 15 13:32:28 2015 +0000
+++ b/main.cpp	Tue Jun 16 09:04:53 2015 +0000
@@ -5,14 +5,16 @@
 
 Serial pc(USBTX,USBRX);
 
-SPISlave pl_spi(PTD6, PTD7, PTD5, PTD4 ); // mosi, miso, sclk, ssel --> using SPI1
+extern SPISlave pl_spi ; // mosi, miso, sclk, ssel --> using SPI1
 
 InterruptIn pl_sc_data(PTC3);
 InterruptIn cdms_rcv_tc(PTC12);
-InterruptIn bae_tm_rcv(PTA4);
-InterruptIn pl_tm_rcv(PTA5);
+InterruptIn bae_tm_rcv(PTC11);
+InterruptIn pl_tm_rcv(PTC10);
+extern I2C master;
+extern DigitalOut irpt_2_slv;
 
-char *i2c_data;
+char i2c_data[25];
 
 /*****************************************************************Threads USed*************************************************************************/
 Thread *ptr_t_hk_acq;              //pointer:::::::::to read state of one thread from another
@@ -54,8 +56,11 @@
          
 void TSC_CDMS_HK_MAIN(void const *args)
 {
+    uint8_t* rtc_data;
     pc.printf("in FUNC_CDMS_HK_MAIN()\r\n");
     FCTN_MASTER_I2C('h' , i2c_data );
+    rtc_data = FUNC_CDMS_RD_RTC();
+    printf("\n\r rtc exited\n");
 }
 
 void ISR_PL_RCV_SC_DATA()
@@ -74,14 +79,14 @@
 }
 
 int main() {
-    
+    printf("\n\r CDMS Activated \n");
     ptr_t_tc = new Thread (T_CDMS_RLY_TC);
     ptr_t_tm = new Thread (T_CDMS_RLY_TM);
     ptr_t_sc_data = new Thread (T_PL_RCV_SC_DATA);
-    
+    master.frequency(100000);
     RtosTimer TIMER_HK_ACQ(TSC_CDMS_HK_MAIN,osTimerPeriodic);
     TIMER_HK_ACQ.start(20000);
-    
+    irpt_2_slv = 1;
     pl_sc_data.rise(&ISR_PL_RCV_SC_DATA);
     cdms_rcv_tc.rise(&ISR_CDMS_RLY_TC);
     bae_tm_rcv.rise(&ISR_CDMS_RLY_TM);