FreeCalypso > hg > fc-tourmaline
comparison src/cs/services/buzm/buzm_task.c @ 297:8dfdf88d632f
BUZM SWE initial implementation
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 29 Mar 2022 03:45:41 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
296:a927f030a4e0 | 297:8dfdf88d632f |
---|---|
1 /* | |
2 * Our BUZM task's core function lives here. | |
3 */ | |
4 | |
5 #include "buzm/buzm_env.h" | |
6 #include "buzm/buzm_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 buzm_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(BUZM_MAILBOX); | |
27 if (msg_ptr) { | |
28 buzm_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 buzm_handle_timer(); | |
36 | |
37 } // end of while | |
38 return RV_OK; | |
39 } |