RE: [PATCH] Add LED pattern trigger

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> What about something like this?
>
> Not shcheduling timer when nothing changed should save a bit of power/cpu...
>
> if (pattern_data->pattern[pattern_data->count] == '/') {
> return;
> }
>
> this = pattern_data->pattern[pattern_data->count]
> if (this == '#')
> new_brigtness = pattern_data->brightness_on;
> if (this == ' ')
> new_brigtness = LED_OFF;
> repeat = 1;
> while (pattern_data->pattern[pattern_data->count + repeat] == this)
> repeat++;
>
> mod_timer(&pattern_data->timer,
> jiffies + msecs_to_jiffies(pattern_data->delay_unit * repeat));
>
>
Working on it.

Thanks for your help.

Joe 		 	   		  --
To unsubscribe from this list: send the line "unsubscribe linux-leds" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux