diff --git a/apps/Makefile b/apps/Makefile index 07d798181..c29903531 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -17,6 +17,7 @@ app_objs += $(addprefix apps/,\ constant.o\ global_preferences.o\ i18n.o\ + led_timer.o\ main.o\ math_toolbox.o\ node.o\ diff --git a/apps/led_timer.cpp b/apps/led_timer.cpp new file mode 100644 index 000000000..a71fe7248 --- /dev/null +++ b/apps/led_timer.cpp @@ -0,0 +1,13 @@ +#include "led_timer.h" + +LedTimer::LedTimer() : + Timer(1), + m_on(false) +{ +} + +void LedTimer::fire() { + m_on = !m_on; + KDColor ledColor = m_on ? KDColorRed : KDColorBlack; + Ion::LED::setColor(ledColor); +} diff --git a/apps/led_timer.h b/apps/led_timer.h new file mode 100644 index 000000000..fd193ea79 --- /dev/null +++ b/apps/led_timer.h @@ -0,0 +1,15 @@ +#ifndef APPS_LED_TIMER_H +#define APPS_LED_TIMER_H + +#include + +class LedTimer : public Timer { +public: + LedTimer(); +private: + void fire() override; + bool m_on; +}; + +#endif +