added pulldown

This commit is contained in:
Jonas Zeunert
2018-09-20 19:54:33 +02:00
parent b3be58d994
commit 7962ff756e
3 changed files with 7 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ namespace Input
Event::Event(char address, int priority, std::string name) : Event::Event(char address, int priority, std::string name) :
address(address), priority(priority), name(name) address(address), priority(priority), name(name)
{ {
CLOG_IF(VLOG_IS_ON(HIGH_VERBOSITY), INFO, INPUT_LOGGER) << "Created event: " << name << ", address: " << address; CLOG_IF(VLOG_IS_ON(HIGHEST_LOG_VERBOSITY), INFO, INPUT_LOGGER) << "Created event: " << name << ", address: " << address;
} }
bool operator==(const Event& left, const Event& right) bool operator==(const Event& left, const Event& right)

View File

@@ -7,6 +7,8 @@
#include "GPIOInterface.h" #include "GPIOInterface.h"
#include "config.h"
#include "wiringPi/wiringPi.h" #include "wiringPi/wiringPi.h"
#include "json/json.hpp" #include "json/json.hpp"
@@ -25,7 +27,7 @@ void GPIOInterface::write_pin(char address, char data)
bool GPIOInterface::read_pin(char address) bool GPIOInterface::read_pin(char address)
{ {
return digitalRead(address); return PULLDOWN && digitalRead(address);
} }
void GPIOInterface::initialize_output_pin(char address) void GPIOInterface::initialize_output_pin(char address)

View File

@@ -17,11 +17,13 @@
#define DRIVER_CONF_FILE "/var/log/flippr_driver.conf" #define DRIVER_CONF_FILE "/var/log/flippr_driver.conf"
#define HIGH_VERBOSITY 10 #define HIGHEST_LOG_VERBOSITY 10
#define INPUT_MATRIX_SIZE 8 #define INPUT_MATRIX_SIZE 8
#define INPUT_SLEEP_DURATION_NANO 800 #define INPUT_SLEEP_DURATION_NANO 800
#define NUMBER_OF_DISPLAYS 5 #define NUMBER_OF_DISPLAYS 5
#define PULLDOWN false
#define HIGHEST_INPUT_EVENT_PRIORITY 0 #define HIGHEST_INPUT_EVENT_PRIORITY 0