detector stuff

This commit is contained in:
Jonas Zeunert
2018-05-31 20:10:59 +02:00
parent 8dee9c7646
commit d57da8656c
2 changed files with 4 additions and 2 deletions

View File

@@ -26,8 +26,10 @@ Detector::~Detector()
is_running = false; is_running = false;
detect_thread.join(); detect_thread.join();
delete this->input_gpio_interface; delete this->input_gpio_interface;
this->input_gpio_interface = NULL; this->input_gpio_interface = NULL;
delete this->event_notifier; delete this->event_notifier;
this->event_notifier = NULL; this->event_notifier = NULL;
} }
@@ -55,7 +57,7 @@ void Detector::detect()
bool Detector::check_inputs(char& address) bool Detector::check_inputs(char& address)
{ {
for(int pin = 0; pin < MATRIX_SIZE * MATRIX_SIZE; pin++) for(int pin = 0; pin < (INPUT_MATRIX_SIZE * INPUT_MATRIX_SIZE); pin++)
{ {
if(input_gpio_interface->read_input_data(pin)) if(input_gpio_interface->read_input_data(pin))
{ {
@@ -64,7 +66,6 @@ bool Detector::check_inputs(char& address)
} }
} }
return false; return false;
} }
} }

View File

@@ -9,6 +9,7 @@
#define SRC_INPUT_INPUTDRIVER_HPP_ #define SRC_INPUT_INPUTDRIVER_HPP_
#include "EventHandler.hpp" #include "EventHandler.hpp"
namespace Input namespace Input
{ {