clean up helper func

This commit is contained in:
hathach
2018-10-23 12:19:32 +07:00
parent 14cebcb5f5
commit c7340f4b0e
39 changed files with 83 additions and 111 deletions

View File

@@ -188,7 +188,7 @@ bool tud_hid_keyboard_keycode(uint8_t modifier, uint8_t keycode[6])
memcpy(report.keycode, keycode, 6);
}else
{
memclr_(report.keycode, 6);
tu_memclr(report.keycode, 6);
}
return hidd_kbd_report(&report);
@@ -307,14 +307,14 @@ void hidd_init(void)
void hidd_reset(uint8_t rhport)
{
arrclr_(_hidd_itf);
tu_memclr(_hidd_itf, sizeof(_hidd_itf));
#if CFG_TUD_HID_KEYBOARD
varclr_(&_kbd_rpt);
tu_varclr(&_kbd_rpt);
#endif
#if CFG_TUD_HID_MOUSE
varclr_(&_mse_rpt);
tu_varclr(&_mse_rpt);
#endif
}

View File

@@ -68,7 +68,7 @@ static inline tusb_error_t hidh_interface_open(uint8_t dev_addr, uint8_t interfa
static inline void hidh_interface_close(hidh_interface_info_t *p_hid)
{
(void) hcd_pipe_close(p_hid->pipe_hdl);
memclr_(p_hid, sizeof(hidh_interface_info_t));
tu_memclr(p_hid, sizeof(hidh_interface_info_t));
}
// called from public API need to validate parameters
@@ -164,11 +164,11 @@ tusb_error_t tuh_hid_mouse_get_report(uint8_t dev_addr, void * report)
void hidh_init(void)
{
#if CFG_TUSB_HOST_HID_KEYBOARD
memclr_(&keyboardh_data, sizeof(hidh_interface_info_t)*CFG_TUSB_HOST_DEVICE_MAX);
tu_memclr(&keyboardh_data, sizeof(hidh_interface_info_t)*CFG_TUSB_HOST_DEVICE_MAX);
#endif
#if CFG_TUSB_HOST_HID_MOUSE
memclr_(&mouseh_data, sizeof(hidh_interface_info_t)*CFG_TUSB_HOST_DEVICE_MAX);
tu_memclr(&mouseh_data, sizeof(hidh_interface_info_t)*CFG_TUSB_HOST_DEVICE_MAX);
#endif
#if CFG_TUSB_HOST_HID_GENERIC