#ifndef __THER_LED_HPP__ #define __THER_LED_HPP__ #include #include namespace ther { template class Led { public: static auto On() { led_on_dt(&kSpec); } static auto Off() { led_off_dt(&kSpec); } template static auto Flash(std::chrono::duration period) { s_work.submit(period); } private: inline static zpp::periodic_work<> s_work{[]() { static bool is_on = false; if (is_on) { Off(); } else { On(); } is_on = !is_on; }}; }; } // namespace ther #endif