📄 hid_main.c
字号:
/****************************************************************************
*
* Copyright (c) 2006-2007 by CMX Systems, Inc.
*
* This software is copyrighted by and is the sole property of
* CMX. All rights, title, ownership, or other interests
* in the software remain the property of CMX. This
* software may only be used in accordance with the corresponding
* license agreement. Any unauthorized use, duplication, transmission,
* distribution, or disclosure of this software is expressly forbidden.
*
* This Copyright notice may not be removed or modified without prior
* written consent of CMX.
*
* CMX reserves the right to modify this software without notice.
*
* CMX Systems, Inc.
* 12276 San Jose Blvd. #511
* Jacksonville, FL 32223
* USA
*
* Tel: (904) 880-1840
* Fax: (904) 880-1632
* http: www.cmx.com
* email: cmx@cmx.com
*
***************************************************************************/
#include "mcf51xx_reg.h"
#include "usb.h"
//#include "target.h"
#include "hid_mouse.h"
//#define DEBUG
//#define EVB
/****************************************************************************
************************** Macro definitions *******************************
***************************************************************************/
/* none */
/****************************************************************************
************************** Function predefinitions. ************************
***************************************************************************/
/* none */
/****************************************************************************
************************** Global variables ********************************
***************************************************************************/
/* none */
/****************************************************************************
************************** Module variables ********************************
***************************************************************************/
/* none */
/****************************************************************************
************************** Function definitions ****************************
***************************************************************************/
#ifdef ON_THE_GO
/* If on-the-go is used pull-up control is done by the on-the-go driver.
To avoid having trouble this callback must be empty. */
void enable_usb_pull_up(void)
{
}
#else
void enable_usb_pull_up(void)
{
USB_OTG_CONTROL |= USB_OTG_CONTROL_DPPULLUP_NONOTG_MASK; // enable pullup in non-otg mode by setting bit 4
USBTRC0_USBPU = 1;
}
#endif
int main2()
{
hcc_u8 tmp;
stack_init(0x88);
hw_init();
usb_init(); /* select MCGPLLSCK clock as the source clock */
/* See in what mode should we run. */
tmp = (hcc_u8)(SW1_ACTIVE() ? 1 : 0);
tmp |= (hcc_u8)(SW2_ACTIVE() ? 2 : 0);
/* Start the right HID application. */
switch(tmp)
{
case 0:
default:
set_mode(dm_mouse);
hid_mouse();
break;
case 1:
set_mode(dm_kbd);
hid_kbd();
break;
case 2:
set_mode(dm_generic);
hid_generic();
break;
}
/* We will never get here. */
return 0;
}
/****************************** END OF FILE **********************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -