mirror of
https://github.com/mist-devel/mist-firmware.git
synced 2026-04-17 00:15:25 +00:00
Merge pull request #59 from retrofun/db9_joystick_remap
DB9 joystick remap
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "errors.h"
|
||||
#include "arc_file.h"
|
||||
#include "utils.h"
|
||||
#include "usb/joymapping.h"
|
||||
|
||||
// up to 16 key can be remapped
|
||||
#define MAX_REMAP 16
|
||||
@@ -921,9 +922,11 @@ void user_io_poll() {
|
||||
if(!(joy0_state & JOY0_BTN1)) joy_map |= JOY_BTN1;
|
||||
if(!(joy0_state & JOY0_BTN2)) joy_map |= JOY_BTN2;
|
||||
|
||||
joy_map = virtual_joystick_mapping(0x00db, 0x0000, joy_map);
|
||||
|
||||
uint8_t idx = joystick_renumber(0);
|
||||
user_io_joystick(idx, joy_map);
|
||||
StateJoySet(joy_map, idx); // send to OSD
|
||||
StateJoySet(joy_map, mist_cfg.joystick_db9_fixed_index ? idx : hid_get_joysticks()); // send to OSD
|
||||
}
|
||||
|
||||
static int joy1_state = JOY1;
|
||||
@@ -938,9 +941,11 @@ void user_io_poll() {
|
||||
if(!(joy1_state & JOY1_BTN1)) joy_map |= JOY_BTN1;
|
||||
if(!(joy1_state & JOY1_BTN2)) joy_map |= JOY_BTN2;
|
||||
|
||||
joy_map = virtual_joystick_mapping(0x00db, 0x0001, joy_map);
|
||||
|
||||
uint8_t idx = joystick_renumber(1);
|
||||
user_io_joystick(idx, joy_map);
|
||||
StateJoySet(joy_map, idx); // send to OSD
|
||||
StateJoySet(joy_map, mist_cfg.joystick_db9_fixed_index ? idx : hid_get_joysticks() + 1); // send to OSD
|
||||
}
|
||||
|
||||
user_io_send_buttons(0);
|
||||
|
||||
Reference in New Issue
Block a user