minor changes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user