pcb test start

Dependencies:   mbed-rtos mbed

Fork of BAE_hw_test1_5 by sakthi priya amirtharaj

Revision:
9:7936b618a879
Parent:
8:6d856d863537
diff -r 6d856d863537 -r 7936b618a879 main.cpp
--- a/main.cpp	Wed Mar 04 18:14:01 2015 +0000
+++ b/main.cpp	Mon Apr 06 15:53:24 2015 +0000
@@ -7,6 +7,7 @@
 #include "fault.h"
 #include "slave.h"
 #include "mnm.h"
+#include "pin_config.h"
 
 Serial pc(USBTX, USBRX);
 
@@ -107,8 +108,8 @@
         printf("\n\rTHIS IS ACS   %f\n\r",t1.read());
         t.start();
         mag_field= FUNC_ACS_MAG_EXEC();                              //actual execution
-        omega = FUNC_ACS_EXEC_GYR();
-        printf("\n\r gyr 1 value %f",omega[0]);
+        //omega = FUNC_ACS_EXEC_GYR();
+        //printf("\n\r gyr 1 value %f",omega[0]);
         mnm_data=EXECUTE_PNI(); //the angular velocity is stored in the first 3 values and magnetic field values in next 3
         printf("\n\rmnm gyro values\n"); //printing the angular velocity and magnetic field values
         for(int i=0; i<3; i++) 
@@ -119,17 +120,24 @@
         for(int i=3; i<6; i++) {
         printf("%f\t",mnm_data[i]);
         }
-        for(int i = 0 ; i<3;i++)
+        /*for(int i = 0 ; i<3;i++)
         {
             omega1[i] = mnm_data[i];
         }
         for( int i = 3;i<6;i++)
         {
             mag_field1[i-3] = mnm_data[i];
-        }
+        }*/
+        acs_pflag =1;                       //to be changed later 5/4/15
+        omega1[0] = 1;
+        omega1[1] = 1;
+        omega1[2] = 1; 
+        mag_field[0] = -38;
+        mag_field[1] = 1;
+        mag_field[2] = 5; 
         if(acs_pflag == 1)
         {
-        FUNC_ACS_CNTRLALGO(mag_field1,omega1,tauc1);
+        FUNC_ACS_CNTRLALGO(mag_field,omega1,tauc1);         //mag field to be in micro tesla
         printf("\n\r control algo values ");
         for(int i=0; i<3; i++) 
         {
@@ -147,7 +155,8 @@
        
         t.reset();
     }
-}/*
+}
+/*
 void T_ACS_WRITE2FLASH(void const *args)
 {
     while(1)
@@ -404,12 +413,12 @@
     if(schedcount%1==0)
     {
      ptr_t_acs -> signal_set(0x1);
-     ptr_t_wdt -> signal_set(0x5);
+    // ptr_t_wdt -> signal_set(0x5);
     }
     if(schedcount%2==0)
     {
        // ptr_t_fault -> signal_set(0x2);
-       ptr_t_hk_acq -> signal_set(0x2);
+     //  ptr_t_hk_acq -> signal_set(0x2);
         
     }
     if(schedcount%beacon_sc==0)
@@ -417,7 +426,7 @@
         if(beac_flag==0)
         {
             
-          ptr_t_bea -> signal_set(0x3);
+       //   ptr_t_bea -> signal_set(0x3);
         }
     }
     schedcount++;
@@ -434,7 +443,7 @@
      INIT_PNI();
      
      FUNC_ACS_MAG_INIT();
-     FUNC_ACS_INIT_GYR();
+     //FUNC_ACS_INIT_GYR();
      slave.address(0x20);
 
     ptr_t_hk_acq = new Thread(T_HK_ACQ);
@@ -447,7 +456,7 @@
     //ptr_t_sc = new Thread(T_SC);
     ptr_t_wdt = new Thread(T_WDT);
   
-    interrupt_fault();
+    //interrupt_fault();
     
     //ptr_t_fault -> set_priority(osPriorityRealtime);
     ptr_t_acs->set_priority(osPriorityAboveNormal);