commit 435011ae944e7def120dd12abab6cd02e636da97
parent bc12a253f9c4ee5e9821100f0f687e0cef5d24ae
Author: Lukas F. Hartmann <lukas@mntre.com>
Date: Mon, 11 Mar 2024 18:46:15 +0100
trackball2-fw: fix build for latest tinyusb and integrate in CI
Diffstat:
6 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/reform2-trackball2-fw/.gitignore b/reform2-trackball2-fw/.gitignore
@@ -0,0 +1,3 @@
+picotool
+pico-sdk
+tinyusb
diff --git a/reform2-trackball2-fw/CMakeLists.txt b/reform2-trackball2-fw/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5)
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../tinyusb/hw/bsp/family_support.cmake)
+include(${CMAKE_CURRENT_SOURCE_DIR}/tinyusb/hw/bsp/family_support.cmake)
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
@@ -25,7 +25,7 @@ target_include_directories(${PROJECT} PUBLIC
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT})
+family_configure_device_example(${PROJECT} noos)
target_link_libraries(${PROJECT} PRIVATE pico_stdlib tinyusb_device tinyusb_board hardware_pwm hardware_i2c)
diff --git a/reform2-trackball2-fw/README.md b/reform2-trackball2-fw/README.md
@@ -4,7 +4,7 @@
Required: `cmake`, `tinyusb`, `pico-sdk`.
-Two folders up (next to the main `reform` repo), clone the following:
+Clone the following repositories:
`git clone https://github.com/hathach/tinyusb`
`git clone https://github.com/raspberrypi/pico-sdk`
diff --git a/reform2-trackball2-fw/build.sh b/reform2-trackball2-fw/build.sh
@@ -1,6 +1,9 @@
#!/bin/bash
-export PICO_SDK_PATH=$(pwd)/../../pico-sdk
+sudo apt install build-essential pkg-config libusb-1.0-0-dev cmake
+git clone https://github.com/raspberrypi/pico-sdk
+git clone https://github.com/hathach/tinyusb
+export PICO_SDK_PATH="$(pwd)/pico-sdk"
mkdir -p build
cd build
diff --git a/reform2-trackball2-fw/install-picotool.sh b/reform2-trackball2-fw/install-picotool.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+sudo apt install build-essential pkg-config libusb-1.0-0-dev cmake
+git clone https://github.com/raspberrypi/pico-sdk
+export PICO_SDK_PATH="$(pwd)/pico-sdk"
+git clone https://github.com/raspberrypi/picotool
+cd picotool
+mkdir build
+cd build
+cmake ..
+make -j4
+sudo make install
diff --git a/reform2-trackball2-fw/src/main.c b/reform2-trackball2-fw/src/main.c
@@ -28,7 +28,7 @@
#include <stdio.h>
#include <string.h>
-#include "bsp/board.h"
+#include "bsp/board_api.h"
#include "tusb.h"
#include "pico/stdlib.h"