pradeep shekhar
/
Beacon_BAE_intergration_test_3
General testings
Fork of BEACON_CODE_NEW by
Revision 13:1c5cd2fa4b56, committed 2015-10-05
- Comitter:
- shekhar
- Date:
- Mon Oct 05 17:14:59 2015 +0000
- Parent:
- 12:42317138b8cc
- Child:
- 14:4d1e378ec6e5
- Commit message:
- Standby mode added.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Oct 05 13:42:38 2015 +0000 +++ b/main.cpp Mon Oct 05 17:14:59 2015 +0000 @@ -117,7 +117,6 @@ wait(0.02); // pl. update this value or even avoid it!!! int i=0; //extract values from short_beacon[] - uint8_t byte_counter = 0; struct Short_beacon { uint8_t Voltage[1]; @@ -142,7 +141,7 @@ cs = 0; spi.write(0xFF); - for (int byte_counter = 0; byte_counter <15 ; i++) + for (int byte_counter = 0; byte_counter <15 ; byte_counter++) { for(int j = 3; j >= 0 ; j--) { @@ -179,6 +178,9 @@ while((readreg(RF22_REG_03_INTERRUPT_STATUS1) & 0x04) != 0x04); //pc.printf(" chk pkt sent!\r\n"); pc.printf("Short packet sent\r\n"); + + writereg(RF22_REG_07_OPERATING_MODE1,0x00); //standby mode + } void LONG_BCN_TX() { @@ -186,9 +188,7 @@ writereg(RF22_REG_6F_TX_DATA_RATE,0xea); writereg(RF22_REG_3E_PACKET_LENGTH,LONG_TX_DATA); //long packet length wait(0.02); // pl. update this value or even avoid it!!! - int i=0; //extract values from long_beacon[] - uint8_t byte_counter = 0; //uint8_t Long_beacon[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,Longbeacon.Voltage[0],Longbeacon.AngularSpeed[0], Longbeacon.AngularSpeed[1],Longbeacon.SubsystemStatus[0],Longbeacon.Temp[0],Longbeacon.Temp[1],Longbeacon.Temp[2],Longbeacon.ErrorFlag[0]}; @@ -232,6 +232,7 @@ while((readreg(RF22_REG_03_INTERRUPT_STATUS1) & 0x04) != 0x04); //pc.printf(" chk pkt sent!]\r\n"); pc.printf("Long packet sent\r\n"); + writereg(RF22_REG_07_OPERATING_MODE1,0x00); //standby mode } void writereg(uint8_t reg,uint8_t val) @@ -307,6 +308,8 @@ clearRxBuf();//may not be required + writereg(RF22_REG_07_OPERATING_MODE1,0x00); //standby mode + //txfifoalmostempty writereg(RF22_REG_7D_TX_FIFO_CONTROL2,10); @@ -391,19 +394,12 @@ t.start(); - while (t.read() < RF_SILENCE_TIME); - //{ //transmission won't start until 5 seconds //change made: temp check during RF Silence window - //temp = check_Temperature(); - //final_temp = (float)temp*0.5 - 64; - //pc.printf("Temperature: %d\r\n", final_temp); - //wait(900); //15 minutes - //} - P_BCN_FEN(); - pc.printf("Entering BCN_TX_MAIN\r\n"); - loop.attach(&P_BCN_TX_MAIN, 30.0); - pc.printf("Exited Main Successfully :) \r\n"); + while (t.read() < RF_SILENCE_TIME); + + P_BCN_FEN(); + t.stop(); // temp = check_Temperature(); // final_temp = (float)temp*0.5 - 64; @@ -427,6 +423,5 @@ //BCN_FEN //BCN_STANDBY } - return 1; } \ No newline at end of file