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.
Fork of TFOX_CDMS_VR_1_0_WORKING by
power.cpp
- Committer:
- sakthipriya
- Date:
- 2015-06-17
- Revision:
- 8:f3b50b921414
File content as of revision 8:f3b50b921414:
#include "pin_config.h" #define COMM_TX_EN_PIN PIN64 //COMM receiver enable #define PYLD_EN_PIN PIN73 // Payload switch enable DigitalOut COMM_TX_EN(COMM_TX_EN_PIN); //assuming active high DigitalOut PYLD_EN(PYLD_EN_PIN); //assuming active high void FCTN_POWER_MODE(int SOC) //flag corresponds to the power mode { printf("Entered Power Management \n"); printf("Battery Level %d \n",SOC); // range of battery level is dummy. yet to be fixed else if(SOC>=85) { COMM_TX_EN = 1; //high power mode : everything is on PYLD_EN = 1; } else if(SOC<85 && SOC>=70) { COMM_TX_EN = 1; //COMM TX is on PYLD_EN = 1; //payload switch enable } else if(SOC<55 && SOC>=70) { COMM_TX_EN = 1; //COMM TX is off PYLD_EN = 0; //payload switch disable } else if(SOC<40 && SOC>=55) { COMM_TX_EN = 1; //COMM TX is off PYLD_EN = 0; //payload switch disable } }