Exemplo n.º 1
0
int __led_blink_thread(void * us_time)
{
	int i;
	int *_us_time;
	*_us_time = (int) us_time;

	while(1)
	{
		led_set_on(current_blinking_led);
		usleep(*_us_time);
		led_set_off(current_blinking_led);
		usleep(*_us_time);
		
		/* Loop for all leds: if we reach MAXLED+1, 
			 it means that there is no more blinking led, 
			 so pthread_exit() */

		for(i = 0; i < MAXLED+1; i++)
		{
			if(i < MAXLED)
				if(current_blinking_led[i] != 0)
					break;
				else
					continue;
			else 
				pthread_exit(NULL);
		}
	}
	return 0;
}
Exemplo n.º 2
0
static int setup_led(void)
{
#ifdef CONFIG_SPL_LED
	struct udevice *dev;
	char *led_name;
	int ret;

	led_name = fdtdec_get_config_string(gd->fdt_blob, "u-boot,boot-led");
	if (!led_name)
		return 0;
	ret = led_get_by_label(led_name, &dev);
	if (ret) {
		debug("%s: get=%d\n", __func__, ret);
		return ret;
	}
	ret = led_set_on(dev, 1);
	if (ret)
		return ret;
#endif

	return 0;
}