pradeep shekhar
/
Beacon_BAE_intergration_test_3
General testings
Fork of BEACON_CODE_NEW by
Revision 14:4d1e378ec6e5, committed 2015-10-07
- Comitter:
- shekhar
- Date:
- Wed Oct 07 04:35:16 2015 +0000
- Parent:
- 13:1c5cd2fa4b56
- Child:
- 15:c64cb19519d0
- Commit message:
- Changed the temperature settings
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 17:14:59 2015 +0000 +++ b/main.cpp Wed Oct 07 04:35:16 2015 +0000 @@ -29,7 +29,7 @@ if(BCN_TX_EN == 1) { //Measure and store BCN temperature in BCN_TS_BUFFER - BCN_TS_BUFFER = ((check_Temperature())*0.5) - 64; + BCN_TS_BUFFER = check_Temperature(); //Get BCN_HK data from BCN HW(SPI) //Store BCN_HK data in BCN_HK_BUFFER if(BCN_STANDBY == 1 ) @@ -89,16 +89,13 @@ } int check_Temperature() -{ +{ int temperature; - while((readreg(RF22_REG_0F_ADC_CONFIGURATION) && 0x80) == 0x0) - { - writereg(RF22_REG_0F_ADC_CONFIGURATION,128); //128 = 10000000 - writereg(RF22_REG_12_Temperature_Sensor_Calibration,32); //160 == 10100000 32 == 00100000 - wait(1); - temperature = readreg(RF22_REG_11_ADC_Value); - //pc.printf("Temperature: %d\r\n", temperature); - } + writereg(RF22_REG_0F_ADC_CONFIGURATION,0x80); //128 = 10000000 + writereg(RF22_REG_12_Temperature_Sensor_Calibration,0x20); //160 == 10100000 32 == 00100000 + wait(1); + temperature = readreg(RF22_REG_11_ADC_Value); + temperature = (float)temperature*0.5 - 64; return temperature; } @@ -248,11 +245,6 @@ writereg(RF22_REG_08_OPERATING_MODE2,0x01); writereg(RF22_REG_08_OPERATING_MODE2,0x00); } -void clearRxBuf() -{ - writereg(RF22_REG_08_OPERATING_MODE2,0x02); - writereg(RF22_REG_08_OPERATING_MODE2,0x00); -} int setFrequency(float centre,float afcPullInRange) { //freq setting begins @@ -304,9 +296,7 @@ writereg(RF22_REG_07_OPERATING_MODE1,0x80); //sw_reset wait(1); //takes time to reset - clearTxBuf(); - - clearRxBuf();//may not be required + clearTxBuf(); writereg(RF22_REG_07_OPERATING_MODE1,0x00); //standby mode
--- a/tx.h Mon Oct 05 17:14:59 2015 +0000 +++ b/tx.h Wed Oct 07 04:35:16 2015 +0000 @@ -22,7 +22,6 @@ uint8_t BCN_TX_EN = 1; //hardcoding for now //check where is this variable toggled?? uint8_t BCN_FEN = 0; //This variable is also toggled in P_BCN_FEN process. uint8_t BCN_STANDBY = 0; //hardcoding for now //check where is this variable toggled?? -uint8_t LOW_POWER_COUNTER; //toggled in a function uint8_t BCN_TS_BUFFER; // For Temperature //FUNCTION PROTOTYPING @@ -30,7 +29,6 @@ void P_BCN_FEN(); void P_BCN_TX_MAIN(); void Set_BCN_TX_STATUS(uint8_t STATUS); -int check_POWER_LEVEL(); int check_Temperature(); void SHORT_BCN_TX(); void LONG_BCN_TX(); @@ -38,10 +36,8 @@ void writereg(uint8_t reg,uint8_t val); uint8_t readreg(uint8_t reg); void clearTxBuf(); -void clearRxBuf(); int setFrequency(float,float); bool Check_ACK_RECEIVED(); -void INC_BCN_LOW_POWER_COUNTER(); #define RF22_MAX_MESSAGE_LEN 255