⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 r2d_task.c

📁 是一个手机功能的模拟程序
💻 C
字号:
/**
                                                                          
	@file:	r2d_task.c
	
	@author Christophe Favergeon                              
                                                                          
    @version 0.5	

    Purpose: Refresh task for R2D. It is calling the LCD dependent refresh subroutine
	
*/

/*
																			
 	Date       	Modification												
  ------------------------------------									
    06/02/2001	Create		
	10/18/2001  Version 0.5 for first integration with Riviera database
																											    
																			
 (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved
*/



#include "general.h"
#include "rvf_api.h"
#include "rvm_api.h"
#include "rvm_use_id_list.h"
#include "r2d_messages.h"
#include "r2d_env.h"
#include "r2d_config.h"
#include "r2d.h"
#include "r2d_i.h"



int g_test = 0;

#if R2D_COMPARE_REFRESH	/* Robert.Chen add, 2003-12-13 */
extern UINT16  g_needrefreshline;
#endif

extern int g_keypadnum;
extern void r2d_refresh(void);

#if R2D_COMPARE_REFRESH	/* Robert.Chen add, 2003-12-13 */
INT8 lcdcompare = 0;
#endif

#if R2D_SUBLCD_SUPPORT
extern char bSubRefresh;
#endif
/*******************************************************************************
** Function         r2d_core
**
** Description      Core of the r2d task, which refresh the LCD
**					
*******************************************************************************/
T_RVM_RETURN r2d_core(void)
{	
	BOOLEAN error_occured = FALSE;
	T_R2D_EVT * msg_ptr_rx, * msg_ptr_tx;
	
	//r2d_start();


	rvf_send_trace("R2D REFRESH TASK STARTED",24, NULL_PARAM, 
			   RV_TRACE_LEVEL_DEBUG_HIGH, R2D_USE_ID );
	
	/* loop to process messages */
	while (error_occured == FALSE)
	{
		UINT16 received_event;
		//rvf_send_trace("WAIT EVENT",strlen("WAIT EVENT"), NULL_PARAM, 
		//	   RV_TRACE_LEVEL_DEBUG_HIGH, TRACE_XXX );
		/* Wait for the necessary events (infinite wait for a msg in the mailbox 0). */
		 received_event = rvf_wait ( EVENT_MASK(RVF_APPL_EVT_0), 0);

		rvf_send_trace("EVENT RECEIVED",strlen("EVENT RECEIVED"), NULL_PARAM, 
			   RV_TRACE_LEVEL_DEBUG_HIGH, R2D_USE_ID );

		//continue;
		/* If an event related to mailbox 0 is received, then */
		if (received_event & EVENT_MASK(RVF_APPL_EVT_0) )
		{	
			g_test = 1;

			#if R2D_COMPARE_REFRESH /* Robert.Chen add, 2003-12-13 */
						
			if(lcdcompare == 0)
			{
			    CompareLcdData();
                if(g_needrefreshline)
					r2d_new_refresh();
			}
			else
			{
				r2d_refresh();
			}

			#else
			if(bSubRefresh)
			{
				bSubRefresh = 0;
				r2d_sub_refresh();	
			}
			else
			{
				r2d_refresh();	/* refresh the entire LCD area */
			}	
			#endif	

			g_test = 0;
			
			r2d_g_event_was_sent=FALSE;
			g_keypadnum = 0;
			//rvf_delay(RVF_MS_TO_TICKS(R2D_REFRESH_PERIOD));
			rvf_send_trace("ZDC GOOD EVENT CONSUME",strlen("ZDC GOOD EVENT CONSUME"), NULL_PARAM, RV_TRACE_LEVEL_DEBUG_HIGH, 101 );

		}

	}
	
	return RVM_OK;	
}


void Force_refresh(void)
{
	/* Robert.Chen changed, 2003-12-13 */
	/* from */
#if 0
	CompareLcdData();
	if(g_needrefreshline)			
		r2d_new_refresh();
#endif

	/* to */
    #if R2D_COMPARE_REFRESH

	CompareLcdData();
	if(g_needrefreshline)			
		r2d_new_refresh();

    #else

	r2d_refresh();

    #endif
  	/* Change end. */
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -