From 6037ed864366c811579bf9c642c15bdf9cac784d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 20 Feb 2016 13:20:22 -0600 Subject: [PATCH] Some fixes to apps/examples/leds --- examples/leds/Make.defs | 2 +- examples/leds/Makefile | 6 +++--- examples/leds/leds_main.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/leds/Make.defs b/examples/leds/Make.defs index 769f68af1..0b212a762 100644 --- a/examples/leds/Make.defs +++ b/examples/leds/Make.defs @@ -2,7 +2,7 @@ # apps/examples/leds/Make.defs # Adds selected applications to apps/ build # -# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Copyright (C) 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without diff --git a/examples/leds/Makefile b/examples/leds/Makefile index 88be60f7d..dffa79c96 100644 --- a/examples/leds/Makefile +++ b/examples/leds/Makefile @@ -1,7 +1,7 @@ ############################################################################ # apps/examples/leds/Makefile # -# Copyright (C) 2008, 2010-2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -35,7 +35,7 @@ -include $(TOPDIR)/Make.defs -# Hello, World! built-in application info +# LED driver test built-in application info CONFIG_EXAMPLES_LEDS_PRIORITY ?= SCHED_PRIORITY_DEFAULT CONFIG_EXAMPLES_LEDS_STACKSIZE ?= 2048 @@ -44,7 +44,7 @@ APPNAME = leds PRIORITY = $(CONFIG_EXAMPLES_LEDS_PRIORITY) STACKSIZE = $(CONFIG_EXAMPLES_LEDS_STACKSIZE) -# Hello, World! Example +# LED driver test ASRCS = CSRCS = diff --git a/examples/leds/leds_main.c b/examples/leds/leds_main.c index 0041a83e6..fcfcd2dbf 100644 --- a/examples/leds/leds_main.c +++ b/examples/leds/leds_main.c @@ -79,7 +79,7 @@ static int led_daemon(int argc, char *argv[]) /* Open the LED driver */ printf("led_daemon: Opening %s\n", CONFIG_EXAMPLES_LEDS_DEVPATH); - fd = open(CONFIG_EXAMPLES_LEDS_DEVPATH, O_RDWR); + fd = open(CONFIG_EXAMPLES_LEDS_DEVPATH, O_WRONLY); if (fd < 0) { int errcode = errno; @@ -179,12 +179,13 @@ errout: #ifdef CONFIG_BUILD_KERNEL int main(int argc, FAR char *argv[]) #else -int leds_main(int argc, char *argv[]) +int leds_main(int argc, FAR char *argv[]) #endif { - char *ledargv[2]; + FAR char *ledargv[2]; int ret; + printf("leds_main: Starting the led_daemon\n"); if (g_led_daemon_started) { printf("leds_main: led_daemon already running\n"); @@ -194,7 +195,6 @@ int leds_main(int argc, char *argv[]) ledargv[0] = "led_daemon"; ledargv[1] = NULL; - printf("leds_main: Starting the led_daemon\n"); ret = task_create("led_daemon", CONFIG_EXAMPLES_LEDS_PRIORITY, CONFIG_EXAMPLES_LEDS_STACKSIZE, led_daemon, (FAR char * const *)ledargv); @@ -206,6 +206,6 @@ int leds_main(int argc, char *argv[]) return EXIT_FAILURE; } - printf("led_daemon started\n"); + printf("leds_main: led_daemon started\n"); return EXIT_SUCCESS; }