mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-04-08 23:05:43 +00:00
Use core pmw33xx_set_cpi()
function in keyball_set_cpi()
QMK's core PMW3360 driver uses the true CPI value internally, so we have to translate the Keyball library's value to QMK's expected range. QMK's core driver also caps the range internally to a valid CPI value, so we don't need to do it here.
This commit is contained in:
parent
6d9c10235f
commit
3b2529ccd2
@ -505,7 +505,15 @@ void keyball_set_cpi(uint8_t cpi) {
|
||||
keyball.cpi_value = cpi;
|
||||
keyball.cpi_changed = true;
|
||||
if (keyball.this_have_ball) {
|
||||
pmw3360_cpi_set(cpi == 0 ? CPI_DEFAULT - 1 : cpi - 1);
|
||||
/**
|
||||
* QMK's core PMW3360 driver uses the true CPI value internally, so we
|
||||
* have to translate the Keyball library's value to QMK's expected
|
||||
* range.
|
||||
*
|
||||
* QMK's core driver also caps the range internally to a valid CPI
|
||||
* value, so we don't need to do it here.
|
||||
*/
|
||||
pmw33xx_set_cpi(0, (cpi + 1) * 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user