summaryrefslogtreecommitdiff
path: root/cmd/sbc_harness
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/sbc_harness')
-rw-r--r--cmd/sbc_harness/CMakeLists.txt6
-rw-r--r--cmd/sbc_harness/main.c12
-rw-r--r--cmd/sbc_harness/usb_keyboard.c5
-rw-r--r--cmd/sbc_harness/usb_keyboard.h2
4 files changed, 12 insertions, 13 deletions
diff --git a/cmd/sbc_harness/CMakeLists.txt b/cmd/sbc_harness/CMakeLists.txt
index 34f6360..08fb226 100644
--- a/cmd/sbc_harness/CMakeLists.txt
+++ b/cmd/sbc_harness/CMakeLists.txt
@@ -3,6 +3,8 @@
# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
# SPDX-Licence-Identifier: AGPL-3.0-or-later
+pico_sdk_init()
+
add_executable(sbc_harness
main.c
usb_keyboard.c
@@ -10,9 +12,7 @@ add_executable(sbc_harness
target_include_directories(sbc_harness PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/config)
target_link_libraries(sbc_harness
pico_stdlib
- pico_unique_id
- tinyusb_device
- tinyusb_board
+
libusb
)
pico_enable_stdio_usb(sbc_harness 0)
diff --git a/cmd/sbc_harness/main.c b/cmd/sbc_harness/main.c
index 1fd9f8c..31ce30b 100644
--- a/cmd/sbc_harness/main.c
+++ b/cmd/sbc_harness/main.c
@@ -4,15 +4,12 @@
* SPDX-Licence-Identifier: AGPL-3.0-or-later
*/
-/* newlib */
#include <string.h> /* for strlen() */
-
-/* pico-sdk */
#include "pico/stdlib.h"
-/* local */
-#include "coroutine.h"
-#include "usb_common.h"
+#include <libcr/coroutine.h>
+#include <libusb/usb_common.h>
+
#include "usb_keyboard.h"
COROUTINE hello_world_cr(void *_chan) {
@@ -21,7 +18,8 @@ COROUTINE hello_world_cr(void *_chan) {
cr_begin();
for (size_t i = 0;; i = (i+1) % strlen(msg)) {
- cr_rpc_req(chan, NULL, msg[i]);
+ int result;
+ cr_rpc_req(chan, &result, (uint32_t)msg[i]);
}
cr_end();
diff --git a/cmd/sbc_harness/usb_keyboard.c b/cmd/sbc_harness/usb_keyboard.c
index 1989b35..3cf0bb3 100644
--- a/cmd/sbc_harness/usb_keyboard.c
+++ b/cmd/sbc_harness/usb_keyboard.c
@@ -6,8 +6,9 @@
#include "tusb.h"
-#include "tusb_helpers.h" /* for TUD_ENDPOINT_IN */
-#include "usb_common.h"
+#include <libusb/tusb_helpers.h> /* for TUD_ENDPOINT_IN */
+#include <libusb/usb_common.h>
+
#include "usb_keyboard.h"
/**
diff --git a/cmd/sbc_harness/usb_keyboard.h b/cmd/sbc_harness/usb_keyboard.h
index 6b65360..8eba062 100644
--- a/cmd/sbc_harness/usb_keyboard.h
+++ b/cmd/sbc_harness/usb_keyboard.h
@@ -7,7 +7,7 @@
#ifndef _USB_KEYBOARD_H_
#define _USB_KEYBOARD_H_
-#include "coroutine_rpc.h"
+#include <libcr_ipc/rpc.h>
typedef cr_rpc_t(uint32_t, int) usb_keyboard_rpc_t;