Ejemplo n.º 1
0
s32 ve_interrupt_service(void)
{
    volatile u32* ve_top_reg;
    volatile u32* ve_intr_ctrl_reg;
    u32 		  mode;
    OS_SEM_DATA   sem_data;

    ve_top_reg = (u32*)ve_get_reg_base_addr();

    mode = (*ve_top_reg) & 0xf;
    
	/* estimate Which video format */
    switch (mode)
    {
        case 0: //mpeg124
            //ve_status_reg = (int *)(addrs.regs_macc + 0x100 + 0x1c);
            ve_intr_ctrl_reg = (u32 *)(((u32)ve_top_reg) + 0x100 + 0x14);
            break;
        case 1: //h264
            //ve_status_reg = (int *)(addrs.regs_macc + 0x200 + 0x28);
            ve_intr_ctrl_reg = (u32 *)(((u32)ve_top_reg) + 0x200 + 0x20);
            break;
        case 2: //vc1
            //ve_status_reg = (int *)(addrs.regs_macc + 0x300 + 0x2c);
            ve_intr_ctrl_reg = (u32 *)(((u32)ve_top_reg) + 0x300 + 0x24);
            break;
        case 3: //rmvb
            //ve_status_reg = (int *)(addrs.regs_macc + 0x400 + 0x1c);
            ve_intr_ctrl_reg = (u32 *)(((u32)ve_top_reg) + 0x400 + 0x14);
            break;
        default:
            //ve_status_reg = (int *)(addrs.regs_macc + 0x100 + 0x1c);
            ve_intr_ctrl_reg = (u32 *)(((u32)ve_top_reg) + 0x100 + 0x14);
            break;
    }

    //disable interrupt
    if(mode == 0)
        *ve_intr_ctrl_reg = *ve_intr_ctrl_reg & (~0x7C);
    else
        *ve_intr_ctrl_reg = *ve_intr_ctrl_reg & (~0xF);
	

	if(esKRNL_SemQuery(sem_intr, &sem_data) == 0)
	{
		if(sem_data.OSCnt == 0)
			esKRNL_SemPost(sem_intr);
	}
    
    return 0;
}
Ejemplo n.º 2
0
static s32 cb_ve_clock_change(u32 cmd, s32 aux)
{
    switch(cmd)
    {
        case CLK_CMD_SCLKCHG_REQ:
       {
            u8 err;

            //* request semaphore to check if it can adjust speed now
            esKRNL_SemPend(sem_ve_clk_adjust, 0, &err);
            return EPDK_OK;
        }

        case CLK_CMD_SCLKCHG_DONE:
        {
            //* release semaphore
            esKRNL_SemPost(sem_ve_clk_adjust);
            return EPDK_OK;
        }

        default:
            return EPDK_FAIL;
    }
}
Ejemplo n.º 3
0
/** 
 * 从系统消息队列取消息
 */
static void ksrv_msg_thread(void *arg)
{
	__memit_ctr_t *emit = (__memit_ctr_t *)arg;
	__u8  error;
	
	/* 清空按键消息队列 */
	while(1)
	{
		__u32           usrmsg;		
		
		//usrmsg = esKSRV_GetLowMsg();
		usrmsg = esKSRV_GetMsg();
		if( usrmsg == 0 )
			break;
	}	
	
	while(1)
    {
        __u32           usrmsg;        
        __msrv_msg_t	*pmsg;   
        __u32 			tmp;     
  		 		  		
        while(1)
        {  	
           	if( esKRNL_TDelReq(OS_PRIO_SELF) == OS_TASK_DEL_REQ )
			{
				esKRNL_TDel(OS_PRIO_SELF);			
			}
           	
           	usrmsg = esKSRV_GetMsg();				// 系统消息队列
           	if(usrmsg)
            	break;
           	esKRNL_TimeDly(2);
        }
                
		esKRNL_SemPend(emit->p_array_sem, 0, &error);
		pmsg = get_msg_buf(emit);
		//eLIBs_memset(pmsg, 0, sizeof(__msrv_msg_t));
		esKRNL_SemPost(emit->p_array_sem);
		
		if( (usrmsg & 0xffff0000) == KMSG_USR_CLS_KEY) 	// key 按键消息
		{
			tmp = usrmsg & 0x0000ffff;
			__msg(" usrmsg = %d \n", tmp);
			switch (usrmsg) 
			{
					    
			#if( EPDK_CASE == EPDK_LIVE_BOX )
				case KMSG_USR_KEY_POWER:				/* standby	*/	
					 pmsg->type = DSK_MSG_STANDBY;
					 break;			
					 					                 	
	            case KMSG_USR_KEY_REPEATE:				/* 切换到色差输出 */
	            	pmsg->type = DSK_MSG_SWITCH_YPBPR;	            	
	            	break;            
	            
				case KMSG_USR_KEY_CLEAR:				/* 切换到cvbs输出 */
					pmsg->type = DSK_MSG_SWITCH_CVBS;
					break;					
					
				case KMSG_USR_KEY_DISPLAY:				/* 切换到hdmi输出 */
					pmsg->type = DSK_MSG_SWITCH_HDMI;
					break;
				
				case KMSG_USR_KEY_SHIFT:
					 pmsg->type = GUI_MSG_KEY;
					 pmsg->id	= GUI_MSG_KEY_SHIFT;					
					break;
				
				case KMSG_USR_KEY_SEL:	
					 pmsg->type = GUI_MSG_KEY;
					 pmsg->id	= GUI_MSG_KEY_SEL;		
					break;			
				
				case KMSG_USR_KEY_NUM4:
					pmsg->type = DSK_MSG_SWITCH_AUDIO_IF;
					pmsg->data = AUDIO_DEV_IF_CODEC;		
					break;
					 
				case KMSG_USR_KEY_NUM5:
					pmsg->type = DSK_MSG_SWITCH_AUDIO_IF;
					pmsg->data = AUDIO_DEV_IF_IIS;		
					break;
					 
				case KMSG_USR_KEY_NUM6:
					pmsg->type = DSK_MSG_SWITCH_AUDIO_IF;
					pmsg->data = AUDIO_DEV_IF_SPDIF;		
					break;					
					 
			#endif	
							
			#if( EPDK_CASE == EPDK_LIVE_TOUCH )
				case KMSG_USR_KEY_NUM8:					/* hold 按键 */
					 pmsg->type = DSK_MSG_HOLD;	    
	                 break; 
	            
	            case KMSG_USR_KEY_NUM7:								// 禁音功能
					pmsg->type = DSK_MSG_BAN_VOLUME;
					pmsg->data = 0;
					break;
	            
	        #endif 
	            	            
				case KMSG_USR_KEY_GOTO:
					pmsg->type = DSK_MSG_APP_EXIT;		/* 一键回主界面 */
					break;
			 
	            case KMSG_USR_KEY_POWEROFF:				// 关机消息			                 
	                 pmsg->type = DSK_MSG_POWER_OFF;
				     break;
				     	
				case KMSG_USR_KEY_NUM9:
					 pmsg->type = GUI_MSG_KEY;
					 pmsg->id	= GUI_MSG_KEY_ESCAPE;	
					 break;
				
			    case KMSG_USR_KEY_VOICE_UP:
					 pmsg->type = GUI_MSG_KEY;
					 pmsg->id	= GUI_MSG_KEY_VADD;				
				     break;
				     
			    case KMSG_USR_KEY_VOICE_DOWN:
					 pmsg->type    = GUI_MSG_KEY;
					 pmsg->id	   = GUI_MSG_KEY_VDEC;
	        	     break;
					
	            case KMSG_USR_KEY_UP:
					 pmsg->type    = GUI_MSG_KEY;
					 pmsg->id	   = GUI_MSG_KEY_UP;
	                 break;
					 
	        	case KMSG_USR_KEY_DOWN  :
					 pmsg->type    = GUI_MSG_KEY;
					 pmsg->id	   = GUI_MSG_KEY_DOWN;
	                 break;
	                 
	            case KMSG_USR_KEY_LEFT  : 
					 pmsg->type    	= GUI_MSG_KEY;
	                 pmsg->id	    = GUI_MSG_KEY_LEFT;
	                 break;
					 
	            case KMSG_USR_KEY_RIGHT :
					 pmsg->type    	= GUI_MSG_KEY;
					 pmsg->id	    = GUI_MSG_KEY_RIGHT;
					 break;
	            
			case KMSG_USR_KEY_ENTER:
					 pmsg->type    	= GUI_MSG_KEY;
	                 pmsg->id	    = GUI_MSG_KEY_ENTER;
	                break;                               		
	
			    case KMSG_USR_KEY_RISE:
					pmsg->type    	= GUI_MSG_KEY;
				    pmsg->id	    = GUI_MSG_KEY_RISE;
				    break;
				
				default:
		        	continue;
			}
		}
		else	/* system 消息 */
		{
	#if 	0
			if( (usrmsg & 0x0000ffff) == KMSG_USR_SYSTEM_KNOB_KEY )//add by libaiao,2011.11.21
				   {
					__u32  ret;
					  // pmsg->type    	= GUI_MSG_KEY;
					   pmsg->type = DSK_MSG_KNOB_KEY;			   
						ret = (usrmsg & KMSG_USR_SYSTEM_FS_PARA_MASK)>>16;
					   //  pmsg->data = (usrmsg & KMSG_USR_SYSTEM_FS_PARA_MASK)>>16;					   
					   if(ret)				 
					   {
						 pmsg->data =GUI_MSG_KEY_LONGVADD;
						   // pmsg->id = GUI_MSG_KEY_VADD;
						//   eLIBs_printf(" pmsg->data = GUI_MSG_KEY_LONGVADD \n");    

					   }
					   else
					   {
						//   eLIBs_printf(" pmsg->data = GUI_MSG_KEY_LONGVDEC \n");
							pmsg->data =GUI_MSG_KEY_LONGVDEC;
						   // pmsg->id = GUI_MSG_KEY_VDEC;
					   }
                                    // continue;
			     } else
	#endif
			if( (usrmsg & 0x0000ffff) == KMSG_USR_SYSTEM_FS_PLUGIN )
			{
				pmsg->type = DSK_MSG_FS_PART_PLUGIN;
				pmsg->data = (usrmsg & KMSG_USR_SYSTEM_FS_PARA_MASK)>>16;				
			}
Ejemplo n.º 4
0
static __s32 key_msg_cb(void *msg)
{	
	__msrv_msg_t	*pmsg;
	__u8 error;
	
	__u32 i;
	__input_event_packet_t *pPacket;
    __input_event_t        *pEventFrame;				
	
    if (msg == NULL)
    {
        __msg("invalid argument for call back\n");
        return EPDK_FAIL;
    }

    __inf("1------------------------------------------------\n");
    
    //dump packet events
    pPacket = (__input_event_packet_t *)msg;
    if (pPacket->event_cnt > INPUT_MAX_EVENT_NR)
    {
        __msg("invalid event count number\n");
        return EPDK_FAIL;
    }
	__inf("2------------------------------------------------\n");
	for (i = 0; i < pPacket->event_cnt; i++)
	{
		pEventFrame = &(pPacket->events[i]);
		__msg("Event %d: type = %d, code = %d, value = %d\n", i + 1,
                                                                 pEventFrame->type,
                                                                 pEventFrame->code,
                                                                 pEventFrame->value
                                                                 );
		if(pEventFrame->type == EV_KEY) 
		{		   
			__msg("pEventFrame->type == EV_KEY\n");
            
			esKRNL_SemPend(emit_ctr.p_array_sem, 0, &error);
			pmsg = get_msg_buf(&emit_ctr);			
			esKRNL_SemPost(emit_ctr.p_array_sem);	
			
			
			switch(pEventFrame->code)
			{
				case KPAD_SCR_ONOFF:
				{			
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_SCR_ONOFF;
					break;
				}
				case KPAD_STORE_UP:
				{			
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_STORE_UP;
					break;
				}
				case KPAD_STORE_UP_PLAY:
				{			
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_STORE_UP_PLAY;
					break;
				}
				case KPAD_LR:
				{
                    __wrn("KPAD_LR\n");
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_LR; 
                    break;
				}
				case KPAD_MODE:
				{
                    __wrn("KPAD_MODE\n");
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_MODE; 
                    break;
				}
				case KPAD_MENU:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_MENU;
					__msg("GUI_MSG_KEY_MENU\n");
                   			 break;
				}
				case KPAD_UP:
			 	{
					pmsg->type 	= GUI_MSG_KEY;
			 		pmsg->id 	= GUI_MSG_KEY_UP;
					__msg("GUI_MSG_KEY_UP\n");
					break;
				}
				case KPAD_DOWN:
			 	{
					pmsg->type 	= GUI_MSG_KEY;
			 		pmsg->id 	= GUI_MSG_KEY_DOWN;
					__msg("GUI_MSG_KEY_DOWN\n");
					break;
				}
				case KPAD_LEFT:
			 	{
					pmsg->type 	= GUI_MSG_KEY;
			 		pmsg->id 	= GUI_MSG_KEY_LEFT;
					__msg("GUI_MSG_KEY_LEFT\n");
					break;
				}
				case KPAD_RIGHT:
			 	{
					pmsg->type 	= GUI_MSG_KEY;
			 		pmsg->id 	= GUI_MSG_KEY_RIGHT;
					__msg("GUI_MSG_KEY_RIGHT\n");
					break;
				}					
				case KPAD_VOICEUP:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_VADD;
					__msg("GUI_MSG_KEY_VADD\n");
					break;
				}
				case KPAD_VOICEDOWN:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_VDEC;
					__msg("GUI_MSG_KEY_VDEC\n");
					break;
				}
				case KPAD_ENTER:
			 	{
					pmsg->type 	= GUI_MSG_KEY;
			 		pmsg->id 	= GUI_MSG_KEY_ENTER;
					__msg("GUI_MSG_KEY_ENTER\n");
					break;
				}
				case KPAD_REPLACE_ENTER:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_ENTER;
					__msg("KPAD_REPLACE_ENTER\n");
					break;
				}
				case KPAD_RETURN:
			 	{
					pmsg->type 	= GUI_MSG_KEY;
			 		pmsg->id 	= GUI_MSG_KEY_ESCAPE;
					__msg("GUI_MSG_KEY_ESCAPE\n");
					break;
				}
				case KPAD_POWER:
				{			
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_POWER;
					__msg("GUI_MSG_KEY_POWER\n");
					break;
				}
				case KPAD_PHOTO:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_PHOTO;
					eLIBs_printf("GUI_MSG_KEY_PHOTO\n");
					break;
				}
				case KPAD_MUSIC:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_MUSIC;
					break;
				}
				case KPAD_MOVIE:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_MOVIE;
					break;
				}
				case KPAD_PAUSE:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_PAUSE;
					__msg("GUI_MSG_KEY_PAUSE\n");
					break;
				}
				case KPAD_SETTING:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_SETTING;
					break;
				}
				case KPAD_FM:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_FM;
					break;
				}
				case KPAD_LINEIN_PLUGIN:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_LINEIN_PLUGIN;
					break;
				}
				case KPAD_LINEIN_PLUGOUT:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_LINEIN_PLUGOUT;
					break;
				}
				case KPAD_CALENDAR:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_CALENDAR;
					break;
				}
				case KPAD_MEDIA_PRE:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_MEDIA_PRE;
					break;
				}
				case KPAD_RECORD:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_RECORD;
					break;
				}
				case KPAD_MEDIA_NEXT:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_MEDIA_NEXT;
					break;
				}
#ifdef SUPPORT_DIGIT_KEY
				case KPAD_NUM0:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_NUM0;
					__msg("GUI_MSG_KEY_NUM0\n");
                   			 break;
				}
				case KPAD_NUM1:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_NUM1;
					__msg("GUI_MSG_KEY_NUM1\n");
                   			 break;
				}
				case KPAD_NUM2:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_NUM2;
					__msg("GUI_MSG_KEY_NUM2\n");
                   			 break;
				}
				case KPAD_NUM3:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_NUM3;
					__msg("GUI_MSG_KEY_NUM3\n");
                   			 break;
				}
				case KPAD_NUM4:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_NUM4;
					__msg("GUI_MSG_KEY_NUM4\n");
                   			 break;
				}
				case KPAD_NUM5:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_NUM5;
					__msg("GUI_MSG_KEY_NUM5\n");
                   			 break;
				}
				case KPAD_NUM6:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_NUM6;
					__msg("GUI_MSG_KEY_NUM6\n");
                   			 break;
				}
				case KPAD_NUM7:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_NUM7;
					__msg("GUI_MSG_KEY_NUM7\n");
                   			 break;
				}
				case KPAD_NUM8:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_NUM8;
					__msg("GUI_MSG_KEY_NUM8\n");
                   			 break;
				}
				case KPAD_NUM9:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_NUM9;
					__msg("GUI_MSG_KEY_NUM9\n");
                   			 break;
				}
				case KPAD_NUM_CLR:
				{
					pmsg->type 	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_NUM_CLEAR;
					__msg("GUI_MSG_KEY_NUM_CLEAR\n");
                   			 break;
				}
#endif
				case KPAD_IR_LEFT:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_IR_RIGHT;	//GUI_MSG_KEY_IR_LEFT;
					__msg("GUI_MSG_KEY_IR_LEFT\n");
					break;
				}
				case KPAD_IR_RIGHT:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_IR_RIGHT;
					__msg("GUI_MSG_KEY_IR_RIGHT\n");
					break;
				}
				case KPAD_IR_UP:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_IR_UP;
					__msg("GUI_MSG_KEY_IR_UP\n");
					break;
				}
				case KPAD_IR_DOWN:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_IR_DOWN;
					__msg("GUI_MSG_KEY_IR_DOWN\n");
					break;
				}
				case KPAD_IR_VOICEDOWN:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id 	= GUI_MSG_KEY_IR_VDEC;
					break;
				}
				case KPAD_IR_VOICEUP:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_IR_VADD;
					break;
				}
				case KPAD_MUTE:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_IR_MUTE;
					break;
				}
				case KPAD_IR_POWER:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_IR_POWER;
					break;
				}
				case KPAD_IR_TVOUT:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_IR_TVOUT;
				__msg("GUI_MSG_KEY_IR_TVOUT\n");	
					break;
				}
				case KPAD_POWEROFF:
				{
					pmsg->type 	= DSK_MSG_POWER_OFF;
					__msg("GUI_MSG_KEY_POWER_OFF\n");
					break;
				}
				case KPAD_IR_KOK:
				{
					pmsg->type	= GUI_MSG_KEY;
					pmsg->id	= GUI_MSG_KEY_IR_KOK;
					break;					
				}
				default:
					break;
			}			
			pmsg->data 	= pEventFrame->value;
		__msg("czp is add......power_off_id = %d\n", DSK_MSG_POWER_OFF);
            __msg("GUI_MSG_KEY_ val=%d, pmsg->type=%d\n", pmsg->id, pmsg->type);

			esKRNL_QPost(emit_ctr.psys_msg_queue, pmsg);
		}		
	}	
	__inf("3------------------------------------------------\n");			
	
	return EPDK_TRUE;
}
Ejemplo n.º 5
0
/**
 * 通过回调函数的方式取触摸屏消息
 */
static __s32 tp_msg_cb(void *msg)
{	
	__msrv_msg_t	*pmsg;
	__u8 error;
	
	__u32 i;
	__input_event_packet_t *pPacket;
    __input_event_t        *pEventFrame;
	__input_event_t        pEvent_type;
	__input_event_t        pEvent_x;
	__input_event_t        pEvent_y;
	__input_event_t        pEvent_speed_dir;
	__input_event_t        pEvent_speed_val;
	
    if (msg == NULL)
    {
        __msg("invalid argument for call back\n");
        return EPDK_FAIL;
    }
    
    /* dump packet events */
    pPacket = (__input_event_packet_t *)msg;
    if (pPacket->event_cnt <= 0 || pPacket->event_cnt > INPUT_MAX_EVENT_NR)
    {
        __msg("invalid event count number\n");
        return EPDK_FAIL;
    }
	//__inf("\n------------------------------------------------\n");
	for (i = 0; i < pPacket->event_cnt; i++)
	{
		pEventFrame = &(pPacket->events[i]);
		/*__inf("Event %d: type = %d, code = %d, value = %d\n", i + 1,
                                                                 pEventFrame->type,
                                                                 pEventFrame->code,
                                                                 pEventFrame->value
                                                                 );*/
		if(pEventFrame->type == EV_ABS) 
		{
			if(pEventFrame->code == ABS_MISC)
			{			
				eLIBs_memcpy(&pEvent_type, pEventFrame, sizeof(__input_event_t));
			}
			else if(pEventFrame->code == ABS_X)
			{			
				eLIBs_memcpy(&pEvent_x, pEventFrame, sizeof(__input_event_t));					
			}
			else if(pEventFrame->code == ABS_Y)
			{			
				eLIBs_memcpy(&pEvent_y, pEventFrame, sizeof(__input_event_t));					
			}
			else if(pEventFrame->code == ABS_RUDDER)
			{			
				eLIBs_memcpy(&pEvent_speed_dir, pEventFrame, sizeof(__input_event_t));					
			}
			else if(pEventFrame->code == ABS_BRAKE)
			{			
				eLIBs_memcpy(&pEvent_speed_val, pEventFrame, sizeof(__input_event_t));					
			}	
		}
		else if(pEventFrame->type == EV_SYN)
		{
			break;
		}
	}				
	//__inf("\n------------------------------------------------\n");	
	
	esKRNL_SemPend(emit_ctr.p_array_sem, 0, &error);
	pmsg = get_msg_buf(&emit_ctr);	
	esKRNL_SemPost(emit_ctr.p_array_sem);
	
	pmsg->type 	= GUI_MSG_TOUCH;
	switch( pEvent_type.value)
	{
		case EV_TP_PRESS_START:
		{				
			pmsg->id 	= GUI_MSG_TOUCH_DOWN;					
			pmsg->data 	= (pEvent_y.value<<16) + pEvent_x.value;				
			pmsg->reserved = (pEvent_speed_dir.value<<16) + pEvent_speed_val.value;
			last_touch_action = GUI_MSG_TOUCH_DOWN;
			break;
		}	
		case EV_TP_PRESS_MOVE:
			pmsg->id 	= GUI_MSG_TOUCH_MOVE;						
			pmsg->data 	= (pEvent_y.value<<16) + pEvent_x.value;				
			pmsg->reserved = (pEvent_speed_dir.value<<16) + pEvent_speed_val.value;
			last_touch_action = GUI_MSG_TOUCH_MOVE;
			break;		
		case EV_TP_PINCH_IN:
			pmsg->id 	= GUI_MSG_TOUCH_ZOOMIN;						
			pmsg->data 	= (pEvent_y.value<<16) + pEvent_x.value;				
			pmsg->reserved = (pEvent_speed_dir.value<<16) + pEvent_speed_val.value;
			last_touch_action = GUI_MSG_TOUCH_ZOOMIN;
			break;
		case EV_TP_PINCH_OUT:
			pmsg->id 	= GUI_MSG_TOUCH_ZOOMOUT;						
			pmsg->data 	= (pEvent_y.value<<16) + pEvent_x.value;				
			pmsg->reserved = (pEvent_speed_dir.value<<16) + pEvent_speed_val.value;
			last_touch_action = GUI_MSG_TOUCH_ZOOMOUT;
			break;
		case EV_TP_PRESS_HOLD:
			pmsg->id 	= last_touch_action;		
			pmsg->data 	= (pEvent_y.value<<16) + pEvent_x.value;				
			pmsg->reserved = (pEvent_speed_dir.value<<16) + pEvent_speed_val.value;
			break;
			
		case EV_TP_ACTION_NULL:			
  	 	case EV_TP_ACTION_CLICK:				
   		case EV_TP_ACTION_DOWN:				
   		case EV_TP_ACTION_UP:				 
    	case EV_TP_ACTION_LEFT:				
   		case EV_TP_ACTION_RIGHT:			
    	case EV_TP_ACTION_ANTICLOCKWISE:		
    	case EV_TP_ACTION_CLOCKWISE:			
    	case EV_TP_ACTION_LD2RU:				
    	case EV_TP_ACTION_RU2LD:      		   
    	case EV_TP_ACTION_LU2RD:	    		
    	case EV_TP_ACTION_RD2LU:
    		pmsg->id 	= GUI_MSG_TOUCH_UP;    
			pmsg->data 	= (pEvent_y.value<<16) + pEvent_x.value;				
			pmsg->reserved = (pEvent_speed_dir.value<<16) + pEvent_speed_val.value;
    		break; 	
    	default:
    		__msg("cannot identify message: %x\n", pEvent_type.value);
    		return EPDK_FALSE;		    
	}
	__msg("------------------------------------------------\n");	
	__msg("pmsg->type = %d, pmsg->id = %d\n", pmsg->type, pmsg->id);
	__msg("x = %d, y = %d\n", LOSWORD(pmsg->data), HISWORD(pmsg->data));
	__msg("------------------------------------------------\n");
	esKRNL_QPost(emit_ctr.psys_msg_queue, pmsg);
	
	return EPDK_TRUE;
}
Ejemplo n.º 6
0
void DRV_scaler_finish(__u32 sel)
{
    esKRNL_SemPost(g_disp_drv.scaler_finished_sem[sel]);
}
Ejemplo n.º 7
0
s32 semaphore_post(Handle h)
{
	esKRNL_SemPost((__krnl_event_t*)h);
	return 0;
}