I2C BAE standalone hardware testing

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of ACS_Flowchart_BAE_1 by Team Fox

Revision:
14:a9588f443f1a
Parent:
13:fb7facaf308b
Child:
15:e09aaaccf134
diff -r fb7facaf308b -r a9588f443f1a main.cpp
--- a/main.cpp	Wed Apr 13 21:48:21 2016 +0000
+++ b/main.cpp	Thu Apr 14 09:34:06 2016 +0000
@@ -90,14 +90,14 @@
 bool pf1check = 0;
 bool pf2check = 0;
 bool if1check = 0;
-bool if2check = 1;
+bool if2check = 0;
 
 //*****************************************************Assigning pins******************************************************//
 DigitalOut ATS1_SW_ENABLE(PTC0); // enable of att sens2 switch
 DigitalOut ATS2_SW_ENABLE(PTC16); // enable of att sens switch
 InterruptIn irpt_4m_mstr(PIN38);                                      //I2c interrupt from CDMS
 DigitalOut irpt_2_mstr(PIN4);                                        //I2C interrupt to CDMS
-I2CSlave slave (PIN1,PIN2);
+I2CSlave slave (PIN1,PIN2);///pin1 pin2
 DigitalOut batt_heat(PIN96);
 
 //ATS1_SW_ENABLE = 0;
@@ -112,7 +112,7 @@
 DigitalIn pf3(PIN83);//Fault Bar for TRXY driver
  
 //Interrupt based faults
-InterruptIn  ir1(PIN73);//Battery Gauge - Alert Bar Signal
+//InterruptIn  ir1(PIN73);//Battery Gauge - Alert Bar Signal
 InterruptIn  ir2(PIN72);//TRXY Driver TR switch Fault
 InterruptIn  ir3(PIN89);//TRZ Driver Fault Bar
 InterruptIn  ir4(PIN91);//TRZ Driver TR switch Fault
@@ -120,6 +120,7 @@
 InterruptIn  ir6(PIN80);//Beacon- Switch OC bar
 InterruptIn  ir7(PIN42);//Charger IC - Fault Bar
 
+
 //DigitalOut TRXY_SW_EN(PIN71);  //TR XY Switch
 //DigitalOut DRV_Z_SLP(PIN88);    //Sleep pin of driver z
 //DigitalOut TRZ_SW(PIN40);  //TR Z Switch
@@ -581,6 +582,7 @@
     {
         actual_data.faultIr_status &=0xFE;
     }*/
+   
     if (ir2==1)
     {
         actual_data.faultIr_status &=0xFD;
@@ -604,6 +606,7 @@
     {
         actual_data.faultIr_status &=0xBF;
     }
+    
  
 }
   
@@ -621,15 +624,17 @@
         schedcount = 1;
     }
     if(schedcount%1==0)
-    {
-       //F_ACS();
+    { pc.printf("\nSTATE IS !!!!!! = %x !!\n",ACS_STATE);
+      pc.printf("\niterp1 !!!!!! = %x !!\n",iterP1);
+      pc.printf("\niteri2 IS !!!!!! = %x !!\n",iterI2);
+       F_ACS();
     }
     
     if(schedcount%2==0)
     {
     //    F_EPS();
     }
-    if(schedcount%3==0)
+    if(schedcount%1==0)
     { 
        F_BCN();
     }
@@ -766,7 +771,7 @@
     //............................//
     FCTN_ACS_INIT();
    // FCTN_EPS_INIT();
-    FCTN_BCN_INIT();
+    //FCTN_BCN_INIT();
 
     
     FLAG();
@@ -776,7 +781,7 @@
 {
     pc.printf("\n\r BAE Activated. Testing Version 1.1 \n");
     CDMS_RESET = 1;  
-   /* if (BCN_FEN == 0)                       //dummy implementation
+    /*if (BCN_FEN == 0)                       //dummy implementation
     {
         pc.printf("\n\r RF silence ");
         FCTN_BCN_FEN();
@@ -805,12 +810,14 @@
     irpt_4m_mstr.enable_irq();
     irpt_4m_mstr.rise(&FCTN_I2C_ISR);
    // ir1.fall(&ir1clear);   //Battery Gauge - Alert Bar Signal
-    //ir2.fall(&ir2clear);   //TRXY Driver TR switch Fault
-    //ir3.fall(&ir3clear);   //TRZ Driver Fault Bar
-    //ir4.fall(&ir4clear);   //TRZ Driver TR switch Fault
-    //ir5.fall(&ir5clear);   //CDMS - Switch Fault
-    //ir6.fall(&ir6clear);   //Beacon- Switch OC bar
-    //ir7.fall(&ir7clear);   //Charger IC - Fault Bar
+ /*   ir2.fall(&ir2clear);   //TRXY Driver TR switch Fault
+    ir3.fall(&ir3clear);   //TRZ Driver Fault Bar
+    ir4.fall(&ir4clear);   //TRZ Driver TR switch Fault
+    ir5.fall(&ir5clear);   //CDMS - Switch Fault
+    ir6.fall(&ir6clear);   //Beacon- Switch OC bar
+    ir7.fall(&ir7clear);   //Charger IC - Fault Bar
+    
+    */
     RtosTimer t_sc_timer(T_SC,osTimerPeriodic);               // Initiating the scheduler thread
     t_sc_timer.start(10000);
     t_start.start();