From ef7a7f41583126f9d6010747a4d58637ce1de23e Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Thu, 4 May 2017 13:11:35 +0100 Subject: Hardcode boundaries --- src/main.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 8deca7b..5520a8e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,7 +23,6 @@ volatile uint16_t last_pressed[4] = { 0, 0, 0, 0 }; uint16_t current_f[4] = { 0, 0, 0, 0 }; volatile uint16_t update = 0; -uint16_t max_count[4]; // Initialise display SPInit gSpi(D_MOSI_PIN, NC, D_CLK_PIN); @@ -84,12 +83,9 @@ void tout(void) last_pressed[i] = switch_pressed[i]; - if (max_count[i] < switch_count[i]) - max_count[i] = switch_count[i]; - - if (switch_count[i] < (3*max_count[i])/5) + if (switch_count[i] < 600) switch_pressed[i] = 1; - else if (switch_count[i] > (4*max_count[i])/5) + else if (switch_count[i] > 700) switch_pressed[i] = 0; } // Update display -- cgit v1.2.3-54-g00ecf