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 workinQM_5thJan_azad by
Diff: TCTM.cpp
- Revision:
- 73:d2bca4d2cc64
- Parent:
- 72:80c32b3c2e40
- Child:
- 74:2c82080db98b
--- a/TCTM.cpp Mon Dec 05 14:16:10 2016 +0000 +++ b/TCTM.cpp Wed Dec 07 13:26:01 2016 +0000 @@ -5,6 +5,7 @@ #include "crc.h" #include "EPS.h" #include "ACS.h" +#include "BCN.h" #include "pin_config.h" #include "FreescaleIAP.h" #include "inttypes.h" @@ -141,6 +142,9 @@ extern void FCTN_BCN_SPND_TX(); extern void FCTN_BCN_INIT(); +extern uint8_t readreg(uint8_t reg); +extern void writereg(uint8_t reg,uint8_t val); + //BAE extern uint8_t BAE_STANDBY; @@ -1334,7 +1338,7 @@ break; } case 0xE2: - { + { //high enable samp uint8_t BCN_SPND_STATE; BCN_SPND_STATE=tc[4]; if(BCN_SPND_STATE==0x00) @@ -1345,7 +1349,24 @@ } else if(BCN_SPND_STATE==0x01) { - FCTN_BCN_SPND_TX(); + FCTN_BCN_SPND_TX();//direct implementation of function + /*{ + //printf("BCN_SPND\n\r"); + BCN_SPND_TX = 1; + if( BCN_TX_MAIN_STATUS == 1 && BCN_TX_SW_STATUS == 1 ) + { + writereg(RF22_REG_07_OPERATING_MODE1,0x00); //standby mode + if( readreg(RF22_REG_07_OPERATING_MODE1) & 0x08 == 0x08 ) + { + BCN_SW = 0; + BCN_TX_SW_STATUS = 3; + uint32_t FLASH_DATA; + FLASH_DATA = FCTN_BAE_RD_FLASH_ENTITY(0); //updated in flash + FLASH_DATA = (FLASH_DATA | 0x00006000); + FCTN_BAE_WR_FLASH(0,FLASH_DATA); + } + }*/ + //} //BCN_SW =1; //stop BCN_STANDBY_TIMER.start();//create if(BCN_TX_MAIN_STATUS==0) @@ -1354,7 +1375,7 @@ } else if(BCN_TX_MAIN_STATUS==1) { - telemetry[2]=0xC0; + telemetry[2]=0xA0; //changed } } else @@ -1631,7 +1652,7 @@ /* ATS PIN OR STATUS YET TO BE DECIDED. DECIDED THAT IT IS PIN TC CAN SWITCH ON/OFF THE SENSOR */ - ATS2_SW_ENABLE = 1; // making sure we switch off the other + ATS2_SW_ENABLE = 0; // making sure we switch off the other //ACS_ATS_STATUS = (ACS_ATS_STATUS & 0xF3) | 0x0C ; ACS_ATS_STATUS = (ACS_ATS_STATUS & 0xF0) | 0x0C ; ATS1_SW_ENABLE = 1; // what should the signal be for unabling 0 or 1 @@ -1667,7 +1688,7 @@ telemetry[1]=tc[0]; ATS1_SW_ENABLE = 0; //make sure u switch off the other ACS_ATS_STATUS = (ACS_ATS_STATUS & 0x0F) | 0xC0 ; - ATS2_SW_ENABLE = 0; + ATS2_SW_ENABLE = 1; ACS_ATS_STATUS = (ACS_ATS_STATUS & 0xF0);//|0x04; changed here /*update in flash here*/ @@ -1819,7 +1840,7 @@ //ACK_L234_TM telemetry[0]=0xB0; telemetry[1]=tc[0]; - ATS2_SW_ENABLE = 1; + ATS2_SW_ENABLE = 0; uint32_t FLASH_DATA; FLASH_DATA = FCTN_BAE_RD_FLASH_ENTITY(0);