lkml.org 
[lkml]   [2013]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Add LED pattern trigger
On Tue 2013-12-31 00:00:39, Joe Xue wrote:
> > 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.

You are welcome :-).
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2013-12-31 13:21    [W:0.087 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site