Fixes some issues with sounds and the appropriate factory. Further moved the calculation of pin addresses with pin base into the factories
This commit is contained in:
@@ -71,18 +71,28 @@ void SoundBoardPinController::write_pin(const uint8_t &pin, const bool &value) c
|
||||
{
|
||||
PinController::write_pin(pin, value);
|
||||
PinController::write_pin(this->fire_address, true);
|
||||
|
||||
PinController::write_pin(this->fire_address, false);
|
||||
}
|
||||
|
||||
void SoundBoardPinController::set_address_pins(std::vector<uint8_t> address_pins)
|
||||
{
|
||||
this->address_pins = address_pins;
|
||||
|
||||
//print string in a nice manner
|
||||
std::stringstream ss;
|
||||
for (auto & p : address_pins)
|
||||
{
|
||||
ss << int{p} << ", ";
|
||||
}
|
||||
ss << std::string(2, 0x08);
|
||||
|
||||
CLOG(DEBUG, OUTPUT_LOGGER) << "Pin addresses for sounds set to: [" << ss.str() << "]";
|
||||
}
|
||||
|
||||
void SoundBoardPinController::set_fire_address(const uint8_t &fire_address)
|
||||
{
|
||||
this->fire_address = fire_address;
|
||||
CLOG(DEBUG, OUTPUT_LOGGER) << "Fire-pin address for sounds set to: " << int{fire_address};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user