Team Fox / Mbed 2 deprecated TR_EXCITATION_TEST

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of BAE_CODE_MARCH_2017 by Team Fox

Revision:
19:79e69017c855
Parent:
18:3662058a7c10
Child:
20:949d13045431
--- a/BCN.cpp	Sat May 14 11:19:13 2016 +0000
+++ b/BCN.cpp	Sat Jun 04 11:29:13 2016 +0000
@@ -17,10 +17,18 @@
 uint8_t BCN_TX_MAIN_STATUS = 0;
 uint8_t BCN_TX_STATUS = 0;
 uint8_t BCN_TX_EN = 1;              //hardcoding for now    //check where is this variable toggled??
-uint8_t BCN_FEN = 0;                //hardcoding for now    //write this value to flash
+uint8_t BCN_FEN = 0;                //hardcoding for now    //write this value to flash // CHANGED WILL BE UPDATED AUTOMATICALLY
 uint8_t BCN_STANDBY = 0;            //hardcoding for now    //check where is this variable toggled??
 uint8_t BCN_TS_BUFFER = 0;              // For Temperature 
 
+/*for long bcn */
+uint8_t *L_BCN=NULL;
+/*see if this works.!? else see uint8_t L_BCN[125] its kind of buffer */
+
+/*acquiring data for short beacon*/
+/*try using a new convertion algo if quant data doesn't work having presion of +- 0.2 from float to 4 bit made in some other file*/
+//extern BAE_HK_actual actual_data;
+
 void FCTN_BCN_INIT()
 {
     pc_bcn.printf("FCTN_BCN_INIT\n");
@@ -29,7 +37,7 @@
 ///        rf_sl_timeout.attach(&FCTN_BCN_FEN, 70);//actually 30 \\ so basically not able to call the interrupt .!! is it so?
 ///     FCTN_BCN_FEN(); 
 
-    Init_BEACON_HW();
+    //Init_BEACON_HW();
     BCN_INIT_STATUS = 0;
 }
 void FCTN_BCN_FEN(void const *args)
@@ -100,6 +108,13 @@
     BCN_TX_STATUS = STATUS;
 }
 
+void LONG_BCN_DATA(uint8_t* l_bcn)//azad to send the modified code
+{
+    /*check if this works.!! if so so then send it to long beacon tx*/
+    L_BCN=l_bcn;
+    //edit this item to keep an array maybe by creating a global array or some thing smarter
+}
+
 uint8_t check_Temperature()
 {   
     uint8_t temperature;
@@ -131,8 +146,23 @@
         uint8_t SubsystemStatus[1];
         uint8_t Temp[3];
         uint8_t ErrorFlag[1];
+/*   
+        uint8_t callsign[7];
+        uint8_t bat_v_+_solar_ccurr;
+        uint8_t omega_+_bootcountet;
+        uint8_t bae_batt_temp;
+        uint8_t comm_rec_trans_vol;
+        uint8_t combi;//combination
+        uint8_t crc;
+*/     
     }Shortbeacon = { {0x88}, {0x99, 0xAA} , {0xAA},{0xAA,0xDD,0xEE}, {0x00} };
     
+    /* acquiring data
+          
+    
+    */
+    
+    
     //filling hk data
     //uint8_t short_beacon[] = { 0xAB, 0x8A, 0xE2, 0xBB, 0xB8, 0xA2, 0x8E,Shortbeacon.Voltage[0],Shortbeacon.AngularSpeed[0], Shortbeacon.AngularSpeed[1],Shortbeacon.SubsystemStatus[0],Shortbeacon.Temp[0],Shortbeacon.Temp[1],Shortbeacon.Temp[2],Shortbeacon.ErrorFlag[0]};
     uint8_t short_beacon[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,Shortbeacon.Voltage[0],Shortbeacon.AngularSpeed[0], Shortbeacon.AngularSpeed[1],Shortbeacon.SubsystemStatus[0],Shortbeacon.Temp[0],Shortbeacon.Temp[1],Shortbeacon.Temp[2],Shortbeacon.ErrorFlag[0]};
@@ -195,9 +225,11 @@
     //get long_beacon array
     
     uint8_t Long_beacon[125];
-    for(int i = 0;i<125;)
+    for(int i = 0;i<125;i++)
     {
-        Long_beacon[i++] = 0xAA;
+        Long_beacon[i] = 0xAA;
+        /*changed*/
+        //Long_beacon[i++]=L_BCN[i]; //should work if not then see the problem
     }
    
    
@@ -237,7 +269,7 @@
     //Check for packetsent interrupt
     while(timeout_count--)if((readreg(RF22_REG_03_INTERRUPT_STATUS1) & 0x04) == 0x04)break;
          
-    //pc_bcn.printf("Long packet sent\r\n");
+    pc_bcn.printf("Long packet sent\r\n");
     
     writereg(RF22_REG_07_OPERATING_MODE1,0x00);        //standby mode
 }