i2c working with new hk(no pin conflict)

Dependencies:   mbed-rtos mbed

Fork of BAE_vr2_1_4 by sakthi priya amirtharaj

Files at this revision

API Documentation at this revision

Comitter:
sakthipriya
Date:
Wed Dec 17 09:46:36 2014 +0000
Parent:
1:bd715ccef1bb
Commit message:
watchdog added

Changed in this revision

HK.cpp 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/HK.cpp	Wed Dec 17 09:18:36 2014 +0000
+++ b/HK.cpp	Wed Dec 17 09:46:36 2014 +0000
@@ -175,8 +175,7 @@
             
       }
       
-
-    
+strcpy(SensorQuantised.Voltage,"green");
     
 // The following lines are used to iterate the select lines from 0 to 4
     
--- a/main.cpp	Wed Dec 17 09:18:36 2014 +0000
+++ b/main.cpp	Wed Dec 17 09:46:36 2014 +0000
@@ -24,7 +24,7 @@
 //Thread *ptr_t_bea_telecommand;
 //Thread *ptr_t_fault;
 Thread *ptr_t_i2c;
-
+Thread *ptr_t_wdt;  
 
 
 
@@ -219,6 +219,20 @@
     }    
 }
 */
+/*-------------------------------------------------------------------------------------------------------------------------------------------
+-------------------------------------------------------WATCHDOG----------------------------------------------------------------------------*/
+DigitalOut trigger(PIN63);                                             // has to be changed
+void T_WDT(void const * args)
+{
+    trigger = 1;
+    while(true)
+    {
+        Thread::signal_wait(0x5);                               //signal set from scheduler or sthing. r RTOS timer nce the timing is finalized
+        printf("\nEntered WD\n");
+        trigger = !trigger;
+    }
+}
+
 //---------------------------------------------------------------------------------------------------------------------------------------------------
 //TASK 5 : i2c data
 //---------------------------------------------------------------------------------------------------------------------------------------------------
@@ -300,6 +314,7 @@
             }
             
     }
+            
             printf("\ndone\n\r");
 
 }
@@ -419,6 +434,7 @@
     if(schedcount%1==0)
     {
         ptr_t_acs -> signal_set(0x1);
+        ptr_t_wdt -> signal_set(0x5);
     }
     if(schedcount%2==0)
     {
@@ -451,6 +467,7 @@
     //ptr_t_fault = new Thread(T_FAULT);
     ptr_t_i2c = new Thread(C_T_I2C_BAE);
     //ptr_t_sc = new Thread(t_sc);
+    ptr_t_wdt = new Thread(T_WDT);
   
     interrupt_fault();
     
@@ -462,6 +479,7 @@
     ptr_t_bea->set_priority(osPriorityAboveNormal);
     //ptr_t_bea_telecommand->set_priority(osPriorityIdle);
     //ptr_t_sc->set_priority(osPriorityAboveNormal);
+    ptr_t_wdt -> set_priority(osPriorityIdle);
     
   
    // ----------------------------------------------------------------------------------------------