diff options
author | Vasil Zlatanov <v@skozl.com> | 2017-05-04 13:11:35 +0100 |
---|---|---|
committer | Vasil Zlatanov <v@skozl.com> | 2017-05-04 13:11:35 +0100 |
commit | ef7a7f41583126f9d6010747a4d58637ce1de23e (patch) | |
tree | 28501e38864656e26471d2e3fe5c52094cc6b483 /src/main.cpp | |
parent | 023907a7e67c01e4b2d263b57377c55f3101aec7 (diff) | |
download | e2-switch-ef7a7f41583126f9d6010747a4d58637ce1de23e.tar.gz e2-switch-ef7a7f41583126f9d6010747a4d58637ce1de23e.tar.bz2 e2-switch-ef7a7f41583126f9d6010747a4d58637ce1de23e.zip |
Hardcode boundaries
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
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 |