Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1854)

Unified Diff: app/dartino/leds.c

Issue 1684433003: Add a small LED interface and demo app. (Closed) Base URL: git@github.com:domokit/sod.git@master
Patch Set: fix exports for qemu target Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | app/dartino/main.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/dartino/leds.c
diff --git a/app/dartino/leds.c b/app/dartino/leds.c
new file mode 100644
index 0000000000000000000000000000000000000000..ceeebc31578979a9eae4ebf8434fd64c56aa7c61
--- /dev/null
+++ b/app/dartino/leds.c
@@ -0,0 +1,30 @@
+
+// Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE.md file.
+
+#include <kernel/port.h>
+
+#if defined(TARGET_DARTUINOP0)
+#include <dev/gpio.h>
+#include <target/gpioconfig.h>
+
+int led_get_gpio(int led) {
+ switch (led) {
+ case 0:
+ return GPIO_LED108;
+ case 1:
+ return GPIO_LED109;
+ case 2:
+ return GPIO_LED110;
+ case 3:
+ return GPIO_LED111;
+ default:
+ return -1;
+ }
+}
+#else
+int led_get_gpio(int led) {
+ return -1;
+}
+#endif
« no previous file with comments | « no previous file | app/dartino/main.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698