From 39e0a092de46a3963603c04db91c63f6e46585ca Mon Sep 17 00:00:00 2001 From: Neeflix Date: Thu, 31 May 2018 15:50:08 +0200 Subject: [PATCH 1/2] changed to inputgpiointerface --- FlippR-Driver/src/input/Detector.cpp | 2 +- FlippR-Driver/src/input/Detector.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FlippR-Driver/src/input/Detector.cpp b/FlippR-Driver/src/input/Detector.cpp index f0e82ff..9d6dc0b 100644 --- a/FlippR-Driver/src/input/Detector.cpp +++ b/FlippR-Driver/src/input/Detector.cpp @@ -13,7 +13,7 @@ namespace Input { -Detector::Detector(GPIOInterface* in_gpio_interface, std::map events, InputEventNotifier* input_event_notifier) : +Detector::Detector(InputGPIOInterface* in_gpio_interface, std::map events, InputEventNotifier* input_event_notifier) : in_gpio_interface(in_gpio_interface), input_events(events), is_running(true), input_event_notifier(input_event_notifier) { detect_thread = std::thread(&Detector::detect, this); diff --git a/FlippR-Driver/src/input/Detector.h b/FlippR-Driver/src/input/Detector.h index 9d3fba8..ecb14ed 100644 --- a/FlippR-Driver/src/input/Detector.h +++ b/FlippR-Driver/src/input/Detector.h @@ -17,7 +17,7 @@ #include #include -#include "../utilities/GPIOInterface.hpp" +#include "../utilities/InputGPIOInterface.h" #include "InputEvent.h" #include "InputEventNotifier.h" @@ -36,7 +36,7 @@ class Detector { public: - Detector(GPIOInterface* in_gpio_interface, std::map events, InputEventNotifier* input_event_notifier); + Detector(InputGPIOInterface* in_gpio_interface, std::map events, InputEventNotifier* input_event_notifier); ~Detector(); private: @@ -44,7 +44,7 @@ private: bool check_inputs(char& address); private: - GPIOInterface* in_gpio_interface; + InputGPIOInterface* in_gpio_interface; std::map input_events; From 18f63214d87e101893e42fdd3c2a390a15e8c805 Mon Sep 17 00:00:00 2001 From: Neeflix Date: Thu, 31 May 2018 16:01:28 +0200 Subject: [PATCH 2/2] changed InputFactory --- FlippR-Driver/src/input/InputFactory.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/FlippR-Driver/src/input/InputFactory.h b/FlippR-Driver/src/input/InputFactory.h index d70d81e..99e5ede 100644 --- a/FlippR-Driver/src/input/InputFactory.h +++ b/FlippR-Driver/src/input/InputFactory.h @@ -12,6 +12,9 @@ #include "Detector.h" +#include "../utilities/InputGPIOInterface.h" +#include "InputEventNotifier.h" + #include "../lib/json/json.hpp" using namespace nlohmann; @@ -33,9 +36,12 @@ public: json matrix_config; matrix_config << matrix_config_stream; + auto input_gpio_interface = new InputGPIOInterface(); + auto input_notifier = new InputEventNotifier(); + std::map input_events = create_input_events(matrix_config); - return std::shared_ptr(new Detector(input_config, input_events)); + return std::shared_ptr(new Detector(input_gpio_interface, input_events, input_notifier)); } private: