📄 pthread_mouse.c
字号:
/* set tabstop=4 */
/********************************************************************************
* *
* Copyright(C) 2004 Penta-Micro *
* *
* ALL RIGHT RESERVED *
* *
* This software is the property of Penta-Micro and is furnished under *
* license by Penta-Micro. This software may be used only in accordance *
* with the terms of said license. This copyright notice may not be *
* removed, modified or obliterated without the prior written permission *
* of Penta-Micro. *
* *
* This software may not be copyed, transmitted, provided to or otherwise *
* made available to any other person, company, corporation or other entity *
* except as specified in the terms of said license. *
* *
* No right, title, ownership or other interest in the software is hereby *
* granted or transferred. *
* *
* The information contained herein is subject to change without notice and *
* should not be construed as a commitment by Penta-Micro. *
* *
********************************************************************************
MODULE NAME: PTHREAD_MOUSE.C
REVISION HISTORY:
Date Ver Name Description
---------- --- --------------------- -----------------------------------------
07/20/2005 1.0 JiGwanKang(xchannel) Created
...............................................................................
DESCRIPTION:
This Module contains definition for mouse
( support for TW2834 mouse pointer )
...............................................................................
*/
/** ************************************************************************* **
** includes
** ************************************************************************* **/
#include <stdio.h>
#include <unistd.h>
#include "main.h"
#include "pthread_mouse.h"
/** ************************************************************************* **
** defines
** ************************************************************************* **/
#define m_DEBUG(format, args...) printf(format, ## args);fflush(stdout);
#define m_MSG(format, args...) printf(format, ## args)
#define m_ERROR(format, args...) printf(format, ## args);fflush(stdout);
/** ************************************************************************* **
** typedefs
** ************************************************************************* **/
/** ************************************************************************* **
** globals
** ************************************************************************* **/
extern PTHREAD_STATE *gp_state_thread;
extern SETUP_PARAM *gp_setup_param;
/** ************************************************************************* **
** locals
** ************************************************************************* **/
/** ************************************************************************* **
** forward declarations
** ************************************************************************* **/
void *pthread_mouse(void *args)
{
UNS8 ii=0x10, idx=0, flag= FALSE;
m_DEBUG("\t!!! pthread MOUSE !!!\n");
while (1) {
tw2834_write_reg(TW2834_PAGE2, 0x02, 0x2f); // mouse pointer location for vertical
tw2834_write_reg(TW2834_PAGE2, 0x01, ii); // mouse pointer location for horizontal
if(ii >= 0x9f) {
flag = TRUE;
idx = 0;
}
else if (ii <= 0x10) {
flag = FALSE;
idx = 0;
}
if(flag) {
idx++;
--ii;
ii -= idx;
}
else {
idx++;
++ii;
ii += idx;
}
usleep(30000);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -