LCD Zapper sensor logic should be inverted because 0: detected; 1: not detected
This commit is contained in:
parent
679e59ab45
commit
4f0dbfb389
|
@ -35,8 +35,9 @@ void UpdateLCDCompZapper(int w, void* data, int arg)
|
||||||
// In the '(*(uint32*)data)' variable, bit 0 holds the trigger value and bit 1 holds the light sense value.
|
// In the '(*(uint32*)data)' variable, bit 0 holds the trigger value and bit 1 holds the light sense value.
|
||||||
// Ultimately this needs to be converted from 0000 00lt to 000t l000 where l is the light bit and t
|
// Ultimately this needs to be converted from 0000 00lt to 000t l000 where l is the light bit and t
|
||||||
// is the trigger bit.
|
// is the trigger bit.
|
||||||
|
// l must be inverted because 0: detected; 1: not detected
|
||||||
lcdCompZapperData[w] = ((((*(uint32*)data) & 1) << 4) |
|
lcdCompZapperData[w] = ((((*(uint32*)data) & 1) << 4) |
|
||||||
(((*(uint32*)data) & 2) << 2));
|
(((*(uint32*)data) & 2 ^ 2) << 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
static INPUTC LCDCompZapperCtrl = { ReadLCDCompZapper,0,StrobeLCDCompZapper,UpdateLCDCompZapper,0,0 };
|
static INPUTC LCDCompZapperCtrl = { ReadLCDCompZapper,0,StrobeLCDCompZapper,UpdateLCDCompZapper,0,0 };
|
||||||
|
|
Loading…
Reference in New Issue