Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FreescaleIAP mbed-rtos mbed
Fork of BAE_CODE_MARCH_2017 by
Diff: BCN.cpp
- Revision:
- 73:d2bca4d2cc64
- Parent:
- 66:a5d2b8dc6b9e
- Child:
- 74:2c82080db98b
--- a/BCN.cpp Mon Dec 05 14:16:10 2016 +0000 +++ b/BCN.cpp Wed Dec 07 13:26:01 2016 +0000 @@ -14,7 +14,7 @@ extern BAE_HK_actual actual_data; -DigitalOut bcn_sw(PIN14,0); +//DigitalOut bcn_sw(PIN14,0); Serial pc_bcn(USBTX, USBRX); //tx,rx //see if it creates a problem //SPI spi(D11, D12, D13); // mosi, miso, sclk //DigitalOut cs(D10); //slave select or chip select @@ -285,8 +285,10 @@ uint8_t zerobyte[4] = {0x7E,0x59,0x41,0xB1}; for (byte_counter = 0; byte_counter <15 ; byte_counter++) { + if(BCN_SPND_TX == 1) continue; //changed for(int j = 7; j >= 0 ; j--) { + if(BCN_SPND_TX == 1) continue; //changed cs = 0; spi.write(0xFF); if((SHORT_HK_data[byte_counter] & (uint8_t) pow(2.0,j))!= pow(2.0,j)) @@ -336,10 +338,19 @@ //Check for fifoThresh if(byte_counter > 0) + if(BCN_SPND_TX != 1) //Check for flag update by COM { wait_ms(25); while( timeout_count --)if((readreg(RF22_REG_03_INTERRUPT_STATUS1) & 0x20) == 0x20)break;else if(timeout_count == 1) reset_rfm(1); { + wait_ms(25); + while( timeout_count --)if((readreg(RF22_REG_03_INTERRUPT_STATUS1) & 0x20) == 0x20)break;else if(timeout_count == 1) reset_rfm(1); + { + //pc_bcn.printf("w_f_empty\n"); + //reset_rfm(1); + } + timeout_count = 10e5; + //pc_bcn.printf("w_f_empty\n"); //reset_rfm(1); } @@ -356,6 +367,7 @@ for(byte_counter = 15;byte_counter<149;byte_counter++) { + if(BCN_SPND_TX == 1) continue; cs = 0; spi.write(0xFF); spi.write(LONG_HK_data[BCN_LONG_MSG_TYPE][byte_counter-15]); @@ -374,12 +386,22 @@ } wait_ms(70); //Check for fifoThresh + while(timeout_count--) + if((readreg(RF22_REG_03_INTERRUPT_STATUS1) & 0x40) == 0x00) break; + else if(timeout_count == 1) + if(BCN_SPND_TX != 1) reset_rfm(1); + while(timeout_count--)if((readreg(RF22_REG_03_INTERRUPT_STATUS1) & 0x40) == 0x00)break;else if(timeout_count == 1) reset_rfm(1); { pc_bcn.printf("Waiting for fifo to empty\r\n"); } //Check for packetsent interrupt + while(timeout_count--) + if((readreg(RF22_REG_03_INTERRUPT_STATUS1) & 0x04) == 0x04) break; + else if(timeout_count == 1) + if(BCN_SPND_TX != 1) reset_rfm(1); + while(timeout_count--)if((readreg(RF22_REG_03_INTERRUPT_STATUS1) & 0x04) == 0x04)break;else if(timeout_count == 1) reset_rfm(1); //pc_bcn.printf("Short packet sent, bytes written = %d\r\n",byte_count); @@ -658,8 +680,7 @@ while(1); } -*/ - +/* to write in flash function moved to TCTM*/ void FCTN_BCN_SPND_TX() { printf("BCN_SPND\n\r"); @@ -674,4 +695,3 @@ } } } - \ No newline at end of file