Skip to content

Commit

Permalink
Reduce "First laser crossing is not into the beam" error
Browse files Browse the repository at this point in the history
There are two known reasons for this error
1. Firmware sends old events right after auto-sending is enabled
2. The finger first lands on the screen while the beam is obstructed

This change should fix both cases. But additional firmware fix would be useful
to completely avoid the first case above.
  • Loading branch information
kamrik committed Feb 27, 2017
1 parent edaf9a9 commit 7ca4b10
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ void reshapeAndCalculate() {
laserEventList.remove(0);
}

// Calculation assumes that the first event is generated by the finger obstructing the beam.
// Remove the first event if it was generated by finger going out of the beam (value==1).
while (laserEventList.size() > 0 && laserEventList.get(0).value == 1) {
laserEventList.remove(0);
}

int lN = laserEventList.size();

if (lN < 8) {
Expand Down

0 comments on commit 7ca4b10

Please sign in to comment.