adds set data_pin and run_pin
This commit is contained in:
@@ -20,6 +20,14 @@ LampFactory::LampFactory(nlohmann::json &object, std::shared_ptr<DriverBoardPinC
|
||||
{
|
||||
this->set_address_pins();
|
||||
this->set_mux_pins();
|
||||
|
||||
auto controller = std::dynamic_pointer_cast<detail::DriverBoardPinController>(this->pin_controller);
|
||||
|
||||
auto data_pin = this->get_address_pin(this->object.at(config_path::data_pin));
|
||||
controller->set_data_pin(data_pin);
|
||||
|
||||
auto run_pin = this->get_address_pin(this->object.at(config_path::run_pin));
|
||||
controller->set_run_pin(run_pin);
|
||||
}
|
||||
|
||||
std::map<std::string, std::shared_ptr<items::Lamp>> LampFactory::getItemMap()
|
||||
@@ -63,7 +71,7 @@ uint8_t LampFactory::get_address_pin(nlohmann::json & pin_object)
|
||||
|
||||
void LampFactory::set_mux_pins()
|
||||
{
|
||||
auto address_pins = this->object.at(config_path::address_pins);
|
||||
auto address_pins = this->object.at(config_path::enable_pins);
|
||||
|
||||
std::array<uint8_t, 13> pins;
|
||||
|
||||
@@ -75,6 +83,5 @@ void LampFactory::set_mux_pins()
|
||||
std::dynamic_pointer_cast<detail::DriverBoardPinController>(this->pin_controller)->set_mux_pins(pins);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user