ac100 team mailing list archive
-
ac100 team
-
Mailing list archive
-
Message #00393
Re: [PATCH 1/2] Manage wake up Events
-
To:
Leon Romanovsky <leon@xxxxxxx>
-
From:
"Pierre-Hugues Husson" <phhusson@xxxxxxxxx>
-
Date:
Sun, 23 Oct 2011 16:18:56 +0200
-
Cc:
ac100@xxxxxxxxxxxxxxxxxxx
-
In-reply-to:
<CALq1K=JRkk4-COCUyLL_32irC=6SuexH0Y=2=XuABxfzHJiuMw@mail.gmail.com>
-
User-agent:
KMail/1.13.6 (Linux/2.6.37.6-0.7-desktop; KDE/4.6.0; x86_64; ; )
Le dimanche 23 octobre 2011 13:01:38, Leon Romanovsky a écrit :
> On Sun, Oct 23, 2011 at 04:13, Pierre-Hugues Husson <phhusson@xxxxxxxxx>
wrote:
> > + {
> > + //Resume on home key press
> > + char cmd[]={ 0x05, 0x03, 0x01, 0x02};
> > + cmd[2]=!!wakeup_on_home_key;
> > + nvec_write_async(nvec, cmd, sizeof(cmd));
> > + }
> > +}
>
> It is better to use the same coding style as was already in nvec
> nvec_write_async(nvec, cmd, sizeof(cmd)); ===> nvec_write_async(nvec,
> "\x05\x03\x01\x02", 4);
So the code would look like:
if(wakeup_on_home_key)
nvec_write_async(nvec, "\x05\x03\x01\x02", 4);
else
nvec_write_async(nvec, "\x05\x03\x00\x02", 4);
?
I find it less understandable (as in which field is of which use).
But well, all nvec code is mostly about magic code, so why not.
Follow ups
References