xmos / lib_xua

XMOS USB Audio
Other
17 stars 13 forks source link

HID code needs uncoupling from sw_xvf3510 #155

Closed oscarbailey-xmos closed 1 year ago

oscarbailey-xmos commented 3 years ago

HID functions declared in lib_xua:

UserHIDInit()
UserHIDGetData()
UserHIDRecordEvent()

HID functions defined or called in lib_xua:

UserHIDGetData()

The other two functions are both defined and called at the app level in sw_xvf3510.

UserHIDRecordEvent is defined in sw_xvf3510 here: https://github.com/xmos/sw_xvf3510/blob/7c42079402f4c2825d47e0ca80c388c8ed9c51fe/app_xk_xvf3510_l71/src/extensions/hid/user_hid.xc#L43

And called here: https://github.com/xmos/sw_xvf3510/blob/7c42079402f4c2825d47e0ca80c388c8ed9c51fe/app_xk_xvf3510_l71/src/gpio_client_app.xc#L969

UserHIDInit is defined here: https://github.com/xmos/sw_xvf3510/blob/7c42079402f4c2825d47e0ca80c388c8ed9c51fe/app_xk_xvf3510_l71/src/extensions/hid/user_hid.xc#L31

And called here: https://github.com/xmos/sw_xvf3510/blob/7c42079402f4c2825d47e0ca80c388c8ed9c51fe/app_xk_xvf3510_l71/xua_lite/xua_buffer_lite.xc#L128

xross commented 1 year ago

It looks like UserHIDInitt() and UserHIDGetData() are called from lib_xua. Implementations should be provided by the user (though we could provide empty, weak versions). UserHIDRecordEvent() looks to be completely in user space, it's prototype will be removed from lib_xua.