Skip to content

Commit a6739ed

Browse files
committed
little refactoring
1 parent 05b6ddb commit a6739ed

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/HidMouse/src/userUsbHidMouse/USBHIDMouse.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ void USBInit(){
2222
USBDeviceIntCfg(); //Interrupt configuration
2323
UEP0_T_LEN = 0;
2424
UEP1_T_LEN = 0; //Pre-use send length must be cleared
25-
UEP2_T_LEN = 0;
2625
}
2726

2827

@@ -63,14 +62,12 @@ uint8_t USB_EP1_send(){
6362
}
6463

6564
uint8_t Mouse_press(uint8_t k) {
66-
uint8_t i;
6765
HIDRep[0] |= k;
6866
USB_EP1_send();
6967
return 1;
7068
}
7169

7270
uint8_t Mouse_release(uint8_t k) {
73-
uint8_t i;
7471
HIDRep[0] &= ~k;
7572

7673
USB_EP1_send();

ch55xduino/ch55x/libraries/Generic_Examples/examples/05.USB/HidMouse/src/userUsbHidMouse/USBhandler.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
#include "USBconstant.h"
44

5-
//Keyboard functions:
5+
//Mouse functions:
66

7-
void USB_EP2_IN();
8-
void USB_EP2_OUT();
7+
void USB_EP1_IN();
8+
void USB_EP1_OUT();
99

1010
__xdata __at (EP0_ADDR) uint8_t Ep0Buffer[8];
1111
__xdata __at (EP1_ADDR) uint8_t Ep1Buffer[128]; //on page 47 of data sheet, the receive buffer need to be min(possible packet size+2,64), IN and OUT buffer, must be even address

0 commit comments

Comments
 (0)