Skip to content

Commit

Permalink
Set lower bound for dynamic bin_spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
arkku committed Sep 3, 2022
1 parent c8c68c8 commit c6ec70d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xwhatsit_core/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ void calibrate_matrix(void) {

if (bin_spacing > (cal_threshold_max - cal_threshold_min)) {
bin_spacing = cal_threshold_max - cal_threshold_min;
if (bin_spacing < CAPSENSE_CAL_THRESHOLD_OFFSET / 2) {
bin_spacing = CAPSENSE_CAL_THRESHOLD_OFFSET / 2;
}
}

if (cal_threshold_max < (cal_threshold_min + CAPSENSE_CAL_THRESHOLD_OFFSET)) {
Expand Down

0 comments on commit c6ec70d

Please sign in to comment.