# HG changeset patch # User Mychaela Falconia # Date 1513365202 0 # Node ID e0b27310e6ba4fefbf537364a919307b2a116b86 # Parent a9743c1dbe58cf6707f2a354fa7a65a084458c54 l1_cust.c: big sleep when charging with FCHG diff -r a9743c1dbe58 -r e0b27310e6ba src/cs/layer1/cust0/l1_cust.c --- a/src/cs/layer1/cust0/l1_cust.c Fri Dec 15 19:02:09 2017 +0000 +++ b/src/cs/layer1/cust0/l1_cust.c Fri Dec 15 19:13:22 2017 +0000 @@ -83,6 +83,11 @@ #include "l1_rf2.c" #endif +#include "rv/rv_defined_swe.h" // for RVM_FCHG_SWE +#ifdef RVM_FCHG_SWE + #include "fchg/fchg_struct.h" +#endif + // Nucleus functions extern INT TMD_Timer_State; extern UWORD32 TMD_Timer; // for big sleep @@ -246,9 +251,26 @@ UWORD8 Cust_check_system(void) { extern UWORD8 why_big_sleep; +#ifdef RVM_FCHG_SWE + extern T_PWR_CTRL_BLOCK *pwr_ctrl; +#endif + #if (CODE_VERSION != SIMULATION) #if (L2_L3_SIMUL == 0) - // Forbid deep sleep if the light is on + +#ifdef RVM_FCHG_SWE + // Forbig deep sleep when charging + if (pwr_ctrl && pwr_ctrl->state >= FCHG_STATE_I2V_CAL_1 && + pwr_ctrl->state <= FCHG_STATE_CV_CHARGING) + { + //cut ARMIO and UWIRE clocks in big sleep + l1s.pw_mgr.modules_status = ARMIO_CLK_CUT | UWIRE_CLK_CUT ; + why_big_sleep = BIG_SLEEP_DUE_TO_CHARGING; + return(FRAME_STOP); // BIG sleep + } +#endif + + // Forbid deep sleep if the light is on if(LT_Status()) { //cut ARMIO and UWIRE clocks in big sleep @@ -257,7 +279,7 @@ return(FRAME_STOP); // BIG sleep } - // Forbid deep sleep if the SIM and UARTs not ready + // Forbid deep sleep if the SIM and UARTs not ready if(SIM_SleepStatus()) { #endif