void Light::_blinkOff() { off(false); // don't stop everything _off_timer.restart(); if(!_forever) { _times--; if(_times == 0) {_stopBlinking();} } }
void Led::off() { const std::lock_guard<std::mutex> lock(_mut); if(_status == Led::OFF){ return; } _stopBlinking(); _status = Led::OFF; _light(false); }
void Led::on() { const std::lock_guard<std::mutex> lock(_mut); if(_status == Led::ON){ return; } _stopBlinking(); _status = Led::ON; _light(true); }
Led::~Led() { _stopBlinking(); _light(false); _pin.write(Gpio::low); }
void Light::_stopEverything() { _stopBlinking(); _stopFading(); }