Closed StefanJo3107 closed 6 months ago
It turns out, I just had to add extern "C"
function with the same name as the one in C header and add the #[no_mangle]
attribute. Huge thanks to a kind redditor: https://www.reddit.com/r/rust/comments/1cb2462/comment/l0vnrhe/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
I've been tinkering with remote components by including
espressif/tinyusb
andespressif/esp_tinyusb
and generating bindings for them using custom bindings header since these are not inbindings.rs
:I've tried implementing simple key press report with the following code:
but i'm getting these linker errors:
As far as I understand, the problem is unimplemented callback functions which are defined in
hid_device.h
header, but are left to be implemented in user code. How would I go about implementing these functions in rust and resolving linking issue?