Mercurial > louis > kiibohd-controller
changeset 158:0e3038f30819
Adding different algorithm to re-enable problem keys.
- More generous to keys, and should reject all test points.
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Fri, 25 Apr 2014 23:53:46 -0700 |
parents | f27d8e591ba1 |
children | 84beeecd2c94 |
files | Scan/DPH/scan_loop.c |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/Scan/DPH/scan_loop.c Fri Apr 25 02:35:49 2014 -0700 +++ b/Scan/DPH/scan_loop.c Fri Apr 25 23:53:46 2014 -0700 @@ -484,7 +484,8 @@ } } - info_print("If problem keys were detected, and were being held down, they will be reset as soon as let go"); + info_print("If problem keys were detected, and were being held down, they will be reset as soon as let go."); + info_print("Some keys have unusually high sense values, on the first press they should be re-enabled."); break; } } @@ -765,9 +766,10 @@ // Check if this is a bad key (e.g. test point, or non-existent key) if ( keys_problem[key] ) { - // If the sample value of the problem key goes below full_avg (overall initial average) + // If the sample value of the problem key goes above initally recorded result + threshold // re-enable the key - if ( (db_sample = samples[strobe][mux] >> 1) < full_avg ) + if ( (db_sample = samples[strobe][mux] >> 1) > keys_problem[key] + threshold ) + //if ( (db_sample = samples[strobe][mux] >> 1) < high_avg ) { info_msg("Re-enabling problem key: "); printHex( key );