working version
Dependencies: mbed mbed-rtos SimpleDMA FreescaleIAP eeprom
Fork of CDMS_CODE_FM_28JAN2017 by
Revision 318:978d72f191f9, committed 2016-12-08
- Comitter:
- ee12b079
- Date:
- Thu Dec 08 13:12:34 2016 +0000
- Parent:
- 317:31bb2e9eda85
- Child:
- 319:c11a52b91d25
- Commit message:
- adf_temp, tc_curr, pa_hot
Changed in this revision
--- a/DefinitionsAndGlobals.h Thu Dec 08 07:12:16 2016 +0000 +++ b/DefinitionsAndGlobals.h Thu Dec 08 13:12:34 2016 +0000 @@ -268,6 +268,8 @@ bool BAE_HK_I2C; uint8_t RTC_STATUS; float RSSI_volatge; +uint8_t COM_ADF_TMP = 0; +uint8_t COM_PA_IC_TMP = 0; CDMS_HK_actual actual_data; CDMS_HK_quant quant_data; @@ -353,6 +355,7 @@ uint8_t COM_RX_STATUS; uint8_t CDMS_RTC_BL; + //CDMS FLASH parameters uint8_t EPS_V_A_EN_STATUS;
--- 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();\
--- a/common_functions.h Thu Dec 08 07:12:16 2016 +0000
+++ b/common_functions.h Thu Dec 08 13:12:34 2016 +0000
@@ -155,14 +155,13 @@
#define isPAhot(returnHere){\
uint8_t pa_temp = 0;\
- uint8_t pa_temp_quant = 0;\
SelectLinec0=0;\
SelectLinec1=0;\
SelectLinec2=0;\
SelectLinec3=1;\
pa_temp = TempInput.read();\
pa_temp = pa_temp * 3.3;\
- int resistance;\
+ float resistance;\
resistance = 24000 * pa_temp/(3.3 - pa_temp);\
if(pa_temp > 1.47) {\
pa_temp = 3694/log(24.032242*resistance);\
@@ -170,9 +169,11 @@
else{\
pa_temp = 3365.4/log(7.60573*resistance);\
}\
- pa_temp_quant = quantiz(tstart_thermistor,tstep_thermistor,pa_temp);\
- pa_temp_quant = 0;\
- if (pa_temp_quant > COM_PA_TMP_HIGH){\
+ COM_PA_IC_TMP = quantiz(tstart_thermistor,tstep_thermistor,pa_temp);\
+ /*comment this ater*/\
+ COM_PA_IC_TMP = 0;\
+ /*COM_PA_TMP_HIGH to be found*/\
+ if (COM_PA_IC_TMP > COM_PA_TMP_HIGH){\
returnHere = 0xFF;\
gPC.puts("PA is measured HOT\r\n");\
}\
