Permalink
Browse files

Refactoring

- update submodules
- add new haptic core with sources and sinks
  • Loading branch information...
matlo committed Aug 31, 2017
1 parent d0d1d1c commit a439448c7c58b089fe19befd7fcb8153bda85961
Showing with 4,133 additions and 2,268 deletions.
  1. +3 −0 core/Makefile
  2. +1 −12 core/args.c
  3. +5 −2 core/config.c
  4. +2 −12 core/config_reader.c
  5. +78 −48 core/connectors/btds4.c
  6. +5 −5 core/connectors/btstack/l2cap_btstack.c
  7. +12 −8 core/connectors/linux/bluetooth/l2cap_bluez.c
  8. +29 −15 core/connectors/sixaxis.c
  9. +15 −14 core/connectors/usb_con.c
  10. +56 −273 core/controller.c
  11. +1,193 −0 core/controller.c_G920
  12. +685 −0 core/haptic/common/ff_lg.c
  13. +0 −403 core/haptic/ff_conv.c
  14. +0 −980 core/haptic/ff_lg.c
  15. +104 −0 core/haptic/haptic_core.c
  16. +79 −0 core/haptic/haptic_sink.c
  17. +46 −0 core/haptic/haptic_source.c
  18. +72 −0 core/haptic/haptic_tweaks.c
  19. +374 −0 core/haptic/sink/haptic_sink_lg.c
  20. +141 −0 core/haptic/sink/haptic_sink_os.c
  21. +92 −0 core/haptic/sink/haptic_sink_rumble.c
  22. +310 −0 core/haptic/source/haptic_source_lg.c
  23. +108 −0 core/haptic/source/haptic_source_rumble.c
  24. +0 −10 core/include/config.h
  25. +5 −5 core/include/connectors/bluetooth/l2cap_abs.h
  26. +5 −20 core/include/controller.h
  27. +1 −3 core/include/gimx.h
  28. +145 −13 core/include/haptic/{ → common}/ff_lg.h
  29. +0 −82 core/include/haptic/ff_common.h
  30. +0 −17 core/include/haptic/ff_conv.h
  31. +15 −0 core/include/haptic/haptic_common.h
  32. +92 −0 core/include/haptic/haptic_core.h
  33. +77 −0 core/include/haptic/haptic_sink.h
  34. +29 −0 core/include/haptic/haptic_source.h
  35. +13 −0 core/include/haptic/haptic_tweaks.h
  36. +1 −0 core/include/mainloop.h
  37. +11 −6 core/mainloop.c
  38. +4 −6 core/test/haptic/Makefile
  39. +235 −231 core/test/haptic/ff_lg_test.c
  40. +2 −3 launcher/gimx-launcher.cpp
  41. +1 −1 shared/gimxcommon
  42. +2 −1 shared/gimxconfigeditor/include/EventCatcher.h
  43. +13 −14 shared/gimxconfigeditor/src/EventCatcher.cpp
  44. +50 −62 shared/gimxgpp/pcprog.c
  45. +1 −1 shared/gimxhid
  46. +1 −1 shared/gimxinput
  47. +1 −1 shared/gimxpoll
  48. +1 −1 shared/gimxserial
  49. +1 −1 shared/gimxtimer
  50. +1 −1 shared/gimxuhid
  51. +1 −1 shared/gimxusb
  52. +9 −9 utils/ds4tool.c
  53. +6 −6 utils/sixaddr.c
View
@@ -52,6 +52,9 @@ OBJECTS += $(patsubst %.c,%.o,$(wildcard connectors/*.c))
OBJECTS += $(patsubst %.c,%.o,$(wildcard connectors/gpp/*.c))
OBJECTS += $(patsubst %.c,%.o,$(wildcard connectors/report2event/*.c))
OBJECTS += $(patsubst %.c,%.o,$(wildcard haptic/*.c))
OBJECTS += $(patsubst %.c,%.o,$(wildcard haptic/source/*.c))
OBJECTS += $(patsubst %.c,%.o,$(wildcard haptic/sink/*.c))
OBJECTS += $(patsubst %.c,%.o,$(wildcard haptic/common/*.c))
ifneq ($(OS),Windows_NT)
OBJECTS += $(patsubst %.c,%.o,$(wildcard system/linux/*.c))
OBJECTS += $(patsubst %.c,%.o,$(wildcard connectors/linux/*/*.c))
View
@@ -142,8 +142,7 @@ int args_read(int argc, char *argv[], s_gimx_params* params)
{"curses", no_argument, &params->curses, 1},
{"window-events", no_argument, &params->window_events, 1},
{"btstack", no_argument, &params->btstack, 1},
{"debug.ff_lg", no_argument, &params->debug.ff_lg, 1},
{"debug.ff_conv", no_argument, &params->debug.ff_conv, 1},
{"debug.haptic", no_argument, &params->debug.haptic, 1},
{"debug.adapter", no_argument, &params->debug.adapter, 1},
{"debug.macros", no_argument, &params->debug.macros, 1},
{"debug.sixaxis", no_argument, &params->debug.sixaxis, 1},
@@ -435,15 +434,5 @@ int args_read(int argc, char *argv[], s_gimx_params* params)
log_info();
}
if (params->debug.ff_conv != 0)
{
params->debug.ff_lg = 1;
params->debug.ff_common = 1;
}
if (params->debug.ff_lg != 0)
{
params->debug.ff_common = 1;
}
return ret;
}
View
@@ -16,6 +16,7 @@
#include "gimx.h"
#include "macros.h"
#include <controller.h>
#include "include/haptic/haptic_core.h"
#define DEFAULT_RADIUS 512
#define DEFAULT_VELOCITY 1
@@ -91,7 +92,7 @@ void cfg_set_ffb_tweaks(const s_config_entry * entry)
ffb_tweaks[entry->controller_id][entry->profile_id].invert = entry->params.ffb_tweaks.invert;
}
const s_ffb_tweaks * cfg_get_ffb_tweaks(int controller)
static inline const s_ffb_tweaks * cfg_get_ffb_tweaks(int controller)
{
return ffb_tweaks[controller] + cfg_controllers[controller].current->index;
}
@@ -864,7 +865,9 @@ void cfg_profile_activation()
update_stick(i, j);
}
adapter_set_ffb_tweaks(i);
const s_ffb_tweaks * tweaks = cfg_get_ffb_tweaks(i);
adapter_set_haptic_tweaks(i, tweaks->invert);
}
cfg_controllers[i].next = NULL;
View
@@ -32,9 +32,6 @@ static s_config_entry entry;
static void reset_entry()
{
memset(&entry.device, 0x00, sizeof(entry.device));
#ifndef WIN32
entry.device.hid = -1;
#endif
memset(&entry.event, 0x00, sizeof(entry.event));
memset(&entry.params, 0x00, sizeof(entry.params));
}
@@ -135,13 +132,6 @@ static int GetDeviceId(xmlNode* a_node)
{
entry.device.id = i;
ginput_set_joystick_used(i);
#ifndef WIN32
entry.device.hid = ginput_joystick_get_hid(i);
#else
entry.device.usb_ids.vendor = 0;
entry.device.usb_ids.product = 0;
ginput_joystick_get_usb_ids(i, &entry.device.usb_ids.vendor, &entry.device.usb_ids.product);
#endif
break;
}
}
@@ -462,7 +452,7 @@ static int ProcessEventElement(xmlNode * a_node, unsigned char mapper)
&& entry.params.mapper.axis_props.axis == rel_axis_0
&& entry.params.mapper.axis_props.props == AXIS_PROP_CENTERED)
{
adapter_set_haptic(&entry, 0);
adapter_set_haptic_sink(entry.controller_id, entry.device.id, 0);
}
break;
default:
@@ -1101,7 +1091,7 @@ static int ProcessForceFeedbackElement(xmlNode * a_node)
{
cfg_set_ffb_tweaks(&entry);
// force FFB selection for 1st profile only
adapter_set_haptic(&entry, entry.profile_id == 0 ? 1 : 0);
adapter_set_haptic_sink(entry.controller_id, entry.device.id, entry.profile_id == 0 ? 1 : 0);
}
return ret;
Oops, something went wrong.

0 comments on commit a439448

Please sign in to comment.