added tests
This commit is contained in:
@@ -14,10 +14,10 @@
|
||||
|
||||
using namespace Input;
|
||||
|
||||
Detector::Detector(InputGPIOInterface* input_gpio_interface, std::map<char, Event> events, IEventNotifier* event_notifier) :
|
||||
Detector::Detector(IInputGPIOInterface* input_gpio_interface, std::map<char, Event> events, IEventNotifier* event_notifier) :
|
||||
input_gpio_interface(input_gpio_interface), events(events), is_running(true), event_notifier(event_notifier)
|
||||
{
|
||||
detect_thread = std::thread(&Detector::detect, this);
|
||||
this->detect_thread = std::thread(&Detector::detect, this);
|
||||
|
||||
CLOG(WARNING, INPUT_LOGGER) << "Created Detector";
|
||||
}
|
||||
@@ -41,7 +41,7 @@ void Detector::detect()
|
||||
while(is_running)
|
||||
{
|
||||
char address;
|
||||
if(check_inputs(address))
|
||||
if(this->check_inputs(address))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -58,7 +58,7 @@ void Detector::detect()
|
||||
|
||||
bool Detector::check_inputs(char& address)
|
||||
{
|
||||
for(int pin = 0; pin < (INPUT_MATRIX_SIZE * INPUT_MATRIX_SIZE); pin++)
|
||||
for(char pin = 0; pin < (INPUT_MATRIX_SIZE * INPUT_MATRIX_SIZE); pin++)
|
||||
{
|
||||
if(input_gpio_interface->read_input_data(pin))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user