Adding some Log messages
This commit is contained in:
@@ -6,8 +6,9 @@
|
||||
*/
|
||||
|
||||
#include "PinController.h"
|
||||
|
||||
#include "utility/config.h"
|
||||
#include "utility/LoggerFactory.h"
|
||||
|
||||
#ifndef NO_WIRING_PI
|
||||
#include <wiringPi.h>
|
||||
#include <mcp23017.h>
|
||||
@@ -15,8 +16,6 @@
|
||||
#include "utility/wiringPiTesting.hpp"
|
||||
#endif
|
||||
|
||||
#include "json/json.hpp"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
|
||||
@@ -24,6 +23,7 @@ std::once_flag PinController::GPIO_LIB_INITIALIZED;
|
||||
|
||||
PinController::PinController()
|
||||
{
|
||||
CLOG(INFO, OUTPUT_LOGGER) << "Created PinController";
|
||||
std::call_once(GPIO_LIB_INITIALIZED, wiringPiSetup);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,10 @@ bool PinController::read_pin(uint8_t address)
|
||||
void PinController::initialize_port_expander(const uint8_t i2c_address, const uint8_t pin_base)
|
||||
{
|
||||
mcp23017Setup(pin_base, i2c_address);
|
||||
char hex_string[4];
|
||||
sprintf(hex_string, "%X", i2c_address);
|
||||
CLOG(INFO, OUTPUT_LOGGER) << "MCP23017 initialized with i2c-address 0x" << hex_string << " and pin-base " << int(pin_base);
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user