comparison src/cs/drivers/drv_app/r2d/r2d_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 777698cf6583
comparison
equal deleted inserted replaced
-1:000000000000 0:4e78acac3d88
1 /**
2
3 @file: r2d_task.c
4
5 @author Christophe Favergeon
6
7 @version 0.5
8
9 Purpose: Refresh task for R2D. It is calling the LCD dependent refresh subroutine
10
11 */
12
13 /*
14
15 Date Modification
16 ------------------------------------
17 06/02/2001 Create
18 10/18/2001 Version 0.5 for first integration with Riviera database
19
20
21 (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved
22 */
23
24
25
26
27 #include "rv/general.h"
28 #include "rvf/rvf_api.h"
29 #include "rvm/rvm_api.h"
30 #include "rvm/rvm_use_id_list.h"
31 #include "r2d/r2d_messages.h"
32 #include "r2d/r2d_env.h"
33 #include "r2d/r2d_config.h"
34 #include "r2d/r2d.h"
35 #include "r2d/r2d_i.h"
36
37 extern void r2d_refresh(void);
38
39 extern INT16 r2d_g_refresh_disabled;
40
41 /* FreeCalypso addition */
42 int r2d_is_running;
43
44 /*******************************************************************************
45 ** Function r2d_core
46 **
47 ** Description Core of the r2d task, which refresh the LCD
48 **
49 *******************************************************************************/
50 T_RVM_RETURN r2d_core(void)
51 {
52 BOOLEAN error_occured = FALSE;
53 // T_R2D_EVT * msg_ptr_rx, * msg_ptr_tx;
54
55 //r2d_start();
56
57 rvf_send_trace("R2D REFRESH TASK STARTED", 24, NULL_PARAM,
58 RV_TRACE_LEVEL_DEBUG_HIGH, R2D_USE_ID);
59 #ifdef CONFIG_TARGET_LUNA
60 r2d_refresh_task_secondary_init();
61 rvf_send_trace("R2D secondary init complete", 27, NULL_PARAM,
62 RV_TRACE_LEVEL_DEBUG_HIGH, R2D_USE_ID);
63 #endif
64 r2d_is_running = 1;
65
66 /* loop to process messages */
67 while (error_occured == FALSE)
68 {
69 UINT16 received_event;
70 //rvf_send_trace("WAIT EVENT",strlen("WAIT EVENT"), NULL_PARAM,
71 // RV_TRACE_LEVEL_DEBUG_HIGH, TRACE_XXX );
72 /* Wait for the necessary events (infinite wait for a msg in the mailbox 0). */
73 received_event = rvf_wait ( EVENT_MASK(RVF_APPL_EVT_0), 0);
74
75 //rvf_send_trace("EVENT RECEIVED",strlen("EVENT RECEIVED"), NULL_PARAM,
76 // RV_TRACE_LEVEL_DEBUG_HIGH, TRACE_XXX );
77
78 /* If an event related to mailbox 0 is received, then */
79 if (received_event & EVENT_MASK(RVF_APPL_EVT_0) )
80 {
81 //rvf_send_trace("GOOD EVENT",strlen("GOOD EVENT"), NULL_PARAM,
82 // RV_TRACE_LEVEL_DEBUG_HIGH, TRACE_XXX );
83
84 r2d_g_event_was_sent=FALSE;
85 if (r2d_g_refresh_disabled==0)
86 r2d_refresh();
87 rvf_delay(RVF_MS_TO_TICKS(R2D_REFRESH_PERIOD));
88 }
89
90 }
91
92 return RVM_OK;
93 }