General testings

Dependencies:   mbed

Fork of BEACON_CODE_NEW by Mohamed Azad

Files at this revision

API Documentation at this revision

Comitter:
shekhar
Date:
Mon Oct 05 12:13:59 2015 +0000
Parent:
10:a3f890849610
Child:
12:42317138b8cc
Commit message:
removed compilation errors

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
tx.h Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Oct 05 11:51:33 2015 +0000
+++ b/main.cpp	Mon Oct 05 12:13:59 2015 +0000
@@ -1,5 +1,16 @@
 #include "tx.h"
 #include <stdio.h>
+
+//STATES
+#define BCN_RF_SILENCE 0 
+#define BCN_TX_DISABLED 1
+#define BCN_TX_STANDBY 2
+#define BCN_TX_FAILURE 3
+//#define BCN_TX_SB_SI_SUCCESS 4
+//#define BCN_TX_SB_LI_SUCCESS 5
+#define BCN_TX_SUCCESS 4
+
+
 Ticker loop;
 Serial pc(USBTX, USBRX);        //tx,rx
 SPI spi(D11, D12, D13);              // mosi, miso, sclk
@@ -31,7 +42,7 @@
             BCN_TS_BUFFER = ((check_Temperature())*0.5) - 64;
             
             //Get BCN_HK data from BCN HW(SPI) //Store BCN_HK data in BCN_HK_BUFFER
-            if(BCN_TX_STANDBY == 1 && skip_Iteration == false)
+            if(BCN_STANDBY == 1 )
             {
                 Set_BCN_TX_STATUS(BCN_TX_STANDBY);
                 BCN_TX_MAIN_STATUS = 0;
@@ -87,12 +98,6 @@
     BCN_TX_STATUS = STATUS;
 }
 
-int check_POWER_LEVEL()
-{
-    //make
-    //hardcoding for now
-    return 2;           //valid power levels - 0, 1, 2.
-}
 int check_Temperature()
 {
     int temperature;
@@ -498,16 +503,11 @@
     else
     {
         pc.printf("Packet not sent\r\n");
-        return 0;     actual value
+        return 0;     //actual value
         //return 1;       //to make this function work in any condition  //Why??
 
     }
 }
-void INC_BCN_LOW_POWER_COUNTER()
-{
-    LOW_POWER_COUNTER++;
-}
-
 int main()
 {
     //int temp, final_temp;
--- a/tx.h	Mon Oct 05 11:51:33 2015 +0000
+++ b/tx.h	Mon Oct 05 12:13:59 2015 +0000
@@ -31,10 +31,11 @@
 void P_BCN_INIT();
 void P_BCN_FEN();
 void P_BCN_TX_MAIN();
-void Set_BCN_TX_MAIN_STATE_STATUS(uint8_t STATUS);
+void Set_BCN_TX_STATUS(uint8_t STATUS);
 int check_POWER_LEVEL();
 int check_Temperature();
 void SHORT_BCN_TX();
+void LONG_BCN_TX();
 void Init_BEACON_HW();
 void writereg(uint8_t reg,uint8_t val);
 uint8_t readreg(uint8_t reg);