[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.
This commit is contained in:
Drashna Jaelre 2020-11-18 14:20:29 -08:00 committed by GitHub
parent 3aef2bef8f
commit 88a783a8a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 46 additions and 70 deletions

View File

@ -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);
}
}
@ -171,31 +171,14 @@ 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();
}
#endif
return true;

View File

@ -17,7 +17,7 @@ To jump to the bootloader, hold down "Button 4" (the "forward" button on the lef
See 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).
# Customzing your PloopyCo Trackball
# Customzing your PloopyCo Mouse
While 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.

View File

@ -213,7 +213,7 @@ report_pmw_t pmw_read_burst(void) {
data.dx |= (data.mdx << 8);
data.dx = data.dx * -1;
data.dy |= (data.mdy << 8);
// data.dy = data.dy * -1;
data.dy = data.dy * -1;
spi_stop();

View File

@ -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` |

View File

@ -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.

View File

@ -0,0 +1,2 @@
# Bootloader selection
BOOTLOADER = caterina

View File

@ -0,0 +1,3 @@
See the [main readme](../readme.md) for more details.
This is just the rev 1.005+ trackball

View File

@ -0,0 +1,2 @@
# Bootloader selection
BOOTLOADER = atmel-dfu

View File

@ -4,9 +4,6 @@ MCU = atmega32u4
# Processor frequency
F_CPU = 8000000
# Bootloader selection
BOOTLOADER = caterina
# Build Options
# change yes to no to disable
#

View File

@ -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();