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 02709e650f
commit ee5a87ae15
18 changed files with 145 additions and 141 deletions

View File

@@ -158,6 +158,8 @@ void OutputDriver::shut_down_driver() const
this->deactivate_all_flipper_relays();
this->deactivate_all_lamps();
this->deactivate_displays();
CLOG(INFO, OUTPUT_LOGGER) << "Deactivated all output items.";
}

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