From 4c2a5815ffc77954b8330bfb62938796f6745a31 Mon Sep 17 00:00:00 2001 From: Jonas Zeunert Date: Mon, 7 May 2018 23:19:45 +0200 Subject: [PATCH] dunno --- FlippR-Driver/src/input/InputFactory.h | 8 +++++--- FlippR-Driver/src/utilities/GPIOInterface.hpp | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/FlippR-Driver/src/input/InputFactory.h b/FlippR-Driver/src/input/InputFactory.h index 070bd1d..d4472e1 100644 --- a/FlippR-Driver/src/input/InputFactory.h +++ b/FlippR-Driver/src/input/InputFactory.h @@ -24,6 +24,7 @@ class InputFactory public: static std::shared_ptr get_detector(std::string& input_config_path, std::string& matrix_config_path) { + // todo this in gpiointerface std::ifstream input_config_stream(input_config_path); json input_config; input_config << input_config_stream; @@ -32,19 +33,20 @@ public: json matrix_config; matrix_config << matrix_config_stream; - std::vector input_events = create_input_events(matrix_config); + std::map input_events = create_input_events(matrix_config); return std::shared_ptr(Detector(input_config, input_events)); } private: - static std::vector create_input_events(json matrix_config) + static std::map create_input_events(json matrix_config) { - std::vector input_events; + std::map input_events; for(auto& key : matrix_config) { InputEvent event(matrix_config[key], key); + input_events.emplace(key, event); } return input_events; diff --git a/FlippR-Driver/src/utilities/GPIOInterface.hpp b/FlippR-Driver/src/utilities/GPIOInterface.hpp index fa3e002..bc21bc4 100644 --- a/FlippR-Driver/src/utilities/GPIOInterface.hpp +++ b/FlippR-Driver/src/utilities/GPIOInterface.hpp @@ -30,7 +30,8 @@ public: void read_pin(); public: - // todo some mapping class interface shit that a user can ask for what is actually usable + // todo some mapping class interface shit that a user can ask for what is actually usable \ + something like: A has gpio interface at gpio -> gpio.input.column. just dont work with strings private: json config;