summaryrefslogtreecommitdiffstats
path: root/app/led.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/led.c')
-rw-r--r--app/led.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/led.c b/app/led.c
new file mode 100644
index 0000000..9481b2e
--- /dev/null
+++ b/app/led.c
@@ -0,0 +1,26 @@
+#include "project.h"
+
+
+static int led=0;
+
+void led_clear(void)
+{
+ gpio_set(GPIOB,GPIO8);
+ gpio_set(GPIOB,GPIO9);
+}
+
+void led_set(uint32_t v)
+{
+ gpio_clear(GPIOB,v);
+ led=50;
+}
+
+void led_tick(void)
+{
+if (led) {
+ led--;
+ if (!led) led_clear();
+}
+}
+
+