Merge branch 'master' of github.com:swinginbird/flippr-code
This commit is contained in:
@@ -82,12 +82,12 @@ endif(Boost_FOUND)
|
||||
##################### WIRING_PI ##########################
|
||||
find_library(wiringPi_LIB wiringPi)
|
||||
|
||||
add_definitions(-DNO_WIRING_PI)
|
||||
if(NOT wiringPi_LIB)
|
||||
message(WARNING "Could not find wiringPi library, used testing wiring pi lib instead.")
|
||||
add_definitions(-DNO_WIRING_PI)
|
||||
else()
|
||||
message(STATUS "Found wiring pi.")
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${wiringPi_INCLUDE_DIRS})
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC ${wiringPi_LIB})
|
||||
endif()
|
||||
|
||||
|
||||
@@ -110,13 +110,13 @@ void FlippRServer::initialize(Application &self)
|
||||
//make this one application and subsystems ServerApplications
|
||||
|
||||
this->initialize_output_driver();
|
||||
this->initialize_input_driver();
|
||||
//this->initialize_input_driver();
|
||||
|
||||
this->output_server = std::unique_ptr<Poco::Net::HTTPServer>(this->build_output_server());
|
||||
this->output_server->start();
|
||||
|
||||
this->input_server = std::unique_ptr<TCPServer>(this->build_input_server());
|
||||
this->input_server->start();
|
||||
//this->input_server->start();
|
||||
|
||||
//https://gist.github.com/NIPE-SYSTEMS/5a06428c0880ed7ff3cc4304be436e3e
|
||||
ServerApplication::initialize(self);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <wiringPi.h>
|
||||
#include <mcp23017.h>
|
||||
#else
|
||||
#warning "Include testing wiringPi library"
|
||||
#include "utility/wiringPiTesting.hpp"
|
||||
#endif
|
||||
|
||||
@@ -39,6 +40,8 @@ void PinController::initialize_output_pin(const uint8_t address)
|
||||
|
||||
void PinController::write_pin(uint8_t address, bool value)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(log);
|
||||
|
||||
digitalWrite(address, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ protected:
|
||||
|
||||
public:
|
||||
static std::once_flag GPIO_LIB_INITIALIZED;
|
||||
|
||||
static std::mutex log;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user