comparison src/cs/services/fcbm/fcbm_task.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
comparison
equal deleted inserted replaced
229:7ec0ae23ce76 230:baa738eeb842
1 /*
2 * The FCBM task's core function lives here.
3 */
4
5 #include "fcbm/fcbm_env.h"
6 #include "fcbm/fcbm_func_i.h"
7 #include "fcbm/fcbm_timer_i.h"
8 #include "fcbm/fcbm_life_cycle.h"
9 #include "rv/rv_general.h"
10 #include "rvf/rvf_api.h"
11 #include "rvm/rvm_use_id_list.h"
12
13 enum fcbm_life_cycle_state fcbm_life_cycle_state;
14
15 T_RV_RET fcbm_core(void)
16 {
17 BOOLEAN error_occured = FALSE;
18 T_RV_HDR *msg_ptr;
19
20 /* loop to process messages */
21 while (error_occured == FALSE)
22 {
23 /* Wait for the necessary events (infinite wait for a msg in the mailbox 0). */
24 UINT16 received_event = rvf_wait (0xffff, 0);
25
26 /* If an event related to mailbox 0 is received, then */
27 if (received_event & RVF_TASK_MBOX_0_EVT_MASK)
28 {
29 /* Read the message in the driver mailbox and delegate action..*/
30 msg_ptr = (T_RV_HDR *) rvf_read_mbox(FCBM_MAILBOX);
31 if (msg_ptr) {
32 fcbm_process_message(msg_ptr);
33 rvf_free_buf ((void *) msg_ptr);
34 }
35 }
36
37 /* Timers */
38 if (received_event & RVF_TIMER_0_EVT_MASK)
39 fcbm_chg_periodic_timer();
40 if (received_event & RVF_TIMER_1_EVT_MASK)
41 fcbm_display_off_timer();
42
43 } // end of while
44 return RV_OK;
45 }