commit 3a5fa2b504a768df96a575bdfed6e71ae3bf2905
parent de6a78ab4b8870d74e389c5a808e8e73bff254d5
Author: René Wagner <rwa@clttr.info>
Date: Wed, 22 May 2024 19:23:04 +0200
Merge branch 'master' of https://source.mnt.re/reform/reform
Diffstat:
14 files changed, 74 insertions(+), 10 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
@@ -15,12 +15,13 @@ build:
- reform2-keyboard-fw/keyboard-3_NEO2-standalone.hex
- reform2-trackball-fw/Mouse.hex
- reform2-trackpad-fw/Mouse.hex
+ - reform2-trackball2-fw/build/reform2-trackball2-fw.uf2
- reform2-lpc-fw/firmware-20_R3.bin
- reform2-lpc-fw/firmware-25_R2.bin
script: |
set -x
apt update
- apt-get --no-install-recommends -y install git build-essential avr-libc gcc-avr gcc-arm-none-eabi libnewlib-arm-none-eabi
+ apt-get --no-install-recommends -y install ca-certificates git build-essential avr-libc gcc-avr gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib libusb-1.0-0-dev cmake python3
# use the timestamp of the latest git commit to set reproducible S_D_E
if [ -z ${SOURCE_DATE_EPOCH:+x} ] && git -C . rev-parse 2>/dev/null; then
SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)
@@ -42,6 +43,9 @@ build:
done
make -C reform2-trackball-fw
make -C reform2-trackpad-fw
+ cd reform2-trackball2-fw
+ ./build.sh
+ cd ..
make -C reform2-lpc-fw lpcrc
for rev in 20_R3 25_R2; do
make -C reform2-lpc-fw REFORM_LPC_OPTIONS="-DREFORM_MOTHERBOARD_REV=REFORM_MBREV_$rev -DFW_STRING3=\\\"$VERSION\\\""
diff --git a/reform2-keyboard-fw/download-fw.sh b/reform2-keyboard-fw/download-fw.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+programname=$0
+fwver=$1
+
+function usage {
+ echo "usage: $programname variant"
+ echo ""
+ echo "to download the firmware for the keyboard built into your MNT Reform:"
+ echo ""
+ echo " $programname 3_US # (if you have a QWERTY-US keyboard V3)"
+ echo " $programname 3 # (if you have a non-US keyboard V3)"
+ echo " $programname 2_US # (if you have a QWERTY-US keyboard V2)"
+ echo " $programname 2 # (if you have a non-US keyboard V2)"
+ echo ""
+ echo "if you want to flash a standalone USB keyboard, use one of the following:"
+ echo ""
+ echo " $programname 3_US-standalone"
+ echo " $programname 3-standalone"
+ echo " $programname 2_US-standalone"
+ echo " $programname 2-standalone"
+ echo ""
+ exit 1
+}
+
+if [ "$fwver" != "3_US" ] && [ "$fwver" != "2_US" ] && [ "$fwver" != "3" ] && [ "$fwver" != "2" ]; then
+ usage
+fi
+
+mkdir -p bin
+wget -O keyboard.hex "https://source.mnt.re/reform/reform/-/jobs/artifacts/master/raw/reform2-keyboard-fw/keyboard-$fwver.hex?job=build"
+
diff --git a/reform2-keyboard-fw/flash.sh b/reform2-keyboard-fw/flash.sh
@@ -3,7 +3,7 @@
set -eu
if [ ! -e ./keyboard.hex ]; then
- echo "keyboard.hex doesn't exist" >&2
+ echo "keyboard.hex doesn't exist. build it or use ./download-fw.sh to download it." >&2
exit 1
fi
diff --git a/reform2-keyboard-fw/matrix_anri.h b/reform2-keyboard-fw/matrix_anri.h
@@ -55,11 +55,11 @@
KEY_P,\
KEY_OPENING_BRACKET_AND_OPENING_BRACE,\
KEY_CLOSING_BRACKET_AND_CLOSING_BRACE,\
- KEY_CIRCLE
+ KEY_ENTER
// Fourth row
#define MATRIX_ANRI_DEFAULT_ROW_4 \
- HID_KEYBOARD_SC_CAPS_LOCK,\
+ KEY_CIRCLE,\
KEY_A,\
KEY_S,\
KEY_D,\
diff --git a/reform2-trackball-fw/download-fw.sh b/reform2-trackball-fw/download-fw.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+wget -O Mouse.hex "https://source.mnt.re/reform/reform/-/jobs/artifacts/master/raw/reform2-trackball-fw/Mouse.hex?job=build"
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/download-fw.sh b/reform2-trackball2-fw/download-fw.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+mkdir -p build
+wget -O build/reform2-trackball2-fw.uf2 "https://source.mnt.re/reform/reform/-/jobs/artifacts/master/raw/reform2-trackball2-fw/reform2-trackball2-fw.uf2?job=build"
diff --git a/reform2-trackball2-fw/flash.sh b/reform2-trackball2-fw/flash.sh
@@ -4,7 +4,7 @@ echo "Flash MNT Reform Trackball2 (RP2040):"
select yn in "Flash" "Exit"; do
case $yn in
- Flash ) picotool load build/reform2-trackball2-fw.uf2;;
+ Flash ) picotool load --force build/reform2-trackball2-fw.uf2;;
Exit ) exit;;
esac
done
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"
diff --git a/reform2-trackpad-fw/download-fw.sh b/reform2-trackpad-fw/download-fw.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+wget -O Mouse.hex "https://source.mnt.re/reform/reform/-/jobs/artifacts/master/raw/reform2-trackpad-fw/Mouse.hex?job=build"