diff options
| author | HiFiPhile <[email protected]> | 2025-04-18 11:13:15 +0200 |
|---|---|---|
| committer | HiFiPhile <[email protected]> | 2025-04-18 11:13:15 +0200 |
| commit | b6abc9022a4beae98cc206d8fbeefb4700deef2f (patch) | |
| tree | bdd12bb710caa9d161edc1488a37911de0931a3d /examples/device/hid_boot_interface | |
| parent | 713410997326269b4072dce906933f8f44fd0efe (diff) | |
| parent | 865e3488f99209c57b73953428dccf2bc666f0be (diff) | |
Merge remote-tracking branch 'upstream/master' into hcd-template-comments
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'examples/device/hid_boot_interface')
| -rw-r--r-- | examples/device/hid_boot_interface/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | examples/device/hid_boot_interface/CMakePresets.json | 6 | ||||
| -rw-r--r-- | examples/device/hid_boot_interface/src/main.c | 10 |
3 files changed, 14 insertions, 4 deletions
diff --git a/examples/device/hid_boot_interface/CMakeLists.txt b/examples/device/hid_boot_interface/CMakeLists.txt index a01eb3456..3da8ee3df 100644 --- a/examples/device/hid_boot_interface/CMakeLists.txt +++ b/examples/device/hid_boot_interface/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.17) +cmake_minimum_required(VERSION 3.20) include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake) diff --git a/examples/device/hid_boot_interface/CMakePresets.json b/examples/device/hid_boot_interface/CMakePresets.json new file mode 100644 index 000000000..5cd8971e9 --- /dev/null +++ b/examples/device/hid_boot_interface/CMakePresets.json @@ -0,0 +1,6 @@ +{ + "version": 6, + "include": [ + "../../../hw/bsp/BoardPresets.json" + ] +} diff --git a/examples/device/hid_boot_interface/src/main.c b/examples/device/hid_boot_interface/src/main.c index 7ad5c53c2..570e4e801 100644 --- a/examples/device/hid_boot_interface/src/main.c +++ b/examples/device/hid_boot_interface/src/main.c @@ -57,7 +57,11 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_rhport_init_t dev_init = { + .role = TUSB_ROLE_DEVICE, + .speed = TUSB_SPEED_AUTO + }; + tusb_init(BOARD_TUD_RHPORT, &dev_init); if (board_init_after_tusb) { board_init_after_tusb(); @@ -161,8 +165,8 @@ void hid_task(void) { uint8_t const report_id = 0; uint8_t const button_mask = 0; - uint8_t const vertical = 0; - uint8_t const horizontal = 0; + int8_t const vertical = 0; + int8_t const horizontal = 0; int8_t const delta = 5; tud_hid_n_mouse_report(ITF_NUM_MOUSE, report_id, button_mask, delta, delta, vertical, horizontal); |
