summaryrefslogtreecommitdiff
path: root/stm/led.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-05 23:49:34 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-05 23:49:34 +0000
commit6b0b4a0cad348813f54d1395cee5fe77ea38dad0 (patch)
tree89821a1a9dfc67c924f9daa4ce70d37307cbf520 /stm/led.c
parent568a6c9d79e0621862068fb3fee1c9a235df26c0 (diff)
stm: pull-up usr switch on pyboard (fixes regression).
Diffstat (limited to 'stm/led.c')
-rw-r--r--stm/led.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/stm/led.c b/stm/led.c
index 044a91f0c..1692eaea7 100644
--- a/stm/led.c
+++ b/stm/led.c
@@ -8,10 +8,10 @@
#include "led.h"
/* LED numbers, used internally */
-#define PYB_LED_1 (1)
-#define PYB_LED_2 (2)
-#define PYB_LED_3 (3)
-#define PYB_LED_4 (4)
+#define PYB_LED_1 (0)
+#define PYB_LED_2 (1)
+#define PYB_LED_3 (2)
+#define PYB_LED_4 (3)
#if defined(PYBOARD)
#define PYB_LED1_PORT (GPIOA)
@@ -86,22 +86,22 @@ void led_state(pyb_led_t led, int state) {
switch (led) {
case PYB_LED_1:
- pin = PYB_LED1_PIN;
- port = PYB_LED1_PORT;
+ pin = PYB_LED1_PIN;
+ port = PYB_LED1_PORT;
break;
case PYB_LED_2:
- pin = PYB_LED2_PIN;
- port = PYB_LED2_PORT;
+ pin = PYB_LED2_PIN;
+ port = PYB_LED2_PORT;
break;
case PYB_LED_3:
- pin = PYB_LED3_PIN;
- port = PYB_LED3_PORT;
+ pin = PYB_LED3_PIN;
+ port = PYB_LED3_PORT;
break;
case PYB_LED_4:
- pin = PYB_LED4_PIN;
- port = PYB_LED4_PORT;
+ pin = PYB_LED4_PIN;
+ port = PYB_LED4_PORT;
break;
- default:
+ default:
return;
}
@@ -120,27 +120,27 @@ void led_toggle(pyb_led_t led) {
switch (led) {
case PYB_LED_1:
- pin = PYB_LED1_PIN;
- port = PYB_LED1_PORT;
+ pin = PYB_LED1_PIN;
+ port = PYB_LED1_PORT;
break;
case PYB_LED_2:
- pin = PYB_LED2_PIN;
- port = PYB_LED2_PORT;
+ pin = PYB_LED2_PIN;
+ port = PYB_LED2_PORT;
break;
case PYB_LED_3:
- pin = PYB_LED3_PIN;
- port = PYB_LED3_PORT;
+ pin = PYB_LED3_PIN;
+ port = PYB_LED3_PORT;
break;
case PYB_LED_4:
- pin = PYB_LED4_PIN;
- port = PYB_LED4_PORT;
+ pin = PYB_LED4_PIN;
+ port = PYB_LED4_PORT;
break;
- default:
+ default:
return;
}
if (!(port->ODR & pin)) {
- // turn LED off
+ // turn LED off
PYB_LED_OFF(port, pin);
} else {
// turn LED on (output low)