arch/sidk_s5jt200: refactor s5jt200_led
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.
#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;
}
