From 6b0c70ebe271f1219a1a507430c6e887b2374b27 Mon Sep 17 00:00:00 2001 From: Sadek Baroudi Date: Wed, 21 Sep 2022 21:49:29 -0700 Subject: [PATCH] fixed trackball, switched from SPI1 to SPI0, as it works with shift register and trackball --- keyboards/fingerpunch/ximi/config.h | 19 ++++++++++++++----- keyboards/fingerpunch/ximi/mcuconf.c | 4 ++-- users/sadekbaroudi/pointing_stuff.c | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/keyboards/fingerpunch/ximi/config.h b/keyboards/fingerpunch/ximi/config.h index 10125d1126eb..2434f88d8028 100644 --- a/keyboards/fingerpunch/ximi/config.h +++ b/keyboards/fingerpunch/ximi/config.h @@ -194,12 +194,21 @@ along with this program. If not, see . #define PMW33XX_CS_PIN GP26 #define PMW33XX_CPI 800 #define PMW33XX_CS_DIVISOR 8 // needs to be the same as the SHIFTREG_DIVISOR above - // #define POINTING_DEVICE_INVERT_Y // move to trackball specific config + #define POINTING_DEVICE_INVERT_X // move to trackball specific config /* SPI config for pmw3360 sensor. */ - #define SPI_DRIVER SPID1 - #define SPI_SCK_PAL_MODE 5 - #define SPI_MOSI_PAL_MODE 5 + #define SPI_DRIVER SPID0 + // #define SPI_SCK_PAL_MODE 5 // already defined in chibios + // #define SPI_MOSI_PAL_MODE 5 // already defined in chibios #define SPI_MISO_PIN GP4 - #define SPI_MISO_PAL_MODE 5 + // #define SPI_MISO_PAL_MODE 5 // already defined in chibios +#ifdef FP_TRACKBALL_BOTH + #define POINTING_DEVICE_COMBINED +#endif +#ifdef FP_TRACKBALL_LEFT + #define POINTING_DEVICE_LEFT +#endif +#ifdef FP_TRACKBALL_RIGHT + #define POINTING_DEVICE_RIGHT +#endif #endif \ No newline at end of file diff --git a/keyboards/fingerpunch/ximi/mcuconf.c b/keyboards/fingerpunch/ximi/mcuconf.c index 34708ac79aa1..8af485361ee1 100644 --- a/keyboards/fingerpunch/ximi/mcuconf.c +++ b/keyboards/fingerpunch/ximi/mcuconf.c @@ -2,8 +2,8 @@ #include_next "mcuconf.h" -#undef RP_SPI_USE_SPI1 -#define RP_SPI_USE_SPI1 TRUE +#undef RP_SPI_USE_SPI0 +#define RP_SPI_USE_SPI0 TRUE #undef RP_I2C_USE_I2C1 #define RP_I2C_USE_I2C1 TRUE \ No newline at end of file diff --git a/users/sadekbaroudi/pointing_stuff.c b/users/sadekbaroudi/pointing_stuff.c index 40c225859fdb..b376bd014906 100644 --- a/users/sadekbaroudi/pointing_stuff.c +++ b/users/sadekbaroudi/pointing_stuff.c @@ -46,4 +46,4 @@ void pointing_device_set_cpi_combined_defaults(void) { pointing_device_set_cpi_on_side(true, 50); //Set cpi on left side to a low value for slower scrolling. pointing_device_set_cpi_on_side(false, 2000); //Set cpi on right side to a reasonable value for mousing. } -#endif +#endif \ No newline at end of file