From 30d33571fa3929ff697bf410d3b7f25145cc6e45 Mon Sep 17 00:00:00 2001 From: TT Date: Sun, 29 Sep 2019 13:19:42 +0900 Subject: [PATCH] fixed: freeze on touching in boot #57 --- plot.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plot.c b/plot.c index 18f4dbb..ad43241 100644 --- a/plot.c +++ b/plot.c @@ -942,11 +942,15 @@ search_index_range_x(int x, uint32_t index[101], int *i0, int *i1) i = (head + tail) / 2; if (x == CELL_X0(index[i])) break; - - if (x < CELL_X0(index[i])) - tail = i+1; - else + else if (x < CELL_X0(index[i])) { + if (tail == i+1) + break; + tail = i+1; + } else { + if (head == i) + break; head = i; + } } if (x != CELL_X0(index[i]))