LCD Zapper sensor logic should be inverted because 0: detected; 1: not detected

This commit is contained in:
Alexey 'Cluster' Avdyukhin 2020-10-09 23:26:51 +03:00
parent 679e59ab45
commit 4f0dbfb389
1 changed files with 2 additions and 1 deletions

View File

@ -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.
// Ultimately this needs to be converted from 0000 00lt to 000t l000 where l is the light bit and t
// is the trigger bit.
// l must be inverted because 0: detected; 1: not detected
lcdCompZapperData[w] = ((((*(uint32*)data) & 1) << 4) |
(((*(uint32*)data) & 2) << 2));
(((*(uint32*)data) & 2 ^ 2) << 2));
}
static INPUTC LCDCompZapperCtrl = { ReadLCDCompZapper,0,StrobeLCDCompZapper,UpdateLCDCompZapper,0,0 };