minor changes

This commit is contained in:
Jonas Zeunert
2018-11-21 00:21:17 +01:00
parent ab6979ae63
commit 957f1f2334
8 changed files with 38 additions and 39 deletions

View File

@@ -13,6 +13,7 @@ namespace output
{
namespace items
{
Solenoid::Solenoid(std::shared_ptr<utility::IOutputGPIOInterface> output_gpio_interface, int i2c_address, int data_pin, std::string name, std::chrono::milliseconds deactivation_time)
:
OutputItem(output_gpio_interface, i2c_address, data_pin, name),
@@ -23,10 +24,11 @@ void Solenoid::triggerTask()
{
OutputItem::activate();
std::this_thread::sleep_for(50 /*todo change magic number */);
std::this_thread::sleep_for(deactivation_time);
OutputItem::deactivate();
}
void Solenoid::trigger()
{
std::async(std::launch::async, &Solenoid::triggerTask);