OLD | NEW |
---|---|
(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 | |
OLD | NEW |