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