diff options
| author | Drashna Jaelre <drashna@live.com> | 2021-06-05 08:08:35 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-05 08:08:35 -0700 |
| commit | 770a3349bed397967dae159501ebc7a4ab1fadde (patch) | |
| tree | d03db6c80671c51f13e73364f454ddaab419e823 /keyboards/ploopyco | |
| parent | c7c9f3e3cfc5e662a36edf67cd5dfe6b20d433a2 (diff) | |
| download | qmk_firmware-770a3349bed397967dae159501ebc7a4ab1fadde.tar.gz qmk_firmware-770a3349bed397967dae159501ebc7a4ab1fadde.zip | |
Fix includes for pmw3360 driver (#13108)
Diffstat (limited to 'keyboards/ploopyco')
| -rw-r--r-- | keyboards/ploopyco/pmw3360.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/keyboards/ploopyco/pmw3360.c b/keyboards/ploopyco/pmw3360.c index 8007fecef..5f9f72a9e 100644 --- a/keyboards/ploopyco/pmw3360.c +++ b/keyboards/ploopyco/pmw3360.c | |||
| @@ -16,13 +16,12 @@ | |||
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ | 17 | */ |
| 18 | 18 | ||
| 19 | 19 | #include "wait.h" | |
| 20 | #include "debug.h" | ||
| 21 | #include "print.h" | ||
| 20 | #include "pmw3360.h" | 22 | #include "pmw3360.h" |
| 21 | #include "pmw3360_firmware.h" | 23 | #include "pmw3360_firmware.h" |
| 22 | 24 | ||
| 23 | #ifdef CONSOLE_ENABLE | ||
| 24 | # include "print.h" | ||
| 25 | #endif | ||
| 26 | bool _inBurst = false; | 25 | bool _inBurst = false; |
| 27 | 26 | ||
| 28 | #ifndef PMW_CPI | 27 | #ifndef PMW_CPI |
| @@ -35,9 +34,7 @@ bool _inBurst = false; | |||
| 35 | # define ROTATIONAL_TRANSFORM_ANGLE 0x00 | 34 | # define ROTATIONAL_TRANSFORM_ANGLE 0x00 |
| 36 | #endif | 35 | #endif |
| 37 | 36 | ||
| 38 | #ifdef CONSOLE_ENABLE | ||
| 39 | void print_byte(uint8_t byte) { dprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); } | 37 | void print_byte(uint8_t byte) { dprintf("%c%c%c%c%c%c%c%c|", (byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), (byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')); } |
| 40 | #endif | ||
| 41 | 38 | ||
| 42 | 39 | ||
| 43 | bool spi_start_adv(void) { | 40 | bool spi_start_adv(void) { |
| @@ -172,9 +169,7 @@ bool pmw_check_signature(void) { | |||
| 172 | 169 | ||
| 173 | report_pmw_t pmw_read_burst(void) { | 170 | report_pmw_t pmw_read_burst(void) { |
| 174 | if (!_inBurst) { | 171 | if (!_inBurst) { |
| 175 | #ifdef CONSOLE_ENABLE | ||
| 176 | dprintf("burst on"); | 172 | dprintf("burst on"); |
| 177 | #endif | ||
| 178 | spi_write_adv(REG_Motion_Burst, 0x00); | 173 | spi_write_adv(REG_Motion_Burst, 0x00); |
| 179 | _inBurst = true; | 174 | _inBurst = true; |
| 180 | } | 175 | } |
| @@ -199,14 +194,12 @@ report_pmw_t pmw_read_burst(void) { | |||
| 199 | 194 | ||
| 200 | spi_stop(); | 195 | spi_stop(); |
| 201 | 196 | ||
| 202 | #ifdef CONSOLE_ENABLE | ||
| 203 | print_byte(data.motion); | 197 | print_byte(data.motion); |
| 204 | print_byte(data.dx); | 198 | print_byte(data.dx); |
| 205 | print_byte(data.mdx); | 199 | print_byte(data.mdx); |
| 206 | print_byte(data.dy); | 200 | print_byte(data.dy); |
| 207 | print_byte(data.mdy); | 201 | print_byte(data.mdy); |
| 208 | dprintf("\n"); | 202 | dprintf("\n"); |
| 209 | #endif | ||
| 210 | 203 | ||
| 211 | data.isMotion = (data.motion & 0x80) != 0; | 204 | data.isMotion = (data.motion & 0x80) != 0; |
| 212 | data.isOnSurface = (data.motion & 0x08) == 0; | 205 | data.isOnSurface = (data.motion & 0x08) == 0; |
