void keyborad_process(u8* buf) { //putchar('k'); while(EP1BUSY!=0){;} EP1BUSY = 1; Joystick_Send(0,buf); }
void mouse_process(u8* buf) { // u8 Buffer[8] = { 8, 1, 0, 0, 0, 0, 0}; while(EP2BUSY!=0){;} EP2BUSY = 1; Joystick_Send(0,buf); }
/******************************************************************************* * Function Name : main. * Description : main routine. * Input : None. * Output : None. * Return : None. *******************************************************************************/ int main(void) { Set_System(); USB_Interrupts_Config(); Set_USBClock(); USB_Init(); while (1) { Delay(10000); if ((JoyState() != 0) & (bDeviceState == CONFIGURED)) { Joystick_Send(JoyState()); } } }
/******************************************************************************* * Function Name : main. * Description : main routine. * Input : None. * Output : None. * Return : None. *******************************************************************************/ int main(void) { Set_System(); USB_Interrupts_Config(); Set_USBClock(); USB_Init(); while (1) { if (bDeviceState == CONFIGURED) { if ((JoyState() != 0) && (PrevXferComplete)) { Joystick_Send(JoyState()); } } } }