aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2020-11-18 14:20:29 -0800
committerGitHub <noreply@github.com>2020-11-18 23:20:29 +0100
commit88a783a8a769e604fa13947ee9c556f0dc1c95ad (patch)
treee1a7803f7d4a17af1f0f1be0c260669a9e939441
parent3aef2bef8f6a3e33df4c0142da89f229320b212a (diff)
downloadqmk_firmware-88a783a8a769e604fa13947ee9c556f0dc1c95ad.tar.gz
qmk_firmware-88a783a8a769e604fa13947ee9c556f0dc1c95ad.zip
[Keyboard] PloopyCo update and fixes (#10936)
This is based on feedback talking with crop_octagon about the device. Future trackballs will ship with ATMEL DFU for simplicity. This also includes some fixes and optimizations based on code review and tinkering on my own devices.
-rw-r--r--keyboards/ploopyco/mouse/mouse.c25
-rw-r--r--keyboards/ploopyco/mouse/readme.md2
-rw-r--r--keyboards/ploopyco/pmw3360.c2
-rw-r--r--keyboards/ploopyco/trackball/readme.md23
-rw-r--r--keyboards/ploopyco/trackball/rev1/readme.md30
-rw-r--r--keyboards/ploopyco/trackball/rev1/rules.mk2
-rw-r--r--keyboards/ploopyco/trackball/rev1_005/readme.md3
-rw-r--r--keyboards/ploopyco/trackball/rev1_005/rules.mk2
-rw-r--r--keyboards/ploopyco/trackball/rules.mk3
-rw-r--r--keyboards/ploopyco/trackball/trackball.c24
10 files changed, 46 insertions, 70 deletions
diff --git a/keyboards/ploopyco/mouse/mouse.c b/keyboards/ploopyco/mouse/mouse.c
index 7e44feaf7..788a0a1f0 100644
--- a/keyboards/ploopyco/mouse/mouse.c
+++ b/keyboards/ploopyco/mouse/mouse.c
@@ -140,7 +140,7 @@ __attribute__((weak)) void process_mouse(report_mouse_t* mouse_report) {
140 if (debug_mouse) dprintf("Cons] X: %d, Y: %d\n", data.dx, data.dy); 140 if (debug_mouse) dprintf("Cons] X: %d, Y: %d\n", data.dx, data.dy);
141 // dprintf("Elapsed:%u, X: %f Y: %\n", i, pgm_read_byte(firmware_data+i)); 141 // dprintf("Elapsed:%u, X: %f Y: %\n", i, pgm_read_byte(firmware_data+i));
142 142
143 process_mouse_user(mouse_report, data.dx, -data.dy); 143 process_mouse_user(mouse_report, data.dx, data.dy);
144 } 144 }
145} 145}
146 146
@@ -171,31 +171,14 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
171 if (IS_MOUSEKEY_BUTTON(keycode)) { 171 if (IS_MOUSEKEY_BUTTON(keycode)) {
172 report_mouse_t currentReport = pointing_device_get_report(); 172 report_mouse_t currentReport = pointing_device_get_report();
173 if (record->event.pressed) { 173 if (record->event.pressed) {
174 if (keycode == KC_MS_BTN1) 174 currentReport.buttons |= 1 << (keycode - KC_MS_BTN1);
175 currentReport.buttons |= MOUSE_BTN1;
176 else if (keycode == KC_MS_BTN2)
177 currentReport.buttons |= MOUSE_BTN2;
178 else if (keycode == KC_MS_BTN3)
179 currentReport.buttons |= MOUSE_BTN3;
180 else if (keycode == KC_MS_BTN4)
181 currentReport.buttons |= MOUSE_BTN4;
182 else if (keycode == KC_MS_BTN5)
183 currentReport.buttons |= MOUSE_BTN5;
184 } else { 175 } else {
185 if (keycode == KC_MS_BTN1) 176 currentReport.buttons &= ~(1 << (keycode - KC_MS_BTN1));
186 currentReport.buttons &= ~MOUSE_BTN1;
187 else if (keycode == KC_MS_BTN2)
188 currentReport.buttons &= ~MOUSE_BTN2;
189 else if (keycode == KC_MS_BTN3)
190 currentReport.buttons &= ~MOUSE_BTN3;
191 else if (keycode == KC_MS_BTN4)
192 currentReport.buttons &= ~MOUSE_BTN4;
193 else if (keycode == KC_MS_BTN5)
194 currentReport.buttons &= ~MOUSE_BTN5;
195 } 177 }
196 pointing_device_set_report(currentReport); 178 pointing_device_set_report(currentReport);
197 pointing_device_send(); 179 pointing_device_send();
198 } 180 }
181
199#endif 182#endif
200 183
201 return true; 184 return true;
diff --git a/keyboards/ploopyco/mouse/readme.md b/keyboards/ploopyco/mouse/readme.md
index fd0f932c6..5532a1998 100644
--- a/keyboards/ploopyco/mouse/readme.md
+++ b/keyboards/ploopyco/mouse/readme.md
@@ -17,7 +17,7 @@ To jump to the bootloader, hold down "Button 4" (the "forward" button on the lef
17 17
18See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). 18See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
19 19
20# Customzing your PloopyCo Trackball 20# Customzing your PloopyCo Mouse
21 21
22While the defaults are designed so that it can be plugged in and used right away, there are a number of things that you may want to change. Such as adding DPI control, or to use the ball to scroll while holding a button. To allow for this sort of control, there is a callback for both the scroll wheel and the mouse censor. 22While the defaults are designed so that it can be plugged in and used right away, there are a number of things that you may want to change. Such as adding DPI control, or to use the ball to scroll while holding a button. To allow for this sort of control, there is a callback for both the scroll wheel and the mouse censor.
23 23
diff --git a/keyboards/ploopyco/pmw3360.c b/keyboards/ploopyco/pmw3360.c
index 1bd03e8b9..8007fecef 100644
--- a/keyboards/ploopyco/pmw3360.c
+++ b/keyboards/ploopyco/pmw3360.c
@@ -213,7 +213,7 @@ report_pmw_t pmw_read_burst(void) {
213 data.dx |= (data.mdx << 8); 213 data.dx |= (data.mdx << 8);
214 data.dx = data.dx * -1; 214 data.dx = data.dx * -1;
215 data.dy |= (data.mdy << 8); 215 data.dy |= (data.mdy << 8);
216 // data.dy = data.dy * -1; 216 data.dy = data.dy * -1;
217 217
218 spi_stop(); 218 spi_stop();
219 219
diff --git a/keyboards/ploopyco/trackball/readme.md b/keyboards/ploopyco/trackball/readme.md
index bd88d5c5a..714f61034 100644
--- a/keyboards/ploopyco/trackball/readme.md
+++ b/keyboards/ploopyco/trackball/readme.md
@@ -58,26 +58,3 @@ To configure/set your own array, there are two defines to use, `PLOOPY_DPI_OPTIO
58The `PLOOPY_DPI_OPTIONS` array sets the values that you want to be able to cycle through, and the order they are in. The "default" define lets the firmware know which of these options is the default and should be loaded by default. 58The `PLOOPY_DPI_OPTIONS` array sets the values that you want to be able to cycle through, and the order they are in. The "default" define lets the firmware know which of these options is the default and should be loaded by default.
59 59
60The `DPI_CONFIG` macro will cycle through the values in the array, each time you hit it. And it stores this value in persistent memory, so it will load it the next time the device powers up. 60The `DPI_CONFIG` macro will cycle through the values in the array, each time you hit it. And it stores this value in persistent memory, so it will load it the next time the device powers up.
61
62# Programming QMK-DFU onto the PloopyCo Trackball
63
64If you would rather have DFU on this board, you can use the QMK-DFU bootloader on the device. To do so, you want to run:
65
66 make ploopyco/trackball:default:production
67
68Once you have that, you'll need to [ISP Flash](https://docs.qmk.fm/#/isp_flashing_guide) the chip with the new bootloader hex file created (or the production hex), and set the fuses:
69
70
71| Fuse | Setting |
72|----------|------------------|
73| Low | `0xDF` |
74| High | `0xD8` or `0x98` |
75| Extended | `0xCB` |
76
77Original (Caterina) settings:
78
79| Fuse | Setting |
80|----------|------------------|
81| Low | `0xFF` |
82| High | `0xD8` |
83| Extended | `0xFE` |
diff --git a/keyboards/ploopyco/trackball/rev1/readme.md b/keyboards/ploopyco/trackball/rev1/readme.md
new file mode 100644
index 000000000..c0b022372
--- /dev/null
+++ b/keyboards/ploopyco/trackball/rev1/readme.md
@@ -0,0 +1,30 @@
1See the [main readme](../readme.md) for more details.
2
3This is just the rev 1.001-1.004 trackball
4
5# Programming QMK-DFU onto the PloopyCo Trackball (Advanced)
6
7If you would rather have DFU on this board, you can use the QMK-DFU bootloader on the device. To do so, you want to run:
8
9 make ploopyco/trackball:default:production
10
11Once you have that, you'll need to [ISP Flash](https://docs.qmk.fm/#/isp_flashing_guide) the chip with the new "production" hex file created (or the production hex), and set the fuses:
12
13
14| Fuse | Setting |
15|----------|------------------|
16| Low | `0xDF` |
17| High | `0xD8` or `0x98` |
18| Extended | `0xCB` |
19
20Original (Caterina) settings:
21
22| Fuse | Setting |
23|----------|------------------|
24| Low | `0xFF` |
25| High | `0xD8` |
26| Extended | `0xFE` |
27
28If you're using QMK DFU, you'll also need to add `BOOTLOADER=qmk-dfu` to your keymap's rules.mk file, to ensure that the reboot/reset works correctly. Otherwise, it will jump right back into the firmware, like nothing happened.
29
30Additionally, once you've flashed the qmk-dfu bootloader onto your device, you will no longer be able to use the Arduino IDE to flash the board. You'll need to use the command line or QMK Toolbox to flash it.
diff --git a/keyboards/ploopyco/trackball/rev1/rules.mk b/keyboards/ploopyco/trackball/rev1/rules.mk
index e69de29bb..6ded83e74 100644
--- a/keyboards/ploopyco/trackball/rev1/rules.mk
+++ b/keyboards/ploopyco/trackball/rev1/rules.mk
@@ -0,0 +1,2 @@
1# Bootloader selection
2BOOTLOADER = caterina
diff --git a/keyboards/ploopyco/trackball/rev1_005/readme.md b/keyboards/ploopyco/trackball/rev1_005/readme.md
new file mode 100644
index 000000000..a923d1659
--- /dev/null
+++ b/keyboards/ploopyco/trackball/rev1_005/readme.md
@@ -0,0 +1,3 @@
1See the [main readme](../readme.md) for more details.
2
3This is just the rev 1.005+ trackball
diff --git a/keyboards/ploopyco/trackball/rev1_005/rules.mk b/keyboards/ploopyco/trackball/rev1_005/rules.mk
index e69de29bb..bddd4e389 100644
--- a/keyboards/ploopyco/trackball/rev1_005/rules.mk
+++ b/keyboards/ploopyco/trackball/rev1_005/rules.mk
@@ -0,0 +1,2 @@
1# Bootloader selection
2BOOTLOADER = atmel-dfu
diff --git a/keyboards/ploopyco/trackball/rules.mk b/keyboards/ploopyco/trackball/rules.mk
index 9e252fbdd..4ec870e65 100644
--- a/keyboards/ploopyco/trackball/rules.mk
+++ b/keyboards/ploopyco/trackball/rules.mk
@@ -4,9 +4,6 @@ MCU = atmega32u4
4# Processor frequency 4# Processor frequency
5F_CPU = 8000000 5F_CPU = 8000000
6 6
7# Bootloader selection
8BOOTLOADER = caterina
9
10# Build Options 7# Build Options
11# change yes to no to disable 8# change yes to no to disable
12# 9#
diff --git a/keyboards/ploopyco/trackball/trackball.c b/keyboards/ploopyco/trackball/trackball.c
index 7b7b68027..94f284346 100644
--- a/keyboards/ploopyco/trackball/trackball.c
+++ b/keyboards/ploopyco/trackball/trackball.c
@@ -140,7 +140,7 @@ __attribute__((weak)) void process_mouse(report_mouse_t* mouse_report) {
140 if (debug_mouse) dprintf("Cons] X: %d, Y: %d\n", data.dx, data.dy); 140 if (debug_mouse) dprintf("Cons] X: %d, Y: %d\n", data.dx, data.dy);
141 // dprintf("Elapsed:%u, X: %f Y: %\n", i, pgm_read_byte(firmware_data+i)); 141 // dprintf("Elapsed:%u, X: %f Y: %\n", i, pgm_read_byte(firmware_data+i));
142 142
143 process_mouse_user(mouse_report, data.dx, data.dy); 143 process_mouse_user(mouse_report, data.dx, -data.dy);
144 } 144 }
145} 145}
146 146
@@ -172,27 +172,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
172 if (IS_MOUSEKEY_BUTTON(keycode)) { 172 if (IS_MOUSEKEY_BUTTON(keycode)) {
173 report_mouse_t currentReport = pointing_device_get_report(); 173 report_mouse_t currentReport = pointing_device_get_report();
174 if (record->event.pressed) { 174 if (record->event.pressed) {
175 if (keycode == KC_MS_BTN1) 175 currentReport.buttons |= 1 << (keycode - KC_MS_BTN1);
176 currentReport.buttons |= MOUSE_BTN1;
177 else if (keycode == KC_MS_BTN2)
178 currentReport.buttons |= MOUSE_BTN2;
179 else if (keycode == KC_MS_BTN3)
180 currentReport.buttons |= MOUSE_BTN3;
181 else if (keycode == KC_MS_BTN4)
182 currentReport.buttons |= MOUSE_BTN4;
183 else if (keycode == KC_MS_BTN5)
184 currentReport.buttons |= MOUSE_BTN5;
185 } else { 176 } else {
186 if (keycode == KC_MS_BTN1) 177 currentReport.buttons &= ~(1 << (keycode - KC_MS_BTN1));
187 currentReport.buttons &= ~MOUSE_BTN1;
188 else if (keycode == KC_MS_BTN2)
189 currentReport.buttons &= ~MOUSE_BTN2;
190 else if (keycode == KC_MS_BTN3)
191 currentReport.buttons &= ~MOUSE_BTN3;
192 else if (keycode == KC_MS_BTN4)
193 currentReport.buttons &= ~MOUSE_BTN4;
194 else if (keycode == KC_MS_BTN5)
195 currentReport.buttons &= ~MOUSE_BTN5;
196 } 178 }
197 pointing_device_set_report(currentReport); 179 pointing_device_set_report(currentReport);
198 pointing_device_send(); 180 pointing_device_send();