Skip to content

Commit 3df027a

Browse files
readme_fixes
1 parent 5941ad9 commit 3df027a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Arduino_USBHIDHost
22

3+
[![Check Arduino](https://github.com/bcmi-labs/Arduino_USBHIDHost/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/bcmi-labs/Arduino_USBHIDHost/actions/workflows/check-arduino.yml) [![Compile Examples](https://github.com/bcmi-labs/Arduino_USBHIDHost/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/bcmi-labs/Arduino_USBHIDHost/actions/workflows/compile-examples.yml) [![Spell Check](https://github.com/bcmi-labs/Arduino_USBHIDHost/actions/workflows/spell-check.yml/badge.svg)](https://github.com/bcmi-labs/Arduino_USBHIDHost/actions/workflows/spell-check.yml) [![Sync Labels](https://github.com/bcmi-labs/Arduino_USBHIDHost/actions/workflows/sync-labels.yml/badge.svg)](https://github.com/bcmi-labs/Arduino_USBHIDHost/actions/workflows/sync-labels.yml)
4+
35

46
This library provides support for USB HID devices such as keyboards and mice on the Portenta C33. It should support any device that emulates keyboards (for example, barcode readers). The library automatically detects the insertion of a compatible device on the USB port of the chosen breakout board. You can use `attachConnectionCallback()` to get notified when a compatible device is connected.
57

@@ -82,3 +84,16 @@ void onMouseEvent(const HIDMouseEvent &mouseEvent) {
8284
usbMouse.attachMouseEventCallback(onMouseEvent);
8385
```
8486

87+
### Temp. Development instructions
88+
Before all the changes get merged into the core, you will have to do some modifications to get this library to compile.
89+
90+
1. Enable TinyUSB HID Host support
91+
92+
In the core by modify [variants/PORTENTA_C33/tusb_config.h](https://github.com/arduino/ArduinoCore-renesas/blob/main/variants/PORTENTA_C33/tusb_config.h).
93+
On line 106, add `#define CFG_TUH_HID 1`.
94+
Check [this PR](https://github.com/arduino/ArduinoCore-renesas/compare/main...cristidragomir97:ArduinoCore-renesas:hid_host_c33) for more information.
95+
96+
2. Enable weak callback for `tuh_hid_report_received_cb`
97+
When enabling CFG_TUH_HID in tusb_config.h, the stack will expect a tuh_hid_report_received_cb callback to be defined in every sketch, preventing any sketch that doesn't have anything to do with the HID Host stack from compiling. The hid_host.h file defines weak callbacks in order to prevent this issue, but the TU_ATTR_WEAK is prefixed to most callbacks except fortuh_hid_report_received_cb. These changes add this attribute, allowing any sketch to compile.
98+
99+
Check [this PR](https://github.com/arduino/tinyusb/pull/3/commits/e3e9dd066cd64d98de6bd19d2920fec3019b71c4) for more information.

0 commit comments

Comments
 (0)