Introduced a build type selection header

Up to now, the device header was included by several files
via the command

This commit introduces a build type selection header
kaleidoscope/device/device.h that enables to
either directly include the device header or
to first include the 'physical' device header
and then the 'virtual' device header.
This is meant for the virtual device to be able
to be defined depending on the properties of the
physical device.

Signed-off-by: Florian Fleissner <florian.fleissner@inpartik.de>
pull/729/head
Florian Fleissner 5 years ago committed by Jesse Vincent
parent 0356318fa8
commit 0cce6ed0a8
No known key found for this signature in database
GPG Key ID: CC228463465E40BC

@ -36,7 +36,7 @@ void setup();
#include <math.h>
#include <stdint.h>
#include KALEIDOSCOPE_HARDWARE_H
#include "kaleidoscope/device/device.h"
#include "kaleidoscope/device/key_indexes.h"
#include "kaleidoscope_internal/device.h"
#include "kaleidoscope_internal/deprecations.h"

@ -16,6 +16,6 @@
#pragma once
#include KALEIDOSCOPE_HARDWARE_H
#include "kaleidoscope/device/device.h"
typedef kaleidoscope::Device::KeyAddr KeyAddr;

@ -0,0 +1,23 @@
/* Kaleidoscope - Firmware for computer input devices
* Copyright (C) 2013-2019 Keyboard.io, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#ifdef KALEIDOSCOPE_VIRTUAL_BUILD
#include "kaleidoscope/device/virtual/Virtual.h"
#else
#include KALEIDOSCOPE_HARDWARE_H
#endif

@ -17,7 +17,7 @@
#pragma once
#include <Arduino.h>
#include KALEIDOSCOPE_HARDWARE_H
#include "kaleidoscope/device/device.h"
#include "kaleidoscope/key_defs.h"
#include "kaleidoscope/keyswitch_state.h"

@ -19,7 +19,7 @@
#include <Arduino.h>
#include "kaleidoscope/key_defs.h"
#include "kaleidoscope/keymaps.h"
#include KALEIDOSCOPE_HARDWARE_H
#include "kaleidoscope/device/device.h"
#include "kaleidoscope_internal/device.h"
// Macro for defining the keymap. This should be used in the sketch

Loading…
Cancel
Save