comparison src/cs/services/vibr/vibr_task.c @ 294:e17bdedfbf2b

VIBR SWE initial implementation
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 27 Mar 2022 08:46:10 +0000
parents
children
comparison
equal deleted inserted replaced
293:2d7d95e7f9c2 294:e17bdedfbf2b
1 /*
2 * Our VIBR task's core function lives here.
3 */
4
5 #include "vibr/vibr_env.h"
6 #include "vibr/vibr_func_i.h"
7 #include "rv/rv_general.h"
8 #include "rvf/rvf_api.h"
9 #include "rvm/rvm_use_id_list.h"
10
11 T_RV_RET vibr_core(void)
12 {
13 BOOLEAN error_occured = FALSE;
14 T_RV_HDR *msg_ptr;
15
16 /* loop to process messages */
17 while (error_occured == FALSE)
18 {
19 /* Wait for the necessary events (infinite wait for a msg in the mailbox 0). */
20 UINT16 received_event = rvf_wait (0xffff, 0);
21
22 /* If an event related to mailbox 0 is received, then */
23 if (received_event & RVF_TASK_MBOX_0_EVT_MASK)
24 {
25 /* Read the message in the driver mailbox and delegate action..*/
26 msg_ptr = (T_RV_HDR *) rvf_read_mbox(VIBR_MAILBOX);
27 if (msg_ptr) {
28 vibr_process_message(msg_ptr);
29 rvf_free_buf ((void *) msg_ptr);
30 }
31 }
32
33 /* Timers */
34 if (received_event & RVF_TIMER_0_EVT_MASK)
35 vibr_handle_timer();
36
37 } // end of while
38 return RV_OK;
39 }