FreeCalypso > hg > fc-magnetite
comparison src/cs/layer1/cust0/l1_cust.c @ 328:daddb933047d
L1 sleep logic change: allow big sleep when light is on or we are charging
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 14 Dec 2017 02:45:22 +0000 |
parents | 50a15a54801e |
children | 047fb78947d5 |
comparison
equal
deleted
inserted
replaced
327:d7b25dca1266 | 328:daddb933047d |
---|---|
270 } | 270 } |
271 else why_big_sleep = BIG_SLEEP_DUE_TO_SIM; | 271 else why_big_sleep = BIG_SLEEP_DUE_TO_SIM; |
272 #endif | 272 #endif |
273 // cut ARMIO and UWIRE clocks in big sleep | 273 // cut ARMIO and UWIRE clocks in big sleep |
274 l1s.pw_mgr.modules_status = ARMIO_CLK_CUT | UWIRE_CLK_CUT ; | 274 l1s.pw_mgr.modules_status = ARMIO_CLK_CUT | UWIRE_CLK_CUT ; |
275 return(FRAME_STOP); // BIG sleep | 275 /* |
276 * FreeCalypso change: in TI's original code, whenever | |
277 * this Cust_check_system() function returns FRAME_STOP | |
278 * instead of CLOCK_STOP, l1s_sleep_manager() would | |
279 * abstain from all sleep and not just from deep sleep. | |
280 * The comments there say that the intent is to avoid | |
281 * big sleep when there is UART or SIM activity, | |
282 * but the result is that when we tell L1 to do big sleep | |
283 * instead of deep sleep because of the backlight or | |
284 * charging, it doesn't sleep at all, except small sleep | |
285 * via Nucleus idle loop. | |
286 * | |
287 * Our change preserves TI's abstention from big sleep | |
288 * due to UART or SIM activity, but allows big sleep when | |
289 * the cause is light or charging. We've changed this | |
290 * Cust_check_system() function to return DO_NOT_SLEEP | |
291 * instead of FRAME_STOP for UART and SIM, while still | |
292 * returning FRAME_STOP for light and charging, and | |
293 * changed the code in l1s_sleep_manager() to do big sleep | |
294 * when this Cust_check_system() function returns FRAME_STOP. | |
295 */ | |
296 return(DO_NOT_SLEEP); // NO sleep | |
276 #else // Simulation part | 297 #else // Simulation part |
277 return(CLOCK_STOP); // DEEP sleep | 298 return(CLOCK_STOP); // DEEP sleep |
278 #endif | 299 #endif |
279 } | 300 } |
280 | 301 |