arch/sidk_s5jt200: refactor s5jt200_led
authorsunghan <sh924.chang@samsung.com>
Wed, 11 Oct 2017 07:29:22 +0000 (16:29 +0900)
committersunghan <sh924.chang@samsung.com>
Wed, 11 Oct 2017 07:29:22 +0000 (16:29 +0900)
1. A local variable is enough for led thread id.
2. Location of printing message is moved to give correct
   information of making led thread.

os/arch/arm/src/sidk_s5jt200/src/s5jt200_led.c

index 088d526..90def00 100644 (file)
@@ -65,7 +65,6 @@
 #include <tinyara/board.h>
 #include <arch/board/board.h>
 
-pid_t g_rgbled_tid;
 FAR struct pwm_lowerhalf_s    *ledr;
 FAR struct pwm_lowerhalf_s    *ledg;
 FAR struct pwm_lowerhalf_s    *ledb;
@@ -172,14 +171,16 @@ int s5jt200_rgbled_setup(void)
 
 int s5j_ledinitialize(void)
 {
+       pid_t rgbled_tid;
+
        /* RGB LED controlled by S8300 LED DRIVER ID with PWM */
        s5jt200_rgbled_setup();
 
-       g_rgbled_tid = kernel_thread("s5jt200 rgbstate", 100, 1024,
+       lldbg("Creating rgbled task..\n");
+       rgbled_tid = kernel_thread("s5jt200 rgbstate", 100, 1024,
                                        s5jt200_rgbled_state_task, NULL);
-       lldbg("Create rgbled task..\n");
 
-       if (!g_rgbled_tid) {
+       if (!rgbled_tid) {
                lldbg("Failed to run rgbled task..\n");
                return -ESRCH;
        }