ADXL34X orientation definition
Hi Michael,
I was going though Coverity reports and it looks like definition of
#define ADXL346_2D_ORIENT(x) (((x) & 0x3) >> 4)
is not correct as it will always evaluate to 0. Should the mask be 0x30 instead?
Thanks.
Signature · 1 line
Dmitry
Quoted 11 lines · Dmitry Torokhov
Hi Michael,
I was going though Coverity reports and it looks like definition of
#define
ADXL346_2D_ORIENT(x)(((x) &0x3) >> 4)is not correct as it will always evaluate to 0. Should the mask be
0x30instead?Thanks.
Hi Dmitry,
Good catch!
Yes, of course - the mask should be 0x30.
Shall I send a patch?
Signature · 8 lines
Greetings, Michael -- Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif
Quoted 10 lines · Michael Hennerich
Quoted 9 lines · Dmitry Torokhov
Hi Michael,
I was going though Coverity reports and it looks like definition of
#define
ADXL346_2D_ORIENT(x)(((x) &0x3) >> 4)is not correct as it will always evaluate to 0. Should the mask be
0x30instead?
Quoted 8 lines
Quoted 1 line
Thanks.
Hi Dmitry,
Good catch!
Yes, of course - the mask should be
0x30.
Shall I send a patch?
That would be great.
Signature · 1 line
Dmitry