comparison src/cs/services/fcbm/fcbm_display_ctrl.c @ 230:baa738eeb842

FCBM code implemented in first pass
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 01 May 2021 10:05:53 +0000
parents
children 35474f3a1782
comparison
equal deleted inserted replaced
229:7ec0ae23ce76 230:baa738eeb842
1 /*
2 * In this module we are going to implement our functions
3 * for controlling display on/off state during charging boot mode.
4 */
5
6 #include "rv/rv_general.h"
7 #include "rvf/rvf_api.h"
8 #include "rvm/rvm_use_id_list.h"
9 #include "fcbm/fcbm_func_i.h"
10 #include "fcbm/fcbm_timer_i.h"
11 #include "fcbm/fcbm_life_cycle.h"
12 #include "kpd/kpd_api.h"
13 #include "r2d/r2d_blrr_api.h"
14
15 void fcbm_display_off_timer(void)
16 {
17 if (fcbm_life_cycle_state != FCBM_STATE_ACTIVE) {
18 rvf_send_trace("FCBM display off timer in wrong state", 37,
19 fcbm_life_cycle_state, RV_TRACE_LEVEL_WARNING,
20 FCBM_USE_ID);
21 return;
22 }
23 blrr_display_ctrl(BLRR_DISPLAY_OFF);
24 }
25
26 void fcbm_process_kpd_msg(T_KPD_KEY_EVENT_MSG *msg)
27 {
28 if (fcbm_life_cycle_state != FCBM_STATE_ACTIVE) {
29 rvf_send_trace("FCBM keypad message in wrong state", 34,
30 fcbm_life_cycle_state, RV_TRACE_LEVEL_WARNING,
31 FCBM_USE_ID);
32 return;
33 }
34 switch (msg->key_info.state) {
35 case KPD_KEY_PRESSED:
36 blrr_display_ctrl(BLRR_DISPLAY_CHG_BOOT);
37 return;
38 case KPD_KEY_RELEASED:
39 rvf_start_timer(FCBM_TIMER_DSPL_OFF,
40 RVF_SECS_TO_TICKS(FCBM_DISPLAY_SECS), FALSE);
41 return;
42 }
43 }