From cbc3e605dd45ca024ef7ea314ed7c3b8ca536c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 7 Aug 2023 19:57:47 +0200 Subject: [PATCH] fix building for other platforms --- src/input/kbMatrixBase.cpp | 4 ++++ src/input/kbMatrixImpl.cpp | 6 +++++- src/modules/CannedMessageModule.cpp | 4 ++++ src/modules/Modules.cpp | 4 +++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/input/kbMatrixBase.cpp b/src/input/kbMatrixBase.cpp index 6e201b97f..823bfb629 100644 --- a/src/input/kbMatrixBase.cpp +++ b/src/input/kbMatrixBase.cpp @@ -1,6 +1,8 @@ #include "kbMatrixBase.h" #include "configuration.h" +#ifdef INPUTBROKER_MATRIX_TYPE + const byte keys_cols[] = KEYS_COLS; const byte keys_rows[] = KEYS_ROWS; @@ -125,3 +127,5 @@ int32_t KbMatrixBase::runOnce() } return 50; // Keyscan every 50msec to avoid key bounce } + +#endif // INPUTBROKER_MATRIX_TYPE \ No newline at end of file diff --git a/src/input/kbMatrixImpl.cpp b/src/input/kbMatrixImpl.cpp index 8f02c3ae3..0561b16fe 100644 --- a/src/input/kbMatrixImpl.cpp +++ b/src/input/kbMatrixImpl.cpp @@ -1,6 +1,8 @@ #include "kbMatrixImpl.h" #include "InputBroker.h" +#ifdef INPUTBROKER_MATRIX_TYPE + KbMatrixImpl *kbMatrixImpl; KbMatrixImpl::KbMatrixImpl() : KbMatrixBase("matrixKB") {} @@ -13,4 +15,6 @@ void KbMatrixImpl::init() } inputBroker->registerSource(this); -} \ No newline at end of file +} + +#endif // INPUTBROKER_MATRIX_TYPE \ No newline at end of file diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 43b9e2035..0f2921f36 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -10,6 +10,10 @@ #include "main.h" // for cardkb_found +#ifndef INPUTBROKER_MATRIX_TYPE +#define INPUTBROKER_MATRIX_TYPE 0 +#endif + #ifdef OLED_RU #include "graphics/fonts/OLEDDisplayFontsRU.h" #endif diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index ed1dd999a..241434e52 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -61,9 +61,11 @@ void setupModules() upDownInterruptImpl1->init(); cardKbI2cImpl = new CardKbI2cImpl(); cardKbI2cImpl->init(); +#ifdef INPUTBROKER_MATRIX_TYPE kbMatrixImpl = new KbMatrixImpl(); kbMatrixImpl->init(); -#endif +#endif // INPUTBROKER_MATRIX_TYPE +#endif // HAS_BUTTON #if HAS_TRACKBALL trackballInterruptImpl1 = new TrackballInterruptImpl1(); trackballInterruptImpl1->init();