Skip to content

Commit 61f6b0b

Browse files
committed
USBDEV: examples/HID_Mouse: remove redundant code
1 parent d622810 commit 61f6b0b

3 files changed

Lines changed: 4 additions & 261 deletions

File tree

libraries/USBDEV/examples/HID_Mouse/hid_mouse_hw.c

Lines changed: 0 additions & 207 deletions
This file was deleted.

libraries/USBDEV/examples/HID_Mouse/hid_mouse_it.c

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ OF SUCH DAMAGE.
3333
*/
3434

3535
#include "drv_usbd_int.h"
36-
#include "drv_usb_hw.h"
36+
#include "gd32vf103_usbd_hw.h"
3737
#include "hid_mouse_it.h"
3838
#include "standard_hid_core.h"
3939
#include "gd32vf103v_eval.h"
@@ -43,7 +43,6 @@ OF SUCH DAMAGE.
4343
extern usb_core_driver USB_OTG_dev;
4444
extern uint32_t usbfs_prescaler;
4545

46-
void usb_timer_irq(void);
4746
static uint8_t joystate_get(void);
4847
static uint8_t* usbd_mice_pos_get(void);
4948

@@ -66,17 +65,6 @@ void eclic_mtip_handler(void)
6665
}
6766
}
6867

69-
/*!
70-
\brief this function handles USBD interrupt
71-
\param[in] none
72-
\param[out] none
73-
\retval none
74-
*/
75-
void USBFS_IRQHandler(void)
76-
{
77-
usbd_isr (&USB_OTG_dev);
78-
}
79-
8068
/*!
8169
\brief this function handles EXTI4_IRQ Handler
8270
\param[in] none
@@ -106,38 +94,6 @@ void KEY_CET_IRQHandler()
10694
}
10795
}
10896

109-
/*!
110-
\brief this function handles USBD wakeup interrupt request.
111-
\param[in] none
112-
\param[out] none
113-
\retval none
114-
*/
115-
void USBFS_WKUP_IRQHandler(void)
116-
{
117-
if (USB_OTG_dev.bp.low_power) {
118-
SystemInit();
119-
120-
rcu_usb_clock_config(usbfs_prescaler);
121-
122-
rcu_periph_clock_enable(RCU_USBFS);
123-
124-
usb_clock_active(&USB_OTG_dev);
125-
}
126-
127-
exti_interrupt_flag_clear(EXTI_18);
128-
}
129-
130-
/*!
131-
\brief this function handles Timer2 updata interrupt request.
132-
\param[in] none
133-
\param[out] none
134-
\retval none
135-
*/
136-
void TIMER2_IRQHandler(void)
137-
{
138-
usb_timer_irq();
139-
}
140-
14197
/*!
14298
\brief get joystick state
14399
\param[in] none

libraries/USBDEV/examples/HID_Mouse/hid_mouse_it.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSI
3232
OF SUCH DAMAGE.
3333
*/
3434

35-
#ifndef GD32VF103_IT_H
36-
#define GD32VF103_IT_H
35+
#ifndef HID_MOUSE_IT_H
36+
#define HID_MOUSE_IT_H
3737

3838
#ifdef __cplusplus
3939
extern "C" {
@@ -50,14 +50,8 @@ typedef enum {
5050
JOY_RIGHT
5151
} joystate_enum;
5252

53-
/* function declarations */
54-
/* this function handles USB wakeup interrupt handler */
55-
void USBFS_WKUP_IRQHandler(void);
56-
/* this function handles USBFS IRQ Handler */
57-
void USBFS_IRQHandler(void);
58-
5953
#ifdef __cplusplus
6054
}
6155
#endif
6256

63-
#endif /* GD32VF103_IT_H */
57+
#endif /* HID_MOUSE_IT_H */

0 commit comments

Comments
 (0)