From 931806b02c4531e3629ee92a8854abc9614739c5 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 25 Jun 2019 17:59:05 +0200 Subject: Optionally enable communicating with the host. Add ENABLE_SERIAL=1 to the build environment to enable that feature. --- Makefile | 4 ++++ README | 4 ++++ src/model01.ino | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/Makefile b/Makefile index dfdfca9..de05a90 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,10 @@ CXXFLAGS = -DARDUINO_AVR_MODEL01 \ -DUSB_MANUFACTURER="\"keyboardio\"" -DUSB_PRODUCT="\"Model 01\"" \ -DKALEIDOSCOPE_HARDWARE_H="\"Kaleidoscope-Hardware-Model01.h\"" +ifeq ($(ENABLE_SERIAL),1) +CXXFLAGS += -DENABLE_SERIAL +endif + AVRDUDE_OPTS = -q AVRDUDE_CONF = /etc/avrdude.conf #MONITOR_PORT = $(firstword $(wildcard /dev/serial/by-id/usb-keyboardio_Model_01_*)) diff --git a/README b/README index e8fda53..1a601c8 100644 --- a/README +++ b/README @@ -36,6 +36,10 @@ Initialize (or update) submodules: ~$ make +To enable communicating with the host via a simple Serial protocol, use + + ~$ ENABLE_SERIAL=1 make + Flash firmware ============== diff --git a/src/model01.ino b/src/model01.ino index 03ad6c2..1a65c5d 100644 --- a/src/model01.ino +++ b/src/model01.ino @@ -20,6 +20,9 @@ #include #include #include +#ifdef ENABLE_SERIAL +# include +#endif #include #include #include @@ -45,6 +48,9 @@ KALEIDOSCOPE_INIT_PLUGINS( , EscapeOneShot , ActiveModColorEffect , Macros +#ifdef ENABLE_SERIAL + , Focus +#endif ); void setup() { -- cgit v1.2.3