Move pointing device driver code (#24445)
Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
parent
5c85271e48
commit
f5b495e06e
23 changed files with 544 additions and 546 deletions
|
@ -20,6 +20,14 @@
|
|||
#include "wait.h"
|
||||
#include "timer.h"
|
||||
#include <stdlib.h>
|
||||
#include "pointing_device_internal.h"
|
||||
|
||||
const pointing_device_driver_t analog_joystick_pointing_device_driver = {
|
||||
.init = analog_joystick_init,
|
||||
.get_report = analog_joystick_get_report,
|
||||
.set_cpi = NULL,
|
||||
.get_cpi = NULL,
|
||||
};
|
||||
|
||||
// Set Parameters
|
||||
#ifndef ANALOG_JOYSTICK_AUTO_AXIS
|
||||
|
@ -145,3 +153,16 @@ void analog_joystick_init(void) {
|
|||
maxAxisValues[1] = yOrigin + 100;
|
||||
#endif
|
||||
}
|
||||
|
||||
report_mouse_t analog_joystick_get_report(report_mouse_t mouse_report) {
|
||||
report_analog_joystick_t data = analog_joystick_read();
|
||||
|
||||
pd_dprintf("Raw ] X: %d, Y: %d\n", data.x, data.y);
|
||||
|
||||
mouse_report.x = data.x;
|
||||
mouse_report.y = data.y;
|
||||
|
||||
mouse_report.buttons = pointing_device_handle_buttons(mouse_report.buttons, data.button, POINTING_DEVICE_BUTTON1);
|
||||
|
||||
return mouse_report;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue