Merge pull request #936 from keyboardio/f/arduino-cli

Switch us over from arduino-builder to arduino-cli
pull/982/head
Jesse Vincent 4 years ago committed by GitHub
commit 780edea8b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,62 +3,50 @@ name: Build
on: [push, pull_request]
env:
BOARD_HARDWARE_PATH: ../hardware
ARDUINO_PATH: ./arduino-1.8.13
ARDUINO_DOWNLOAD_URL: https://downloads.arduino.cc/arduino-1.8.13-linux64.tar.xz
LC_ALL: C
KALEIDOSCOPE_CCACHE: 1
ARDUINO_DIRECTORIES_USER: ${{ github.workspace }}/.arduino/user
jobs:
smoke-sketches:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git clone --quiet --depth 1 --recurse-submodules=build-tools --recurse-submodules=toolchain --recurse-submodules=avr/libraries/ --jobs 16 --shallow-submodules git://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio ../hardware/keyboardio
- run: rm -rf ../hardware/keyboardio/avr/libraries/Kaleidoscope
- run: ln -s $(pwd) ../hardware/keyboardio/avr/libraries/Kaleidoscope
# - run: make adjust-git-timestamps
- run: wget --quiet $ARDUINO_DOWNLOAD_URL -O - | tar xJf -
- run: make -j 8 smoke-sketches
## We delete the Bundle's version of Kaleidoscope, and symlink ourselves in.
## This makes sure we're using the current version of the library.
- run: sudo apt-get install ccache
- run: make setup
- run: make -j $(nproc) smoke-sketches
run-google-tests:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: git clone --quiet --depth 1 --recurse-submodules=build-tools --recurse-submodules=toolchain --recurse-submodules=avr/libraries/ --jobs 16 --shallow-submodules git://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio $HOME/Arduino/hardware/keyboardio
- run: rm -rf $HOME/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
- run: ln -s $(pwd) $HOME/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
# - run: make adjust-git-timestamps
- run: wget --quiet $ARDUINO_DOWNLOAD_URL -O - | tar xJf -
- run: BOARD_HARDWARE_PATH=$HOME/Arduino/hardware ARDUINO_PATH=$GITHUB_WORKSPACE/arduino-1.8.13 ARDUINO_BUILDER=$ARDUINO_PATH/arduino-builder make simulator-tests
# - uses: mxschmitt/action-tmate@v3
- run: sudo apt-get install ccache
- run: make setup
- run: make -j $(nproc) simulator-tests
check-astyle:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install astyle
- uses: actions/checkout@v2
- run: git clone --quiet --depth 1 --recurse-submodules=build-tools --recurse-submodules=toolchain --recurse-submodules=avr/libraries/ --jobs 16 --shallow-submodules git://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio ../hardware/keyboardio
- run: rm -rf ../hardware/keyboardio/avr/libraries/Kaleidoscope
- run: ln -s $(pwd) ../hardware/keyboardio/avr/libraries/Kaleidoscope
# - run: make adjust-git-timestamps
- run: make setup
- run: make check-astyle
check-shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git clone --quiet --depth 1 --recurse-submodules=build-tools --recurse-submodules=toolchain --recurse-submodules=avr/libraries/ --jobs 16 --shallow-submodules git://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio ../hardware/keyboardio
- run: rm -rf ../hardware/keyboardio/avr/libraries/Kaleidoscope
- run: ln -s $(pwd) ../hardware/keyboardio/avr/libraries/Kaleidoscope
- run: make setup
- run: make shellcheck
check-cpplint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git clone --quiet --depth 1 --recurse-submodules=build-tools --recurse-submodules=toolchain --recurse-submodules=avr/libraries/ --jobs 16 --shallow-submodules git://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio ../hardware/keyboardio
- run: rm -rf ../hardware/keyboardio/avr/libraries/Kaleidoscope
- run: ln -s $(pwd) ../hardware/keyboardio/avr/libraries/Kaleidoscope
# - run: make adjust-git-timestamps
- run: make setup
- run: make cpplint
find-filename-conflicts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git clone --quiet --depth 1 --recurse-submodules=build-tools --recurse-submodules=toolchain --recurse-submodules=avr/libraries/ --jobs 16 --shallow-submodules git://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio ../hardware/keyboardio
- run: rm -rf ../hardware/keyboardio/avr/libraries/Kaleidoscope
- run: ln -s $(pwd) ../hardware/keyboardio/avr/libraries/Kaleidoscope
- run: make setup
- run: make find-filename-conflicts

1
.gitignore vendored

@ -11,3 +11,4 @@
/_build/
/results/
generated-testcase.cpp
.arduino

@ -13,7 +13,6 @@ env:
global:
- LC_ALL: C
- CCACHE_WRAPPER_PATH: /tmp/kaleidoscope-ccache
- ARDUINO_DOWNLOAD_URL: https://downloads.arduino.cc/arduino-1.8.13-linux64.tar.xz
git:
quiet: true
depth: false
@ -23,17 +22,15 @@ before_install:
install:
- cd $TRAVIS_BUILD_DIR
- git clone --depth 1 --recurse-submodules=build-tools --recurse-submodules=toolchain --recurse-submodules=avr/libraries/ --jobs 16 --shallow-submodules git://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio ../hardware/keyboardio
- git clone --depth 1 --recurse-submodules=build-tools --recurse-submodules=toolchain --recurse-submodules=avr/libraries/ --jobs 16 --shallow-submodules git://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio $TRAVIS_BUILD_DIR/.arduino/user/hardware/keyboardio
## We delete the Bundle's version of Kaleidoscope, and symlink ourselves in.
## This makes sure we're using the current version of the library.
- rm -rf ../hardware/keyboardio/avr/libraries/Kaleidoscope
- ln -s $(pwd) ../hardware/keyboardio/avr/libraries/Kaleidoscope
- export KALEIDOSCOPE_TEMP_PATH=$TRAVIS_BUILD_DIR/.kaleidoscope-build-cache
- export BOARD_HARDWARE_PATH=$TRAVIS_BUILD_DIR/../hardware
- export ARDUINO_PATH=$TRAVIS_BUILD_DIR/arduino-1.8.13
- export KALEIDOSCOPE_ETC_DIR=$TRAVIS_BUILD_DIR/etc
- make adjust-git-timestamps
- wget --quiet $ARDUINO_DOWNLOAD_URL -O - | tar xJf -
- make prepare-ccache
- make install-arduino-cli
- make configure-arduino-cli
- make install-arduino-core-avr
jobs:
include:
- env: TEST_CMD="make -j 2 smoke-sketches"
@ -53,5 +50,4 @@ cache:
apt: true
ccache: true
directories:
- .download-cache
- .kaleidoscope-build-cache

@ -1,105 +1,51 @@
# This stub makefile for a Kaleidoscope plugin pulls in
# all targets from the Kaleidoscope-Plugin library
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
endif
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(info )
$(info or)
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info )
$(info ***************************************************************************)
$(info )
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
endif
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/build-tools/makefiles/
# If Kaleidoscope's Arduino libraries cannot be found, e.g. because
# they reside outside of SKETCHBOOK_DIR, we fall back to assuming that
# the hardware directory can be determined in relation to the position of
# this Makefile.
ifeq ("$(wildcard $(BOARD_HARDWARE_PATH)/keyboardio/build-tools/makefiles/rules.mk)","")
# Determine the path of this Makefile
MKFILE_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
BOARD_HARDWARE_PATH = $(MKFILE_DIR)/../../../..
endif
ifeq ("$(wildcard $(BOARD_HARDWARE_PATH)/keyboardio/build-tools/makefiles/rules.mk)","")
$(info ***************************************************************************)
$(info Unable to autodetect a proper BOARD_HARDWARE_PATH. Please define it manually.)
$(info ***************************************************************************)
$(info )
endif
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/etc/makefiles/arduino-cli.mk
# Set up an argument for passing to the simulator tests in docker
# but if the var isn't set, don't even pass the definition
# since this messes with downstream makefiles
ifneq ($(TEST_PATH),)
TEST_PATH_ARG="TEST_PATH='$(TEST_PATH)'"
TEST_PATH_ARG="TEST_PATH='$(TEST_PATH)'"
endif
DEFAULT_GOAL: smoke-sketches
clean:
$(MAKE) -C tests clean
rm -rf testing/googletest/build/*
PLUGIN_TEST_SUPPORT_DIR ?= $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/build-tools/
PLUGIN_TEST_BIN_DIR ?= $(PLUGIN_TEST_SUPPORT_DIR)/../toolchain/$(shell gcc --print-multiarch)/bin
setup: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt $(ARDUINO_CLI_PATH) configure-arduino-cli install-arduino-core-avr
@:
prepare-virtual:
$(MAKE) -C $(BOARD_HARDWARE_PATH)/keyboardio prepare-virtual
checkout-platform: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt
@:
simulator-tests: prepare-virtual
prepare-virtual: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt
@:
$(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt:
$(MAKE) -C $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio prepare-virtual
$(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt:
git clone -c core.symlinks=true --recurse-submodules=":(exclude)avr/libraries/Kaleidoscope" --recurse-submodules=build-tools --recurse-submodules=toolchain --recurse-submodules=avr/libraries/ git://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio
rm -d $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
ln -s $(KALEIDOSCOPE_DIR) $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
simulator-tests: configure-arduino-cli $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt
$(MAKE) -C tests all
docker-simulator-tests:
BOARD_HARDWARE_PATH="$(BOARD_HARDWARE_PATH)" ./bin/run-docker "make simulator-tests ${TEST_PATH_ARG}"
ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "make simulator-tests $(TEST_PATH_ARG)"
docker-clean:
ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "make clean"
docker-bash:
BOARD_HARDWARE_PATH="$(BOARD_HARDWARE_PATH)" ./bin/run-docker "bash"
ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "bash"
run-tests: prepare-virtual build-gtest-gmock
run-tests: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt build-gtest-gmock
$(MAKE) -c tests
@: # blah
@ -115,20 +61,20 @@ find-filename-conflicts:
bin/find-filename-conflicts; \
fi
#.PHONY: astyle test cpplint cpplint-noisy shellcheck smoke-examples find-filename-conflicts:
.PHONY: astyle test cpplint cpplint-noisy shellcheck smoke-examples find-filename-conflicts prepare-virtual checkout-platform adjust-git-timestamps docker-bash docker-simulator-tests run-tests simulator-tests setup
astyle:
PATH="$(PLUGIN_TEST_BIN_DIR):$(PATH)" $(PLUGIN_TEST_SUPPORT_DIR)/quality/run-astyle
bin/run-astyle
check-astyle: astyle
PATH="$(PLUGIN_TEST_BIN_DIR):$(PATH)" $(PLUGIN_TEST_SUPPORT_DIR)/quality/astyle-check
bin/astyle-check
cpplint-noisy:
-$(PLUGIN_TEST_SUPPORT_DIR)/quality/cpplint.py --filter=-legal/copyright,-build/include,-readability/namespace,-whitespace/line_length,-runtime/references --recursive --extensions=cpp,h,ino --exclude=$(BOARD_HARDWARE_PATH) src examples
-bin/cpplint.py --filter=-legal/copyright,-build/include,-readability/namespace,-whitespace/line_length,-runtime/references --recursive --extensions=cpp,h,ino src examples
cpplint:
$(PLUGIN_TEST_SUPPORT_DIR)/quality/cpplint.py --quiet --filter=-whitespace,-legal/copyright,-build/include,-readability/namespace,-runtime/references --recursive --extensions=cpp,h,ino src examples
bin/cpplint.py --quiet --filter=-whitespace,-legal/copyright,-build/include,-readability/namespace,-runtime/references --recursive --extensions=cpp,h,ino src examples
SHELL_FILES = $(shell if [ -d bin ]; then egrep -n -r -l "(env (ba)?sh)|(/bin/(ba)?sh)" bin; fi)
@ -144,13 +90,18 @@ check-docs:
python $(PLUGIN_TEST_SUPPORT_DIR)/quality/doxy-coverage.py /tmp/undocced/xml
SMOKE_SKETCHES=$(shell if [ -d ./examples ]; then find ./examples -type f -name \*ino | xargs -n 1 dirname; fi)
SMOKE_SKETCHES=$(sort $(shell if [ -d ./examples ]; then find ./examples -type f -name \*ino | xargs -n 1 dirname; fi))
smoke-sketches: $(SMOKE_SKETCHES)
@echo "Smoke-tested all the sketches"
.PHONY: force
.PHONY: force all clean test
clean:
$(MAKE) -C tests clean
rm -rf -- "testing/googletest/build/*"
rm -rf -- "_build/*"
$(SMOKE_SKETCHES): force
@BOARD_HARDWARE_PATH="$(BOARD_HARDWARE_PATH)" $(KALEIDOSCOPE_BUILDER_DIR)/kaleidoscope-builder $@ compile
$(MAKE) -C $@ -f $(KALEIDOSCOPE_ETC_DIR)/makefiles/sketch.mk compile

@ -1,5 +1,6 @@
# Kaleidoscope
Flexible firmware for Arduino-powered keyboards.
This package contains the "core" of Kaleidoscope and a number of [example firmware "Sketches"](https://github.com/keyboardio/Kaleidoscope/tree/master/examples).
@ -8,65 +9,59 @@ If you're just getting started with the Keyboardio Model 01, the [introductory d
# Getting Started
## Setup the Arduino IDE
Setup the Arduino IDE on your system. Make sure you install at least version 1.8.6, since older version may not support all required features.
If you want to use Kaleidoscope to customize or compile a "sketch" to power a supported keyboard, the fastest way to get started is to use the Arduino IDE. You can find [setup instructions](https://kaleidoscope.readthedocs.io/en/latest/quick_start.html) on [kaleidoscope.readthedocs.io](https://kaleidoscope.readthedocs.io)
* On Linux, follow the instructions [on the wiki](https://github.com/keyboardio/Kaleidoscope/wiki/Install-Arduino-support-on-Linux).
* On macOS, install using [homebrew](http://brew.sh/) [cask](https://caskroom.github.io/) with `brew cask install arduino` or download the application from [the official website](https://www.arduino.cc/en/Main/Software) and move it to your `/Applications` folder.
If you prefer to work from the command line or intend to work on Kaleidscope itself, please follow the instructions below
## Get into the right directory
# Use git to check out a copy of Kaleidoscope
### macOS
```sh
mkdir -p $HOME/Documents/Arduino/hardware
cd $HOME/Documents/Arduino/hardware
```
1. Open a commandline shell and navigate to where you want to check out Kaleidoscope.
### Linux
For the purposes of this tutorial, we'll assume your checkout is in a directory called `kaleidoscope` inside a directory called `git` in your home directory.
```sh
mkdir -p $HOME/Arduino/hardware
cd $HOME/Arduino/hardware
$ mkdir ${HOME}/git
$ cd ${HOME}/git
```
### Windows (Assuming cmd)
2. Use git to download the latest version of Kaleidoscope
```sh
mkdir %userprofile%\Documents\Arduino\hardware
cd %userprofile%\Documents\Arduino\hardware
$ git clone https://github.com/keyboardio/Kaleidoscope
```
3. Ask Kaleidoscope to install the compiler toolchain, arduino-cli and platform support
### Install the libraries and hardware definitions
## Clone the hardware definitions
```sh
$ cd ${HOME}/git/Kaleidoscope
$ make setup
```
Because git for Windows doesn't always have symlink support enabled by default, you may need to enable it for Kaleidoscope. To do that, add '-c core.symlinks=true' to your commandline. On all other platforms, that option is safe, but not necessary, as symlinks should work by default.
4. Tell your shell where to find your Kaleidoscope installation. This example is for bash. If you're using another shell, consult the shell's documentation for instructions about how to set an environment variable
```sh
git clone -c core.symlinks=true --recursive https://github.com/keyboardio/Kaleidoscope-Bundle-Keyboardio.git keyboardio
$ export KALEIDOSCOPE_DIR=${HOME}/git/Kaleidoscope
$ echo "export KALEIDOSCOPE_DIR=${HOME}/git/Kaleidoscope" >> ${HOME}/.bash_profile
```
## Build the Kaleidoscope Firmware for your keyboard
5. Build the Kaleidoscope Firmware for your keyboard
(This part assumes you're building firmware for the Keyboardio Model 01)
(This part assumes you're building firmware for the Keyboardio Atreus)
```sh
# Go to your device firmware directory
cd keyboardio/avr/libraries/Model01-Firmware
$ cd examples/Devices/Keyboardio/Atreus
# Build your firmware!
make
$ make compile
```
5. Install your firmware
# Install your firmware
make flash
```sh
$ make flash
```
<3 jesse
[![Build
Status](https://travis-ci.org/keyboardio/Kaleidoscope.svg?branch=master)](https://travis-ci.org/keyboardio/Kaleidoscope)

@ -0,0 +1,7 @@
#!/bin/sh
if ! git diff --exit-code; then
>&2 echo "'make astyle' found code style differences. Please make astyle and commit your changes"
exit 1;
fi
exit 0;

6583
bin/cpplint.py vendored

File diff suppressed because it is too large Load Diff

@ -586,6 +586,17 @@ EOF
}
deprecation_message() {
echo "kaleidoscope-builder is deprecated and will be removed"
echo "by February 15, 2021"
echo ""
echo "To switch to the new build system, replace your sketch's"
echo "Makefile with a copy of:"
echo ""
echo "${KALEIDOSCOPE_DIR}/etc/Makefile.sketch"
echo ""
}
usage () {
cat <<- EOF
Usage: $0 SKETCH commands...
@ -627,6 +638,12 @@ usage () {
EOF
}
KALEIDOSCOPE_DIR="$(cd "$(dirname "$0")"/..; pwd)"
# shellcheck disable=SC2034
KALEIDOSCOPE_BIN_DIR="${KALEIDOSCOPE_DIR}/bin/"
help () {
usage
}
@ -643,11 +660,8 @@ fi
##
## - if there is only one argument, that's a command
KALEIDOSCOPE_DIR="$(cd "$(dirname "$0")"/..; pwd)"
# shellcheck disable=SC2034
KALEIDOSCOPE_BIN_DIR="${KALEIDOSCOPE_DIR}/bin/"
deprecation_message
# shellcheck disable=SC2155
@ -668,6 +682,7 @@ done
# shellcheck disable=SC1090
if [ -n "${VERBOSE}" ] && [[ "${VERBOSE}" -gt 0 ]]; then
ARDUINO_VERBOSE="-verbose"
else

@ -0,0 +1,4 @@
#!/bin/sh
ASTYLE_IGNORE_PATTERN='testing/googletest/'
find ./* -type f \( -name '*.h' -o -name '*.cpp' -o -name '*.ino' \) | grep -v "$ASTYLE_IGNORE_PATTERN" | xargs -n 1 astyle -q --style=google --unpad-paren --pad-header --pad-oper --indent-classes --indent=spaces=2 --max-continuation-indent=80

@ -13,25 +13,28 @@ fi
if [ "${uname_S}" = "Darwin" ]; then
ARDUINO_LOCAL_LIB_PATH="${ARDUINO_LOCAL_LIB_PATH:-${HOME}/Documents/Arduino}"
# This stops macos from copying resource forks into thigns like tar
export COPYFILE_DISABLE=true
else
ARDUINO_LOCAL_LIB_PATH="${ARDUINO_LOCAL_LIB_PATH:-${HOME}/Arduino}"
fi
BOARD_HARDWARE_PATH="${BOARD_HARDWARE_PATH:-${ARDUINO_LOCAL_LIB_PATH}/hardware}"
echo "Preparing Kaleidoscope and the bundle..."
XFER_DIR="$(pwd)/.docker_xfer"
mkdir -p "${XFER_DIR}"
tar -cf "${XFER_DIR}/kaleidoscope.tar" \
--exclude .docker_xfer --exclude .git --exclude _build --exclude testing/googletest/build \
--exclude .arduino/data \
--exclude bin/arduino-cli \
--exclude .docker_xfer \
--exclude .git \
--exclude _build \
--exclude testing/googletest/build \
.
(cd "${BOARD_HARDWARE_PATH}/keyboardio" && tar -cf "${XFER_DIR}/bundle.tar" \
echo "The bundle is coming from ${ARDUINO_DIRECTORIES_USER}/hardware/keyboardio"
(cd "${ARDUINO_DIRECTORIES_USER}/hardware/keyboardio" && tar -cf "${XFER_DIR}/bundle.tar" \
--exclude .git --exclude avr/libraries/Kaleidoscope .)
echo "Building the docker image..."
@ -39,11 +42,13 @@ docker build -q -t kaleidoscope/docker etc
# We do want word splitting since there are multiple options here
# shellcheck disable=SC2086
docker run --rm $DOCKER_RUN_INTERACTIVE_OPTS \
--tmpfs /kaleidoscope:exec \
--mount type=tmpfs,destination=/kaleidoscope:exec \
--mount type=bind,source="${XFER_DIR}",destination=/kaleidoscope-src,consistency=delegated,readonly \
--mount type=volume,source=kaleidoscope-persist,destination=/kaleidoscope-persist,consistency=delegated \
--mount type=volume,source=kaleidoscope-googletest-build,destination=/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope/testing/googletest/build,consistency=delegated \
--mount type=volume,source=kaleidoscope-build,destination=/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope/_build,consistency=delegated \
--mount type=volume,source=kaleidoscope-googletest-build,destination=/kaleidoscope/testing/googletest/build,consistency=delegated \
--mount type=volume,source=kaleidoscope-build,destination=/kaleidoscope/_build,consistency=delegated \
--env ARDUINO_DIRECTORIES_DATA=/arduino-cli/data \
--env ARDUINO_DIRECTORIES_USER=/kaleidoscope/.arduino/user/ \
kaleidoscope/docker "$*"

@ -7,6 +7,7 @@ If any of this does not make sense to you, or you have trouble updating your .in
* [Upgrade notes](#upgrade-notes)
+ [New features](#new-features)
- [New build system](#new-build-system)
- [New device API](#new-device-api)
- [New plugin API](#new-plugin-api)
- [Bidirectional communication for plugins](#bidirectional-communication-for-plugins)
@ -32,6 +33,10 @@ any API we've included in a release. Typically, this means that any code that us
## New features
### New build system
In this release, we replace kaleidoscope-builder with a new Makefile based build system that uses `arduino-cli` instead of of the full Arduino IDE. This means that you can now check out development copies of Kaliedoscope into any directory, using the `KALEIDOSCOPE_DIR` environment variable to point to your installation.
### New device API
We are introducing - or rather, replacing - the older hardware plugins, with a system that's much more composable, more extensible, and will allow us to better support new devices, different MCUs, and so on.

@ -7,7 +7,7 @@ teensy2 variant too.
To select which one to build for, you can either use the Arduino IDE, and select
the appropriate Pinout and CPU, or, if using `kaleidoscope-builder`, you can add
a `LOCAL_CFLAGS` setting to `.kaleidoscope-builder.conf`.
a `LOCAL_CFLAGS` setting to your Makefile
For the post-2016 variant (the default, also used by the handwired variant from
FalbaTech), if you want to explicitly select it, add

@ -3,20 +3,16 @@ LABEL maintainer="Keyboard.io, inc"
RUN apt-get -qq update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -qq install -y xz-utils curl make build-essential libxtst-dev cmake ccache
apt-get -qq install -y xz-utils curl make build-essential libxtst-dev cmake ccache vim
RUN ccache --set-config=cache_dir=/kaleidoscope-persist/ccache/cache
ENV ARDUINO_VERSION "1.8.13"
WORKDIR /usr/local
RUN curl https://downloads.arduino.cc/arduino-${ARDUINO_VERSION}-linux64.tar.xz | \
xzcat | tar xf - && \
ln -s arduino-${ARDUINO_VERSION} arduino
RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | \
sh
RUN /usr/local/bin/arduino-cli core install arduino:avr
RUN ARDUINO_DIRECTORIES_DATA=/arduino-cli/data /bin/arduino-cli config init
RUN ARDUINO_DIRECTORIES_DATA=/arduino-cli/data /bin/arduino-cli update
RUN ARDUINO_DIRECTORIES_DATA=/arduino-cli/data /bin/arduino-cli core install arduino:avr
COPY docker-entrypoint.sh /usr/local/bin/entrypoint
@ -24,10 +20,9 @@ COPY docker-entrypoint.sh /usr/local/bin/entrypoint
VOLUME ["/kaleidoscope", \
"/kaleidoscope-src", \
"/kaleidoscope-persist", \
"/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope/testing/googletest/build", \
"/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope/_build"]
"/kaleidoscope/testing/googletest/build", \
"/kaleidoscope/_build"]
ENV BOARD_HARDWARE_PATH "/kaleidoscope/hardware"
ENV KALEIDOSCOPE_TEMP_PATH "/kaleidoscope-persist/temp"

@ -0,0 +1,48 @@
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
sketch_makefile := etc/makefiles/sketch.mk
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
ifneq ($(ks_dir),)
$(info Using Kaleidoscope from $(ks_dir))
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
else
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info I tried looking in:)
$(info )
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
null-target:
$(info You should never see this message)
@:

@ -1,20 +1,24 @@
#! /bin/bash
set -e
install -d /kaleidoscope/hardware/keyboardio \
/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope \
install -d /kaleidoscope/ \
/kaleidoscope/.arduino/user/hardware/keyboardio \
/kaleidoscope-persist/temp \
/kaleidoscope-persist/ccache/cache
echo "Syncing the bundle..."
tar xf /kaleidoscope-src/bundle.tar -C /kaleidoscope/hardware/keyboardio
echo "Syncing Kaleidoscope..."
tar xf /kaleidoscope-src/kaleidoscope.tar -C /kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope
tar xf /kaleidoscope-src/kaleidoscope.tar -C /kaleidoscope/
echo "Syncing the bundle..."
tar xf /kaleidoscope-src/bundle.tar -C /kaleidoscope/.arduino/user/hardware/keyboardio
rm -f /kaleidoscope/.arduino/user/hardware/keyboardio/avr/libraries/Kaleidoscope
ln -s /kaleidoscope /kaleidoscope/.arduino/user/hardware/keyboardio/avr/libraries/Kaleidoscope
ln -s /kaleidoscope/hardware/keyboardio/virtual/libraries/Kaleidoscope \
/kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope
cd /kaleidoscope/hardware/keyboardio/avr/libraries/Kaleidoscope
cd /kaleidoscope/
export ARDUINO_DIRECTORIES_DATA=/arduino-cli/data
export KALEIDOSCOPE_CCACHE=1
/bin/bash -c "$*"

@ -0,0 +1,4 @@
// this is a dummy sketch that's just here so that we can get
// arduino-cli to give us properties for our platform if we
// don't have a sketch, like happens when building parts of the
// simulator test infrastructure

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:keyboardio_atreus",
"port": ""
}
}

@ -0,0 +1,148 @@
mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
ifeq ($(VERBOSE),)
ifeq ($(QUIET),)
$(info Building in quiet mode. For a lot more informatiion, add 'VERBOSE=1' to the beginning of your call to $(MAKE))
export QUIET = @
endif
export ARDUINO_VERBOSE ?=
else
export ARDUINO_VERBOSE ?= --verbose
endif
# Build path config
TMPDIR ?= /tmp
export KALEIDOSCOPE_DIR ?= $(abspath $(mkfile_dir)/../..)
KALEIDOSCOPE_BIN_DIR ?= $(KALEIDOSCOPE_DIR)/bin
KALEIDOSCOPE_ETC_DIR ?= $(KALEIDOSCOPE_DIR)/etc
KALEIDOSCOPE_TEMP_PATH ?= $(TMPDIR)/kaleidoscope-$(USER)
KALEIDOSCOPE_BUILD_PATH ?= $(KALEIDOSCOPE_TEMP_PATH)/build
KALEIDOSCOPE_OUTPUT_PATH ?= $(KALEIDOSCOPE_TEMP_PATH)/output
CORE_CACHE_PATH ?= $(KALEIDOSCOPE_TEMP_PATH)/arduino-cores
ARDUINO_CONTENT ?= $(KALEIDOSCOPE_DIR)/.arduino
export ARDUINO_DIRECTORIES_DATA ?= $(ARDUINO_CONTENT)/data
export ARDUINO_DIRECTORIES_DOWNLOADS ?= $(ARDUINO_CONTENT)/downloads
export ARDUINO_CLI_CONFIG ?= $(ARDUINO_DIRECTORIES_DATA)/arduino-cli.yaml
export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS ?= https://raw.githubusercontent.com/keyboardio/boardsmanager/master/package_keyboardio_index.json
# If it looks like Kaleidoscope is inside a "traditional" Arduino hardware directory
# in the user's homedir, let's use that.
ifeq ($(shell uname -s),Darwin)
traditional_path = $(HOME)/Documents/Arduino/
else
traditional_path = $(HOME)/Arduino/
endif
# use realpath to compare the real absolute path of the kaleidoscope dir
# and the arduino bundle, even if they're symlinked into the Arudino/hardware dir
ifeq ($(realpath $(traditional_path)/hardware/keyboardio/avr/libraries/Kaleidoscope), $(realpath $(KALEIDOSCOPE_DIR)))
export ARDUINO_DIRECTORIES_USER ?= $(traditional_path)
endif
# Otherwise, use the arduino-cli bundle
export ARDUINO_DIRECTORIES_USER ?= $(ARDUINO_CONTENT)/user
# If we're not calling setup, we should freak out if the hardware
# definitions don't exist
ifneq ($(MAKECMDGOALS),setup)
ifeq ($(wildcard $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt),)
$(info Kaleidoscope hardware definitions not found in)
$(info $(ARDUINO_DIRECTORIES_USER))
$(info )
$(info You may be able to resolve this issue by running the following command)
$(info to initialize Kaleidoscope )
$(info )
$(info $(MAKE) -C $(KALEIDOSCOPE_DIR) setup )
$(info )
$(error )
endif
endif
system_arduino_cli=$(shell command -v arduino-cli || true)
arduino_env = ARDUINO_DIRECTORIES_USER=$(ARDUINO_DIRECTORIES_USER) \
ARDUINO_DIRECTORIES_DATA=$(ARDUINO_DIRECTORIES_DATA)
ifeq ($(system_arduino_cli),)
export ARDUINO_CLI_PATH ?= $(KALEIDOSCOPE_BIN_DIR)/arduino-cli
else
export ARDUINO_CLI_PATH ?= $(system_arduino_cli)
endif
export ARDUINO_CLI ?= $(arduino_env) $(ARDUINO_CLI_PATH)
ifneq ($(VERBOSE),)
$(info Using ardino-cli from $(ARDUINO_CLI_PATH))
endif
ifneq ($(FQBN),)
fqbn_arg = --fqbn $(FQBN)
endif
# if we don't have a sketch, make a pretend one so we can run --show properties
# This is because arduino-cli doesn't currently allow us to get props with
# just an FQBN. We've filed a bug with them
ifeq ($(SKETCH_FILE_PATH),)
_arduino_props_sketch_arg = $(KALEIDOSCOPE_ETC_DIR)/dummy-sketch/
else
_arduino_props_sketch_arg = $(SKETCH_FILE_PATH)
endif
# This is horrible. But because make doesn't really support
# multi-line variables and we want to cache the full
# _arduino_props in a variable, which means letting make
# split the properties on space, which is what it converts
# newlines into. To make this go, we we need to replace interior
# spaces in the variables with something. We chose the fire
# emoji, since it accurately represents our feelings on this
# state of affairs. Later, when finding props, we need to reverse
# this process, turning fire into space.
_arduino_props := $(shell ${ARDUINO_CLI} compile $(fqbn_arg) --show-properties "$(_arduino_props_sketch_arg)"|perl -p -e"s/ /🔥/g")
_arduino_prop = $(subst $1=,,$(subst 🔥, ,$(filter $1=%,$(_arduino_props))))
# How to use_arduino_prop
# $(call _arduino_prop,recipe.hooks.sketch.prebuild.2.pattern)
ifneq ($(KALEIDOSCOPE_CCACHE),)
ccache_wrapper_property := --build-properties "compiler.wrapper.cmd=ccache"
endif
.PHONY: configure-arduino-cli install-arduino-core-kaleidoscope install-arduino-core-avr
.PHONY: stupid-workaround-for-make-inclusion-semantics
stupid-workaround-for-make-inclusion-semantics: DEFAULT_GOAL
@: # This is here so that the sketch makefile including this file doesn't
@: # default to arduino-cli installation as its priamry target
$(KALEIDOSCOPE_BIN_DIR)/arduino-cli:
$(QUIET) curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR="$(KALEIDOSCOPE_BIN_DIR)" sh
install-arduino-cli: $(KALEIDOSCOPE_BIN_DIR)/arduino-cli
configure-arduino-cli:
$(QUIET) $(ARDUINO_CLI) config init
install-arduino-core-kaleidoscope:
$(QUIET) $(ARDUINO_CLI) core install "keyboardio:avr"
install-arduino-core-avr:
$(QUIET) $(ARDUINO_CLI) core install "arduino:avr"

@ -0,0 +1,211 @@
mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
# If the sketch is defined
ifneq ($(SKETCH),)
# If the sketch isn't a directory, we want to get the directory the sketch is in
ifeq ($(wildcard $(SKETCH)/.),)
SKETCH_DIR := $(dir $(SKETCH))
endif
else
# If the sketch wasn't defined as we came in, assume the current directory
# is where we're looking
SKETCH_DIR := $(realpath $(CURDIR))
endif
SKETCH_BASE_NAME := $(notdir $(SKETCH_DIR))
SKETCH_FILE_NAME := $(addsuffix .ino, $(SKETCH_BASE_NAME))
# Find the path of the sketch file
SKETCH_DIR_CANDIDATES = $(sketch_dir) src/ .
sketch_exists_p = $(realpath $(wildcard $(dir)/$(SKETCH_FILE_NAME)))
SKETCH_FILE_PATH := $(firstword $(foreach dir,$(SKETCH_DIR_CANDIDATES),$(sketch_exists_p)))
include $(mkfile_dir)/arduino-cli.mk
ifeq ($(FQBN),)
export FQBN = $(call _arduino_prop,build.fqbn)
ifneq ($(VERBOSE),)
$(info Arduino provided FQBN $(call _arduino_prop,build.fqbn))
endif
endif
# We -could- check to see if sketch-dir is in git before running this command
# but since we'd just return an empty value in that case, why bother?
GIT_VERSION := $(shell git -C "$(SKETCH_DIR)" describe --abbrev=6 --dirty --alway 2>/dev/null || echo 'unknown')
SKETCH_IDENTIFIER ?= $(shell echo "${SKETCH_FILE_PATH}" | cksum | cut -d ' ' -f 1)-$(SKETCH_FILE_NAME)
BUILD_PATH ?= $(KALEIDOSCOPE_BUILD_PATH)/$(SKETCH_IDENTIFIER)
OUTPUT_PATH ?= $(KALEIDOSCOPE_OUTPUT_PATH)/$(SKETCH_IDENTIFIER)
OUTPUT_FILE_PREFIX := $(SKETCH_BASE_NAME)-$(GIT_VERSION)
HEX_FILE_PATH := $(OUTPUT_PATH)/$(OUTPUT_FILE_PREFIX).hex
HEX_FILE_WITH_BOOTLOADER_PATH := $(OUTPUT_PATH)/$(OUTPUT_FILE_PREFIX)-with-bootloader.hex
ELF_FILE_PATH := $(OUTPUT_PATH)/$(OUTPUT_FILE_PREFIX).elf
LIB_FILE_PATH := $(OUTPUT_PATH)/$(OUTPUT_FILE_PREFIX).a
KALEIDOSCOPE_PLATFORM_LIB_DIR := $(abspath $(KALEIDOSCOPE_DIR)/..)
ifeq ($(FQBN),)
possible_fqbns = $(shell $(ARDUINO_CLI) board list --format=json |grep FQBN| grep -v "keyboardio:virtual"|cut -d: -f 2-)
possible_fqbn = $(firstword $(possible_fqbns))
$(info *************************************************************** )
$(info )
$(info Arduino couldn't figure out what kind of device this sketch )
$(info is for. Usually, Arduino looks in a file called `sketch.json` )
$(info to figure this out. )
ifneq ($(possible_fqbn),)
fake_var_to_run_shell := $(shell $(ARDUINO_CLI) board attach $(possible_fqbn))
$(info )
$(info I have detected a connected device supported by Kaleidoscope and)
$(info attepted to automatically resolve this issue by running the)
$(info following command:)
$(info )
$(info $(ARDUINO_CLI) board attach $(possible_fqbn))
$(info )
$(info If the build fails or $(possible_fqbn) doesn't)
$(info look like your keyboard, you may need to manually edit your)
$(info `sketch.json` file or run )
$(info )
$(info $(ARDUINO_CLI) board attach )
$(info )
$(info manually, specifying the FQBN for your keyboard. )
$(info )
$(info *************************************************************** )
else
$(info )
$(info I'm unable to detect your keyboard, you may need to manually )
$(info edit your `sketch.json` file or run )
$(info )
$(info $(ARDUINO_CLI) board attach )
$(info )
$(info manually, specifying the FQBN for your keyboard. )
$(info )
$(info *************************************************************** )
$(error )
endif
endif
# Flashing related config
ifneq ($(FQBN),)
KALEIDOSCOPE_DEVICE_PORT ?= $(shell $(ARDUINO_CLI) board list --format=text | grep $(FQBN) |cut -d' ' -f 1)
endif
flashing_instructions := $(shell printf $(call _arduino_prop,build.flashing_instructions))
ifeq ($(flashing_instructions),)
flashing_instruction := "If your keyboard needs you to do something to put it in flashing mode, do that now."
endif
DEFAULT_GOAL: compile
#$(SKETCH_FILE_PATH):
# @: # dummy recipe for the sketch file
.PHONY: compile configure-arduino-cli install-arduino-core-kaleidoscope install-arduino-core-avr
.PHONY: disassemble decompile size-map flash clean all test
all: compile
@: ## Do not remove this line, otherwise `make all` will trigger the `%` rule too.
disassemble: ${ELF_FILE_PATH}
$(call _arduino_prop,compiler.objdump.cmd) \
$(call _arduino_prop,compiler.objdump.flags) \
"${ELF_FILE_PATH}"
size-map: ${ELF_FILE_PATH}
$(call _arduino_prop,compiler.size-map.cmd) \
$(call _arduino_prop,compiler.size-map.flags) \
"${ELF_FILE_PATH}"
flash: ${HEX_FILE_PATH}
${ELF_FILE_PATH}: compile
${HEX_FILE_PATH}: compile
BOOTLOADER_PATH := $(call _arduino_prop,runtime.platform.path)/bootloaders/$(call _arduino_prop,bootloader.file)
hex-with-bootloader: ${HEX_FILE_PATH}
$(QUIET) awk '/^:00000001FF/ == 0' "${HEX_FILE_PATH}" >"${HEX_FILE_WITH_BOOTLOADER_PATH}"
$(QUIET) cat "${BOOTLOADER_PATH}" >>"${HEX_FILE_WITH_BOOTLOADER_PATH}"
$(QUIET) ln -sf -- "${OUTPUT_FILE_PREFIX}-with-bootloader.hex" "${OUTPUT_PATH}/${SKETCH_BASE_NAME}-latest-with-bootloader.hex"
$(info Combined firmware and bootloader are now at)
$(info ${HEX_FILE_WITH_BOOTLOADER_PATH})
$(info )
$(info Make sure you have the bootloader version you expect.)
$(info )
$(info )
$(info And TEST THIS ON REAL HARDWARE BEFORE YOU GIVE IT TO ANYONE.)
clean:
$(QUIET) rm -rf -- "${OUTPUT_PATH}"/*
ifneq ($(LOCAL_CFLAGS),)
local_cflags_property = --build-properties "compiler.cpp.extra_flags=${LOCAL_CFLAGS}"
else
local_cflags_property =
endif
compile:
$(QUIET) install -d "${OUTPUT_PATH}"
$(QUIET) $(ARDUINO_CLI) compile --fqbn "${FQBN}" ${ARDUINO_VERBOSE} --warnings all ${ccache_wrapper_property} ${local_cflags_property} \
--libraries "${KALEIDOSCOPE_PLATFORM_LIB_DIR}" \
--build-path "${BUILD_PATH}" \
--output-dir "${OUTPUT_PATH}" \
--build-cache-path "${CORE_CACHE_PATH}" \
"${SKETCH_FILE_PATH}"
ifeq ($(LIBONLY),)
$(QUIET) cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.hex" "${HEX_FILE_PATH}"
$(QUIET) cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.elf" "${ELF_FILE_PATH}"
$(QUIET) ln -sf "${OUTPUT_FILE_PREFIX}.hex" "${OUTPUT_PATH}/${SKETCH_BASE_NAME}-latest.hex"
$(QUIET) ln -sf "${OUTPUT_FILE_PREFIX}.elf" "${OUTPUT_PATH}/${SKETCH_BASE_NAME}-latest.elf"
else
$(QUIET) cp "${BUILD_PATH}/${SKETCH_FILE_NAME}.a" "${LIB_FILE_PATH}"
$(QUIET) ln -sf "${OUTPUT_FILE_PREFIX}.a" "${OUTPUT_PATH}/${SKETCH_BASE_NAME}-latest.a"
endif
ifneq ($(VERBOSE),)
$(info Build artifacts can be found in ${BUILD_PATH})
endif
#TODO (arduino team) I'd love to do this with their json output
#but it's short some of the data we kind of need
flash:
ifeq ($(KALEIDOSCOPE_DEVICE_PORT),)
$(info ERROR: Unable to detect keyboard serial port.)
$(info )
$(info Arduino should autodetect it, but you could also set )
$(info KALEIDOSCOPE_DEVICE_PORt to your keyboard's serial port.)
$(info )
$(error )
endif
$(info $(flashing_instructions))
$(info )
$(info When you're ready to proceed, press 'Enter'.)
$(info )
@$(shell read)
$(QUIET) $(ARDUINO_CLI) upload --fqbn $(FQBN) \
--input-dir "${OUTPUT_PATH}" \
--port $(KALEIDOSCOPE_DEVICE_PORT) $(ARDUINO_VERBOSE)

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -1,24 +0,0 @@
flash_over_usb() {
sleep 1s
echo "Please reset your keyboard!"
teensy_loader_cli --mcu "${MCU}" -w "${HEX_FILE_PATH}"
}
flash () {
prepare_to_flash
# This is defined in the (optional) user config.
# shellcheck disable=SC2154
${preFlash_HOOKS}
flash_over_usb || flash_over_usb
# This is defined in the (optional) user config.
# shellcheck disable=SC2154
${postFlash_HOOKS}
}
NO_RESET=1
DEFAULT_SKETCH="ErgoDox"
BOARD="ergodox"

@ -1,55 +1,48 @@
# This stub makefile for a Kaleidoscope example pulls in all the targets
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
sketch_makefile := etc/makefiles/sketch.mk
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
ifneq ($(ks_dir),)
$(info Using Kaleidoscope from $(ks_dir))
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
else
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(info I tried looking in:)
$(info )
$(info or)
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info )
$(info ***************************************************************************)
$(info )
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
null-target:
$(info You should never see this message)
@:

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:ergodox",
"port": ""
}
}

@ -1,26 +0,0 @@
flash_over_usb() {
sleep 1s
dfu-programmer ${MCU} erase
dfu-programmer ${MCU} flash "${HEX_FILE_PATH}"
dfu-programmer ${MCU} start
}
flash () {
prepare_to_flash
# This is defined in the (optional) user config.
# shellcheck disable=SC2154
${preFlash_HOOKS}
flash_over_usb || flash_over_usb
# This is defined in the (optional) user config.
# shellcheck disable=SC2154
${postFlash_HOOKS}
}
NO_RESET=1
DEFAULT_SKETCH="KBD4x"
BOARD="kbd4x"

@ -1,55 +1,48 @@
# This stub makefile for a Kaleidoscope example pulls in all the targets
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
sketch_makefile := etc/makefiles/sketch.mk
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
ifneq ($(ks_dir),)
$(info Using Kaleidoscope from $(ks_dir))
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
else
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(info I tried looking in:)
$(info )
$(info or)
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info )
$(info ***************************************************************************)
$(info )
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
null-target:
$(info You should never see this message)
@:

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:kbd4x",
"port": ""
}
}

@ -1,56 +1,48 @@
# This stub makefile for a Kaleidoscope example pulls in all the targets
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
sketch_makefile := etc/makefiles/sketch.mk
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
ifneq ($(ks_dir),)
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
$(info Using Kaleidoscope from $(ks_dir))
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(info )
$(info or)
else
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info I tried looking in:)
$(info )
$(info ***************************************************************************)
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
endif
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
null-target:
$(info You should never see this message)
@:

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:keyboardio_atreus",
"port": ""
}
}

@ -1,2 +0,0 @@
BOARD="keyboardio_imago"
SKETCH="Imago"

@ -1,55 +1,48 @@
# This stub makefile for a Kaleidoscope example pulls in all the targets
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
sketch_makefile := etc/makefiles/sketch.mk
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
ifneq ($(ks_dir),)
$(info Using Kaleidoscope from $(ks_dir))
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
else
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(info I tried looking in:)
$(info )
$(info or)
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info )
$(info ***************************************************************************)
$(info )
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
null-target:
$(info You should never see this message)
@:

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:keyboardio_imago",
"port": ""
}
}

@ -1,71 +1,48 @@
# This stub makefile for a Kaleidoscope example pulls in all the targets
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
endif
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(info )
$(info or)
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info )
$(info ***************************************************************************)
$(info )
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
sketch_makefile := etc/makefiles/sketch.mk
endif
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/
ifneq ($(ks_dir),)
ifneq ("$(wildcard $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk)","")
$(info Using Kaleidoscope from $(ks_dir))
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
else
$(info ****************************************************************************)
$(info I can't find an installed copy of Kaleidoscope's source code.)
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info This usually means you're attempting to build a device's firmware from a git)
$(info checkout without having previously told Arduino where to find Kaleidoscope.)
$(info I tried looking in:)
$(info )
$(info It is probably the case that you want to move or symlink your git checkout )
$(info of the Kaleidoscope bundle to the directory: )
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio )
$(info ****************************************************************************)
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
null-target:
$(info You should never see this message)
@:

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -1,2 +0,0 @@
DEFAULT_SKETCH="Planck"
BOARD="planck"

@ -1,55 +1,48 @@
# This stub makefile for a Kaleidoscope example pulls in all the targets
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
sketch_makefile := etc/makefiles/sketch.mk
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
ifneq ($(ks_dir),)
$(info Using Kaleidoscope from $(ks_dir))
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
else
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(info I tried looking in:)
$(info )
$(info or)
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info )
$(info ***************************************************************************)
$(info )
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
null-target:
$(info You should never see this message)
@:

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:planck",
"port": ""
}
}

@ -1,25 +0,0 @@
flash_over_usb() {
sleep 1s
dfu-programmer ${MCU} erase
dfu-programmer ${MCU} flash "${HEX_FILE_PATH}"
dfu-programmer ${MCU} start
}
flash () {
prepare_to_flash
# This is defined in the (optional) user config.
# shellcheck disable=SC2154
${preFlash_HOOKS}
flash_over_usb || flash_over_usb
# This is defined in the (optional) user config.
# shellcheck disable=SC2154
${postFlash_HOOKS}
}
NO_RESET=1
DEFAULT_SKETCH="Splitography"
BOARD="splitography"

@ -1,52 +1,48 @@
# This stub makefile for a Kaleidoscope example pulls in all the targets
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
sketch_makefile := etc/makefiles/sketch.mk
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
ifneq ($(ks_dir),)
$(info Using Kaleidoscope from $(ks_dir))
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
else
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info I tried looking in:)
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info or)
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info )
$(info ***************************************************************************)
$(info )
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
null-target:
$(info You should never see this message)
@:

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:splitography",
"port": ""
}
}

@ -1,24 +0,0 @@
flash_over_usb() {
sleep 1s
echo "Please reset your keyboard!"
teensy_loader_cli --mcu "${MCU}" -w "${HEX_FILE_PATH}"
}
flash () {
prepare_to_flash
# This is defined in the (optional) user config.
# shellcheck disable=SC2154
${preFlash_HOOKS}
flash_over_usb || flash_over_usb
# This is defined in the (optional) user config.
# shellcheck disable=SC2154
${postFlash_HOOKS}
}
NO_RESET=1
DEFAULT_SKETCH="Atreus"
BOARD="atreus"

@ -1,55 +1,48 @@
# This stub makefile for a Kaleidoscope example pulls in all the targets
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
sketch_makefile := etc/makefiles/sketch.mk
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
ifneq ($(ks_dir),)
$(info Using Kaleidoscope from $(ks_dir))
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
else
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(info I tried looking in:)
$(info )
$(info or)
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info )
$(info ***************************************************************************)
$(info )
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
null-target:
$(info You should never see this message)
@:

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:atreus",
"port": ""
}
}

@ -1,2 +0,0 @@
DEFAULT_SKETCH="ButterStick"
BOARD="gheavy_butterstick"

@ -1,55 +1,48 @@
# This stub makefile for a Kaleidoscope example pulls in all the targets
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
sketch_makefile := etc/makefiles/sketch.mk
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
ifneq ($(ks_dir),)
$(info Using Kaleidoscope from $(ks_dir))
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
else
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(info I tried looking in:)
$(info )
$(info or)
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info )
$(info ***************************************************************************)
$(info )
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
null-target:
$(info You should never see this message)
@:

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:gheavy_butterstick",
"port": ""
}
}

@ -1,2 +0,0 @@
DEFAULT_SKETCH="FaunchPad"
BOARD="gheavy_faunchpad"

@ -1,55 +1,48 @@
# This stub makefile for a Kaleidoscope example pulls in all the targets
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
sketch_makefile := etc/makefiles/sketch.mk
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
ifneq ($(ks_dir),)
$(info Using Kaleidoscope from $(ks_dir))
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
else
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(info I tried looking in:)
$(info )
$(info or)
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info )
$(info ***************************************************************************)
$(info )
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
null-target:
$(info You should never see this message)
@:

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:gheavy_faunchpad",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -1,55 +1,48 @@
# This stub makefile for a Kaleidoscope example pulls in all the targets
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
sketch_makefile := etc/makefiles/sketch.mk
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
ifneq ($(ks_dir),)
$(info Using Kaleidoscope from $(ks_dir))
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
else
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(info I tried looking in:)
$(info )
$(info or)
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info )
$(info ***************************************************************************)
$(info )
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
null-target:
$(info You should never see this message)
@:

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -0,0 +1,6 @@
{
"cpu": {
"fqbn": "keyboardio:avr:model01",
"port": ""
}
}

@ -1,5 +1,2 @@
**/bin/
**/lib/
**/obj/
/googletest/googletest/generated/
/googletest/build/

@ -1,73 +1,48 @@
# This stub makefile for a Kaleidoscope plugin pulls in
# all targets from the Kaleidoscope-Plugin library
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino
PACKAGE_DIR ?= $(HOME)/Library/Arduino15
else
SKETCHBOOK_DIR ?= $(HOME)/Arduino
PACKAGE_DIR ?= $(HOME)/.arduino15
endif
ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1)
MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1)
# This makefile for a Kaleidoscope sketch pulls in all the targets
# required to build the example
ifneq ("$(wildcard $(ARDUINO_INSTALLED_ENV)/boards.txt)","")
ifneq ("$(wildcard $(MANUALLY_INSTALLED_ENV)/boards.txt)","")
$(info ***************************************************************************)
$(info It appears that you have installed two copies of Kaleidoscope. One copy was)
$(info installed using Arduino's "Board Manager", while the other was installed by)
$(info hand, probably using "git".)
$(info )
$(info This will likely cause some trouble as you try to build keyboard firmware)
$(info using Kaleidoscope. You may want to remove either: )
$(info )
$(info $(PACKAGE_DIR)/packages/keyboardio/ which was installed using Arduino)
$(info )
$(info or)
$(info )
$(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.)
$(info )
$(info ***************************************************************************)
$(info )
ifneq ($(KALEIDOSCOPE_DIR),)
search_path += $(KALEIDOSCOPE_DIR)
endif
ifneq ($(ARDUINO_DIRECTORIES_USER),)
search_path += $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV)
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/
KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/
ifeq ($(shell uname -s),Darwin)
search_path += $(HOME)/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
else
search_path += $(HOME)/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope
endif
sketch_makefile := etc/makefiles/sketch.mk
$(foreach candidate, $(search_path), $(if $(wildcard $(candidate)/$(sketch_makefile)), $(eval ks_dir ?= $(candidate))))
endif
ifneq ($(ks_dir),)
$(info Using Kaleidoscope from $(ks_dir))
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/build-tools/makefiles/
export KALEIDOSCOPE_DIR := $(ks_dir)
include $(ks_dir)/$(sketch_makefile)
# If Kaleidoscope's Arduino libraries cannot be found, e.g. because
# they reside outside of SKETCHBOOK_DIR, we fall back to assuming that
# the hardware directory can be determined in relation to the position of
# this Makefile.
ifeq ("$(wildcard $(BOARD_HARDWARE_PATH)/keyboardio/build-tools/makefiles/rules.mk)","")
# Determine the path of this Makefile
MKFILE_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
BOARD_HARDWARE_PATH = $(MKFILE_DIR)/../../../../../..
endif
else
ifeq ("$(wildcard $(BOARD_HARDWARE_PATH)/keyboardio/build-tools/makefiles/rules.mk)","")
$(info ***************************************************************************)
$(info Unable to autodetect a proper BOARD_HARDWARE_PATH. Please define it manually.)
$(info ***************************************************************************)
$(info I can't find your Kaleidoscope installation.)
$(info )
$(info I tried looking in:)
$(info )
$(foreach candidate, $(search_path), $(info $(candidate)))
$(info )
$(info The easiest way to fix this is to set the 'KALEIDOSCOPE_DIR' environment)
$(info variable to the location of your Kaleidoscope directory.)
endif
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk
null-target:
$(info You should never see this message)
@:

@ -1,51 +1,41 @@
top_dir := $(dir $(lastword ${MAKEFILE_LIST}))../..
build_dir := ${top_dir}/_build
mkfile_dir := $(dir $(lastword ${MAKEFILE_LIST}))
top_dir := $(abspath $(mkfile_dir)../..)
ifndef BOARD_HARDWARE_PATH
bundle_path = ${top_dir}/..
else
bundle_path = ${BOARD_HARDWARE_PATH}/keyboardio/avr/libraries
endif
include $(mkfile_dir)/shared.mk
build_dir := ${top_dir}/_build
LIB_DIR := ${build_dir}/lib
OBJ_DIR := ${build_dir}/obj
CXX_FILES := $(wildcard ${top_dir}/testing/*.cpp)
H_FILES := $(wildcard ${top_dir}/testing/*.h)
CXX_FILES := $(sort $(wildcard ${top_dir}/testing/*.cpp))
H_FILES := $(sort $(wildcard ${top_dir}/testing/*.h))
BARE_CXX_FILES := $(foreach path,${CXX_FILES},$(notdir ${path}))
OBJ_FILES := $(patsubst %.cpp,${OBJ_DIR}/%.o,$(BARE_CXX_FILES))
LIB_FILE := libcommon.a
ifneq ($(KALEIDOSCOPE_CCACHE),)
COMPILER_WRAPPER := ccache
endif
.PHONY: all
DEFAULT_GOAL: all
all: ${OBJ_FILES} ${LIB_DIR}/${LIB_FILE}
${LIB_DIR}/${LIB_FILE}: ${OBJ_FILES}
@install -d "${LIB_DIR}"
ar rcs "${LIB_DIR}/${LIB_FILE}" ${OBJ_FILES}
$(QUIET) install -d "${LIB_DIR}"
$(QUIET) $(call _arduino_prop,compiler.ar.cmd) $(call _arduino_prop,compiler.ar.flags) "${LIB_DIR}/${LIB_FILE}" ${OBJ_FILES}
${OBJ_DIR}/%.o: ${top_dir}/testing/%.cpp ${H_FILES}
@echo "compile $@"
@install -d "${OBJ_DIR}"
g++ -o "$@" -c \
-std=c++14 \
-I${top_dir} \
-I${top_dir}/src \
-I${bundle_path}/../../virtual/cores/arduino \
-I${bundle_path}/Kaleidoscope-HIDAdaptor-KeyboardioHID/src \
-I${bundle_path}/KeyboardioHID/src \
-I${top_dir}/testing/googletest/googlemock/include \
-I${top_dir}/testing/googletest/googletest/include \
-DARDUINO=10607 \
-DARDUINO_ARCH_VIRTUAL \
-DARDUINO_AVR_MODEL01 \
'-DKALEIDOSCOPE_HARDWARE_H="Kaleidoscope-Hardware-Model01.h"' \
-DKALEIDOSCOPE_VIRTUAL_BUILD=1 \
-DKEYBOARDIOHID_BUILD_WITHOUT_HID=1 \
-DUSBCON=dummy \
-DARDUINO_ARCH_AVR=1 \
'-DUSB_PRODUCT="Model 01"' \
$<
$(info compile $@)
$(QUIET) install -d "${OBJ_DIR}"
$(QUIET) $(COMPILER_WRAPPER) $(call _arduino_prop,compiler.cpp.cmd) -o "$@" -c -std=c++14 ${shared_includes} ${shared_defines} $<
clean:
rm -rf "${build_dir}"
$(QUIET) rm -rf -- "${build_dir}"
include $(top_dir)/etc/makefiles/arduino-cli.mk

@ -0,0 +1,21 @@
arduino_platform_path := ${ARDUINO_DIRECTORIES_USER}/hardware/keyboardio/virtual/
shared_defines := \
-DARDUINO=10607 \
-DARDUINO_ARCH_VIRTUAL \
-DKALEIDOSCOPE_VIRTUAL_BUILD=1 \
-DKEYBOARDIOHID_BUILD_WITHOUT_HID=1 \
-DUSBCON=dummy \
-DARDUINO_ARCH_AVR=1 \
-DARDUINO_AVR_MODEL01 \
'-DKALEIDOSCOPE_HARDWARE_H="Kaleidoscope-Hardware-Model01.h"' \
'-DUSB_PRODUCT="Model 01"'
shared_includes := \
-I${top_dir} \
-I${top_dir}/src \
-I${arduino_platform_path}/cores/arduino \
-I${arduino_platform_path}/libraries/KeyboardioHID/src \
-I${top_dir}/testing/googletest/googlemock/include \
-I${top_dir}/testing/googletest/googletest/include \

@ -1,5 +1,7 @@
top_dir := $(dir $(lastword ${MAKEFILE_LIST}))../..
mkfile_dir := $(dir $(lastword ${MAKEFILE_LIST}))
top_dir := $(abspath $(mkfile_dir)../..)
include $(mkfile_dir)/shared.mk
build_dir := ${top_dir}/_build/${testcase}
@ -9,13 +11,20 @@ BIN_DIR := ${build_dir}/bin
COMMON_LIB_DIR := ${top_dir}/_build/lib
include $(top_dir)/etc/makefiles/arduino-cli.mk
ifneq ($(KALEIDOSCOPE_CCACHE),)
COMPILER_WRAPPER := ccache
endif
SRC_DIR := test
SKETCH_FILE=$(wildcard *.ino)
BIN_FILE=$(subst .ino,,$(SKETCH_FILE))
LIB_FILE=${BIN_FILE}-latest.a
TEST_FILES=$(wildcard $(SRC_DIR)/*.cpp)
TEST_FILES=$(sort $(wildcard $(SRC_DIR)/*.cpp))
# If we have a ktest file and no generated testcase,
# we want to turn it into a generated testcase
@ -28,48 +37,31 @@ TEST_FILES += $(SRC_DIR)/generated-testcase.cpp
endif
endif
.DEFAULT_GOAL := build
TEST_OBJS=$(patsubst $(SRC_DIR)/%.cpp,${OBJ_DIR}/%.o,$(TEST_FILES))
ifndef BOARD_HARDWARE_PATH
bundle_path = ${top_dir}/..
else
bundle_path = ${BOARD_HARDWARE_PATH}/keyboardio/avr/libraries
endif
build: ${BIN_DIR}/${BIN_FILE} compile-sketch
all: run
run: ${BIN_DIR}/${BIN_FILE}
@echo "run"
"${BIN_DIR}/${BIN_FILE}" -t -q
$(QUIET) "${BIN_DIR}/${BIN_FILE}" -t -q
${BIN_DIR}/${BIN_FILE}: ${TEST_OBJS}
# We force sketch recompiliation because otherwise, make won't pick up changes to...anything on the arduino side
compile-sketch:
@echo "link"
install -d "${BIN_DIR}" "${LIB_DIR}"
env LIBONLY=yes \
LOCAL_CFLAGS='"-I$(shell pwd)"' \
OUTPUT_PATH="${LIB_DIR}" \
VERBOSE=${VERBOSE} \
ARCH=virtual DEFAULT_SKETCH=sketch \
compile-sketch: ${TEST_OBJS}
@install -d "${BIN_DIR}" "${LIB_DIR}"
$(QUIET) env LIBONLY=yes VERBOSE=${VERBOSE} \
OUTPUT_PATH="${LIB_DIR}" \
$(MAKE) -f ${top_dir}/testing/makefiles/delegate.mk compile
g++ -o "${BIN_DIR}/${BIN_FILE}" \
-lpthread \
-g \
-w \
${TEST_OBJS} \
-L"${COMMON_LIB_DIR}" \
-lcommon \
$(QUIET) $(COMPILER_WRAPPER) $(call _arduino_prop,compiler.cpp.cmd) -o "${BIN_DIR}/${BIN_FILE}" \
-lpthread -g -w ${TEST_OBJS} \
-L"${COMMON_LIB_DIR}" -lcommon \
"${LIB_DIR}/${LIB_FILE}" \
-L"${top_dir}/testing/googletest/build/lib" \
-lgtest \
-lgmock \
-lpthread \
-lm
-lgtest -lgmock -lpthread -lm
# If we have a test.ktest file, it should be processed into a c++ testcase
@ -79,37 +71,20 @@ generate-testcase: $(if $(HAS_KTEST_FILE), ${SRC_DIR}/generated-testcase.cpp)
${SRC_DIR}/generated-testcase.cpp: test.ktest
ifneq (,$(wildcard test.ktest))
@echo "Compiling ${testcase} ktest script into ${SRC_DIR}/generated-testcase.cpp"
install -d "${SRC_DIR}"
perl ${top_dir}/testing/bin/ktest-to-cxx \
$(info Compiling ${testcase} ktest script into ${SRC_DIR}/generated-testcase.cpp)
$(QUIET) install -d "${SRC_DIR}"
$(QUIET) perl ${top_dir}/testing/bin/ktest-to-cxx \
--ktest=test.ktest \
--cxx=${SRC_DIR}/generated-testcase.cpp
endif
${OBJ_DIR}/%.o: ${SRC_DIR}/%.cpp
@echo "compile $@"
install -d "${OBJ_DIR}"
g++ -o "$@" -c \
-std=c++14 \
-I${top_dir} \
-I${top_dir}/src \
-I${bundle_path}/../../virtual/cores/arduino \
-I${bundle_path}/KeyboardioHID/src \
-I${top_dir}/testing/googletest/googlemock/include \
-I${top_dir}/testing/googletest/googletest/include \
-DARDUINO=10607 \
-DARDUINO_ARCH_VIRTUAL \
-DARDUINO_AVR_MODEL01 \
'-DKALEIDOSCOPE_HARDWARE_H="Kaleidoscope-Hardware-Model01.h"' \
-DKALEIDOSCOPE_VIRTUAL_BUILD=1 \
-DKEYBOARDIOHID_BUILD_WITHOUT_HID=1 \
-DUSBCON=dummy \
-DARDUINO_ARCH_AVR=1 \
'-DUSB_PRODUCT="Model 01"' \
$<
$(QUIET) install -d "${OBJ_DIR}"
$(QUIET) $(COMPILER_WRAPPER) $(call _arduino_prop,compiler.cpp.cmd) -o "$@" -c -std=c++14 \
${shared_includes} ${shared_defines} $<
clean:
rm -f "${SRC_DIR}/generated-testcase.cpp"
rm -rf "${build_dir}"
$(QUIET) rm -f -- "${SRC_DIR}/generated-testcase.cpp"
$(QUIET) rm -rf -- "${build_dir}"
.PHONY: clean run all build

@ -1,39 +1,56 @@
top_dir := $(abspath $(dir $(lastword ${MAKEFILE_LIST}))..)
build_dir := ${top_dir}/_build
tests_dir := $(abspath $(dir $(lastword ${MAKEFILE_LIST})))
top_dir := $(abspath $(tests_dir)/..)
build_dir := ${top_dir}/_build
LIB_DIR := ${build_dir}/lib
libcommon_a := ${top_dir}/_build/lib/libcommon.a
TEST_PATH ?= tests/
TEST_PATH ?= ./
export FQBN ?= keyboardio:virtual:model01
TESTS ?= $(shell cd $(tests_dir); find ${TEST_PATH} -name '*.ino' -exec dirname {} \;)
# If we start off in tests to run make all, the sketch makefiles guess the wrong location for
# Kaliedoscope's makefiles
KALEIDOSCOPE_ETC_DIR ?= $(top_dir)/etc
.PHONY: clean cmake-clean all googletest generate-testcases
TESTS ?= $(shell find ${top_dir}/${TEST_PATH} -name 'sketch.ino' -exec dirname {} \;)
.PHONY: clean cmake-clean all googletest
generate-testcases:
@for test in ${TESTS}; do \
${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $${test} top_dir=${top_dir} testcase=$${test} generate-testcase; \
${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $${test} testcase=$${test} generate-testcase; \
done
all: ${TESTS}
all: ${TESTS} run-all
run-all: ${TESTS}
@for test in ${TESTS}; do \
${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $${test} top_dir=${top_dir} testcase=$${test} run; \
${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $${test} testcase=$${test} run; \
done || exit 1
cmake-clean:
rm -rf "${top_dir}/testing/googletest/build/*"
rm -rf "${top_dir}"/testing/googletest/build/*
clean: cmake-clean
# ${top_dir}/testing/googletest/build/Makefile
@for test in ${TESTS}; do \
${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $${test} top_dir=${top_dir} testcase=$${test} clean; \
${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $${test} testcase=$${test} clean; \
done
rm -rf "${build_dir}/*"
rm -rf "${build_dir}"/*
googletest: ${top_dir}/testing/googletest/build/Makefile
cd ${top_dir}/testing/googletest/build && $(MAKE)
${top_dir}/testing/googletest/build/Makefile:
$(info googletest Makefile is being remade)
install -d ${top_dir}/testing/googletest/build && cd ${top_dir}/testing/googletest/build && cmake ..
${libcommon_a}:
@ -43,7 +60,7 @@ Makefile:
@:
${TESTS}: ${libcommon_a} googletest
${MAKE} -f ${top_dir}/testing/makefiles/testcase.mk -C $@ top_dir=${top_dir} testcase=$@
${MAKE} -f ${top_dir}/testing/makefiles/testcase.mk -C $@ testcase=$@ build
%+run:
${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $* top_dir=${top_dir} testcase=$* run
${MAKE} -s -f ${top_dir}/testing/makefiles/testcase.mk -C $* testcase=$* run

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save