To fix the hang problem

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Revision:
318:978d72f191f9
Parent:
317:31bb2e9eda85
Child:
321:42bdefc37270
--- a/adf.h	Thu Dec 08 07:12:16 2016 +0000
+++ b/adf.h	Thu Dec 08 13:12:34 2016 +0000
@@ -29,15 +29,7 @@
 bool hw_reset_flag = false;
 uint8_t firstbyte;
 uint8_t secondbyte;
-//int initialise_card();
-//int disk_initialize();
-//------------------------------------------------------------------------
-// state checking functions
-//bool assrt_phy_off( int, int, int);
-//bool assrt_phy_on( int,int,int);
-//bool assrt_phy_tx(int,int,int);
 
-uint8_t adf_temp = 0x00;
 //ADF temperature reading
 #define temp_correction_value 0
 
@@ -236,7 +228,7 @@
     wait_ms(10);\
     }\
 
-void get_temp(){
+void get_temp_and_txcurr(){
 /*ADF Temperature reading*/;
                 gCS_ADF=0;
                 spi.write(0x1B);
@@ -274,12 +266,13 @@
                 spi.write(0xFF);
                 secondbyte = spi.write(0xFF);
                 gCS_ADF=1;
-                adf_temp = firstbyte<<6;
-                adf_temp += secondbyte;
-                adf_temp = (adf_temp/1.83) - 118.43 + temp_correction_value;
-                sum_temp+=adf_temp;
+                COM_ADF_TMP = firstbyte<<6;
+                COM_ADF_TMP += secondbyte;
+                COM_ADF_TMP = (COM_ADF_TMP/1.83) - 118.43 + temp_correction_value;
+                sum_temp+=COM_ADF_TMP;
                 }
-                adf_temp = sum_temp/10;
+                COM_ADF_TMP = sum_temp/10;
+                uint8_t txcurr = (3.3*COM_TX_OC_FAULT)/(0.05)*100;
     }
 
 bool hardware_reset(int bcn_call)
@@ -473,7 +466,7 @@
                 T.reset();\
                 T.start();\
                 /*ADF Temperature reading*/;\
-                get_temp();\
+                get_temp_and_txcurr();\
             } else {\
                 T.stop();\
                 T.reset();\