summaryrefslogtreecommitdiff
path: root/keyboards/ploopyco/trackball
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 /keyboards/ploopyco/trackball
parent3aef2bef8f6a3e33df4c0142da89f229320b212a (diff)
[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.
Diffstat (limited to 'keyboards/ploopyco/trackball')
-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
7 files changed, 40 insertions, 47 deletions
diff --git a/keyboards/ploopyco/trackball/readme.md b/keyboards/ploopyco/trackball/readme.md
index bd88d5c5aa..714f610346 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
The `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.
The `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.
-
-# Programming QMK-DFU onto the PloopyCo Trackball
-
-If 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:
-
- make ploopyco/trackball:default:production
-
-Once 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:
-
-
-| Fuse | Setting |
-|----------|------------------|
-| Low | `0xDF` |
-| High | `0xD8` or `0x98` |
-| Extended | `0xCB` |
-
-Original (Caterina) settings:
-
-| Fuse | Setting |
-|----------|------------------|
-| Low | `0xFF` |
-| High | `0xD8` |
-| Extended | `0xFE` |
diff --git a/keyboards/ploopyco/trackball/rev1/readme.md b/keyboards/ploopyco/trackball/rev1/readme.md
new file mode 100644
index 0000000000..c0b0223723
--- /dev/null
+++ b/keyboards/ploopyco/trackball/rev1/readme.md
@@ -0,0 +1,30 @@
+See the [main readme](../readme.md) for more details.
+
+This is just the rev 1.001-1.004 trackball
+
+# Programming QMK-DFU onto the PloopyCo Trackball (Advanced)
+
+If 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:
+
+ make ploopyco/trackball:default:production
+
+Once 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:
+
+
+| Fuse | Setting |
+|----------|------------------|
+| Low | `0xDF` |
+| High | `0xD8` or `0x98` |
+| Extended | `0xCB` |
+
+Original (Caterina) settings:
+
+| Fuse | Setting |
+|----------|------------------|
+| Low | `0xFF` |
+| High | `0xD8` |
+| Extended | `0xFE` |
+
+If 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.
+
+Additionally, 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 e69de29bb2..6ded83e74b 100644
--- a/keyboards/ploopyco/trackball/rev1/rules.mk
+++ b/keyboards/ploopyco/trackball/rev1/rules.mk
@@ -0,0 +1,2 @@
+# Bootloader selection
+BOOTLOADER = caterina
diff --git a/keyboards/ploopyco/trackball/rev1_005/readme.md b/keyboards/ploopyco/trackball/rev1_005/readme.md
new file mode 100644
index 0000000000..a923d16591
--- /dev/null
+++ b/keyboards/ploopyco/trackball/rev1_005/readme.md
@@ -0,0 +1,3 @@
+See the [main readme](../readme.md) for more details.
+
+This 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 e69de29bb2..bddd4e389e 100644
--- a/keyboards/ploopyco/trackball/rev1_005/rules.mk
+++ b/keyboards/ploopyco/trackball/rev1_005/rules.mk
@@ -0,0 +1,2 @@
+# Bootloader selection
+BOOTLOADER = atmel-dfu
diff --git a/keyboards/ploopyco/trackball/rules.mk b/keyboards/ploopyco/trackball/rules.mk
index 9e252fbddb..4ec870e659 100644
--- a/keyboards/ploopyco/trackball/rules.mk
+++ b/keyboards/ploopyco/trackball/rules.mk
@@ -4,9 +4,6 @@ MCU = atmega32u4
# Processor frequency
F_CPU = 8000000
-# Bootloader selection
-BOOTLOADER = caterina
-
# Build Options
# change yes to no to disable
#
diff --git a/keyboards/ploopyco/trackball/trackball.c b/keyboards/ploopyco/trackball/trackball.c
index 7b7b680271..94f2843460 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) {
if (debug_mouse) dprintf("Cons] X: %d, Y: %d\n", data.dx, data.dy);
// dprintf("Elapsed:%u, X: %f Y: %\n", i, pgm_read_byte(firmware_data+i));
- process_mouse_user(mouse_report, data.dx, data.dy);
+ process_mouse_user(mouse_report, data.dx, -data.dy);
}
}
@@ -172,27 +172,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
if (IS_MOUSEKEY_BUTTON(keycode)) {
report_mouse_t currentReport = pointing_device_get_report();
if (record->event.pressed) {
- if (keycode == KC_MS_BTN1)
- currentReport.buttons |= MOUSE_BTN1;
- else if (keycode == KC_MS_BTN2)
- currentReport.buttons |= MOUSE_BTN2;
- else if (keycode == KC_MS_BTN3)
- currentReport.buttons |= MOUSE_BTN3;
- else if (keycode == KC_MS_BTN4)
- currentReport.buttons |= MOUSE_BTN4;
- else if (keycode == KC_MS_BTN5)
- currentReport.buttons |= MOUSE_BTN5;
+ currentReport.buttons |= 1 << (keycode - KC_MS_BTN1);
} else {
- if (keycode == KC_MS_BTN1)
- currentReport.buttons &= ~MOUSE_BTN1;
- else if (keycode == KC_MS_BTN2)
- currentReport.buttons &= ~MOUSE_BTN2;
- else if (keycode == KC_MS_BTN3)
- currentReport.buttons &= ~MOUSE_BTN3;
- else if (keycode == KC_MS_BTN4)
- currentReport.buttons &= ~MOUSE_BTN4;
- else if (keycode == KC_MS_BTN5)
- currentReport.buttons &= ~MOUSE_BTN5;
+ currentReport.buttons &= ~(1 << (keycode - KC_MS_BTN1));
}
pointing_device_set_report(currentReport);
pointing_device_send();