summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2015-01-13 23:16:40 +0100
committerJakob Odersky <jodersky@gmail.com>2015-01-13 23:16:40 +0100
commit33419bde3d4d38b58f1ea64bf4c0891e98cf4844 (patch)
treeef86daf46c70acecb39afdcf78c2e36096ecd72d
parent155a227c37db1c003e0232489a1278a3f255afcf (diff)
downloadnuttx-33419bde3d4d38b58f1ea64bf4c0891e98cf4844.tar.gz
nuttx-33419bde3d4d38b58f1ea64bf4c0891e98cf4844.tar.bz2
nuttx-33419bde3d4d38b58f1ea64bf4c0891e98cf4844.zip
minor refactoring
-rw-r--r--nuttx/configs/teensy31/src/up_leds.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/nuttx/configs/teensy31/src/up_leds.c b/nuttx/configs/teensy31/src/up_leds.c
index 31205fc2a..d03f7deac 100644
--- a/nuttx/configs/teensy31/src/up_leds.c
+++ b/nuttx/configs/teensy31/src/up_leds.c
@@ -93,6 +93,9 @@
#define GPIO_LED7 (PIN_PORTD | PIN5 | GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE)
#define GPIO_LED8 (PIN_PORTD | PIN6 | GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE)
+/* Delay used to blink all leds once */
+#define LED_DELAY_LOOPS 1000000
+
static void set_led(int led, bool value)
{
switch(led) {
@@ -125,6 +128,7 @@ static void set_led(int led, bool value)
break;
}
}
+
void board_led_initialize(void)
{
volatile unsigned long counter = 0;
@@ -150,7 +154,7 @@ void board_led_initialize(void)
kinetis_gpiowrite(GPIO_LED8, true);
counter = 0;
- while(counter < 1000000) {
+ while(counter < LED_DELAY_LOOPS) {
++counter;
}
@@ -165,7 +169,7 @@ void board_led_initialize(void)
kinetis_gpiowrite(GPIO_LED8, false);
counter = 0;
- while(counter < 1000000) {
+ while(counter < LED_DELAY_LOOPS) {
++counter;
}
}