comparison src/cs/drivers/drv_app/kpd/kpd_task.c @ 0:4e78acac3d88

src/{condat,cs,gpf,nucleus}: import from Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:23:26 +0000
parents
children 82665effff30
comparison
equal deleted inserted replaced
-1:000000000000 0:4e78acac3d88
1 /**
2 * @file kpd_task.c
3 *
4 * Coding of the main keypad function : kpd_core
5 * This function loop in the process message function for waiting messages.
6 *
7 * @author Laurent Sollier (l-sollier@ti.com)
8 * @version 0.1
9 */
10
11 /*
12 * History:
13 *
14 * Date Author Modification
15 * ----------------------------------------
16 * 10/10/2001 L Sollier Create
17 *
18 *
19 * (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved
20 */
21
22 #include "kpd/kpd_env.h"
23 #include "kpd/kpd_i.h"
24
25 #include "rv/rv_general.h"
26 #include "rvf/rvf_api.h"
27 #include "rvm/rvm_use_id_list.h"
28
29
30 /* External declaration until Riviera 1.6 is available*/
31 extern T_RV_RET kpd_handle_msg(T_RV_HDR* msg_p);
32 extern T_RV_RET kpd_handle_timer(UINT8 timer_num);
33
34
35
36 /**
37 * @name Functions implementation
38 *
39 */
40 /*@{*/
41
42 /**
43 * function: kpd_core
44 */
45 T_RV_RET kpd_core(void)
46 {
47 BOOLEAN error_occured = FALSE;
48 T_RV_HDR* msg_p;
49 UINT16 received_event;
50
51 KPD_SEND_TRACE("KPD: Initialization", RV_TRACE_LEVEL_DEBUG_HIGH);
52
53 /* loop to process messages */
54 while (error_occured == FALSE)
55 {
56 /* Wait for the necessary events. */
57 received_event = rvf_wait ( 0xffff,0);
58
59 if (received_event & RVF_TASK_MBOX_0_EVT_MASK)
60 {
61 /* Read the message */
62 msg_p = (T_RV_HDR*) rvf_read_mbox( KPD_MAILBOX_USED);
63
64 kpd_handle_msg(msg_p);
65 }
66
67 if (received_event & RVF_TIMER_0_EVT_MASK)
68 {
69 kpd_handle_timer(RVF_TIMER_0);
70 }
71
72 if (received_event & RVF_TIMER_1_EVT_MASK)
73 {
74 kpd_handle_timer(RVF_TIMER_1);
75 }
76 if (received_event & RVF_TIMER_2_EVT_MASK)
77 {
78 kpd_handle_timer(RVF_TIMER_2);
79 }
80 if (received_event & RVF_TIMER_3_EVT_MASK)
81 {
82 kpd_handle_timer(RVF_TIMER_3);
83 }
84
85 }
86
87 return RV_OK;
88 }