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:
Johannes Wendel
2020-01-07 00:47:59 +01:00
parent 4b76b477f5
commit f5e2b1d0cd
18 changed files with 145 additions and 141 deletions

View File

@@ -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};
}
}