瀏覽代碼

Giving more breathing room for regular keys to be enable initially.

- Should be tested more on keyboards without test points (to see if more of a margin in necessary)
- Added more information messages on bootup
simple
Jacob Alexander 10 年之前
父節點
當前提交
1a5ae7fd68
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10
    1
      Scan/DPH/scan_loop.c

+ 10
- 1
Scan/DPH/scan_loop.c 查看文件

// This means, the strobe GPIO can be set to Tri-State pull-up to detect which strobe lines are not used. // This means, the strobe GPIO can be set to Tri-State pull-up to detect which strobe lines are not used.
// NOTE2: This will *NOT* detect floating strobes. // NOTE2: This will *NOT* detect floating strobes.
// NOTE3: Rev 0.4, the strobe numbers are reversed, so D0 is actually strobe 0 and C7 is strobe 17 // NOTE3: Rev 0.4, the strobe numbers are reversed, so D0 is actually strobe 0 and C7 is strobe 17
info_msg("Detecting Strobes...");

DDRC = 0; DDRC = 0;
PORTC = C_MASK; PORTC = C_MASK;
DDRD = 0; DDRD = 0;
} }
} }


printInt8( total_strobes );
print( " strobes found." NL );

// Setup Pins for Strobing // Setup Pins for Strobing
DDRC = C_MASK; DDRC = C_MASK;
PORTC = 0; PORTC = 0;
} }


// If sample is higher than previous high_avg, then mark as "problem key" // If sample is higher than previous high_avg, then mark as "problem key"
keys_problem[strobe_line + mux] = sample > high_avg ? sample : 0;
// XXX Giving a bit more margin to pass (high_avg vs. high_avg + high_avg - full_avg) -HaaTa
keys_problem[strobe_line + mux] = sample > high_avg + (high_avg - full_avg) ? sample : 0;


// Prepare for next average // Prepare for next average
cur_full_avg += sample; cur_full_avg += sample;
printInt8( low_count ); printInt8( low_count );
print("): "); print("): ");
printHex( low_avg ); printHex( low_avg );

print(" Rejection threshold: ");
printHex( high_avg + (high_avg - full_avg) );
print( NL ); print( NL );


// Display problem keys, and the sense value at the time // Display problem keys, and the sense value at the time