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

Side by Side 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: 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 unified diff | Download patch
« no previous file with comments | « no previous file | app/dartino/main.c » ('j') | app/dartino/main.c » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
Søren Gjesse 2016/02/09 09:16:01 2016
3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE.md file.
5
6 #include <kernel/port.h>
7
8 #if defined(TARGET_DARTUINOP0)
9 #include <dev/gpio.h>
10 #include <target/gpioconfig.h>
11
12 int change_led_status(int led, int on) {
13 int gpioid;
14 switch (led) {
15 case 0:
16 gpioid = GPIO_LED108;
17 break;
18 case 1:
19 gpioid = GPIO_LED109;
20 break;
21 case 2:
22 gpioid = GPIO_LED110;
23 break;
24 case 3:
25 gpioid = GPIO_LED111;
26 break;
27 default:
28 return 0;
29 }
30 gpio_set(gpioid, on);
31 return 1;
32 }
33 #else
Søren Gjesse 2016/02/09 09:16:01 Can't we just say #error here?
herhut 2016/02/09 10:10:15 No, cause then it won't build on qemu, which is us
34 int change_led_status(int led, bool on) {
35 return 0;
36 }
37 #endif
OLDNEW
« no previous file with comments | « no previous file | app/dartino/main.c » ('j') | app/dartino/main.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698