Skip to content

Commit

Permalink
Support for Kaleidoscope-Hardware-Virtual plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cdisselkoen committed Sep 28, 2017
1 parent 8e026fe commit 374a3e1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
6 changes: 5 additions & 1 deletion bin/kaleidoscope-builder
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
set -e

firmware_size () {
if [ "${BOARD}" = "virtual" ]; then
echo "[Size not computed for virtual build]"
return
fi

## This is a terrible hack, please don't hurt me. - algernon

MAX_PROG_SIZE=28672
Expand Down Expand Up @@ -137,7 +142,6 @@ compile () {
-ide-version "${ARDUINO_IDE_VERSION}" \
-warnings all \
${ARDUINO_VERBOSE} \
-prefs "compiler.cpp.extra_flags=-std=c++11 -Woverloaded-virtual -Wno-unused-parameter -Wno-unused-variable -Wno-ignored-qualifiers ${ARDUINO_CFLAGS} ${LOCAL_CFLAGS}" \
${ARDUINO_AVR_GCC_PREFIX_PARAM} \
"$(find_sketch)/${SKETCH}.ino"

Expand Down
7 changes: 5 additions & 2 deletions etc/kaleidoscope-builder.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ LIBRARY="${LIBRARY:-${SKETCH}}"

BOARD="${BOARD:-model01}"
MCU="${MCU:-atmega32u4}"
FQBN="${FQBN:-keyboardio:avr:${BOARD}}"

if [ "${BOARD}" = "virtual" ]; then
FQBN="${FQBN:-keyboardio:x86:${BOARD}}"
else
FQBN="${FQBN:-keyboardio:avr:${BOARD}}"
fi


########
Expand Down
5 changes: 5 additions & 0 deletions src/kaleidoscope/hid.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#include "hid.h"

#ifdef ARDUINO_VIRTUAL
#include "VirtualHID/VirtualHID.h"
#else
#include "KeyboardioHID.h"
#endif

namespace kaleidoscope {
namespace hid {
Expand Down
5 changes: 4 additions & 1 deletion src/key_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@

#include "key_defs_aliases.h"


#ifdef ARDUINO_VIRTUAL
#include "VirtualHID/VirtualHID.h"
#else
#include "KeyboardioHID.h"
#endif


typedef union Key_ {
Expand Down

0 comments on commit 374a3e1

Please sign in to comment.