mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
PACKAGE-joymap: bump ver. 0.5.8 and fix musl build
This commit is contained in:
@@ -1,283 +0,0 @@
|
||||
diff --git a/clock.h b/clock.h
|
||||
index 3bf19e2..cc3d52f 100644
|
||||
--- a/clock.h
|
||||
+++ b/clock.h
|
||||
@@ -1,14 +1,16 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
+#include <stdint.h>
|
||||
+#include <unistd.h>
|
||||
|
||||
-static __uint64_t clock_millis() {
|
||||
+static uint64_t clock_millis() {
|
||||
struct timeval tv;
|
||||
- static __uint64_t last = 0;
|
||||
+ static uint64_t last = 0;
|
||||
int result = gettimeofday(&tv, NULL);
|
||||
if (result != 0) {
|
||||
printf("Failed to read clock\n");
|
||||
return last;
|
||||
}
|
||||
- last = (__uint64_t)tv.tv_sec * 1000 + (__uint64_t)tv.tv_usec / 1000;
|
||||
+ last = (uint64_t)tv.tv_sec * 1000 + (uint64_t)tv.tv_usec / 1000;
|
||||
return last;
|
||||
}
|
||||
diff --git a/devices.c b/devices.c
|
||||
index 439652c..8fb8128 100644
|
||||
--- a/devices.c
|
||||
+++ b/devices.c
|
||||
@@ -365,9 +365,9 @@ void move_mouse(int rdx, int rdy) {
|
||||
}
|
||||
|
||||
void repeat_mouse_move() {
|
||||
- static __uint64_t last = 0;
|
||||
+ static uint64_t last = 0;
|
||||
int mdx = 0, mdy = 0, mdw = 0;
|
||||
- __uint64_t current, delta;
|
||||
+ uint64_t current, delta;
|
||||
|
||||
if (last == 0) {
|
||||
last = clock_millis();
|
||||
diff --git a/events.c b/events.c
|
||||
index 1a2dacf..edc6026 100644
|
||||
--- a/events.c
|
||||
+++ b/events.c
|
||||
@@ -41,8 +41,8 @@ struct event_device;
|
||||
|
||||
struct mapping {
|
||||
int fd; /* /dev/input/event* file descriptor */
|
||||
- __uint16_t vendor;
|
||||
- __uint16_t product;
|
||||
+ uint16_t vendor;
|
||||
+ uint16_t product;
|
||||
int event_id;
|
||||
int jsnum;
|
||||
int mapped;
|
||||
@@ -68,9 +68,9 @@ struct event_device {
|
||||
|
||||
static int shifted=0;
|
||||
static int event_calibrate=0;
|
||||
-static __uint16_t shift_vendor;
|
||||
-static __uint16_t shift_product;
|
||||
-static __uint16_t shift_button;
|
||||
+static uint16_t shift_vendor;
|
||||
+static uint16_t shift_product;
|
||||
+static uint16_t shift_button;
|
||||
struct mapping *devices[MAX_DEVICES];
|
||||
struct event_device event_devices[MAX_EVENTS] = {0};
|
||||
|
||||
@@ -78,7 +78,7 @@ void set_event_input_calibrate(int set) {
|
||||
event_calibrate = set;
|
||||
}
|
||||
|
||||
-struct mapping *get_device_by_id(__uint16_t event_id, int create) {
|
||||
+struct mapping *get_device_by_id(uint16_t event_id, int create) {
|
||||
struct mapping *mapper;
|
||||
int i, j;
|
||||
|
||||
@@ -127,7 +127,7 @@ struct mapping *get_device_by_id(__uint16_t event_id, int create) {
|
||||
return mapper;
|
||||
}
|
||||
|
||||
-struct mapping *get_device_by_vendor(__uint16_t vendor, __uint16_t product, int create) {
|
||||
+struct mapping *get_device_by_vendor(uint16_t vendor, uint16_t product, int create) {
|
||||
struct mapping *mapper;
|
||||
int i, j;
|
||||
|
||||
@@ -177,7 +177,7 @@ struct mapping *get_device_by_vendor(__uint16_t vendor, __uint16_t product, int
|
||||
return mapper;
|
||||
}
|
||||
|
||||
-struct mapping *get_device(__uint16_t vendor, __uint16_t product, __uint16_t event_id, int create) {
|
||||
+struct mapping *get_device(uint16_t vendor, uint16_t product, uint16_t event_id, int create) {
|
||||
struct mapping *map;
|
||||
|
||||
if (create) {
|
||||
@@ -550,7 +550,7 @@ static void process_axis(struct mapping *mapper, int axis, int value) {
|
||||
int button=0;
|
||||
int i, j;
|
||||
struct program_axis_remap **axes_remap;
|
||||
- __uint16_t *sequence, *off;
|
||||
+ uint16_t *sequence, *off;
|
||||
int release = 0;
|
||||
|
||||
if ((mapper->vendor!=0x00ff)||(mapper->product!=0x0000))
|
||||
@@ -752,7 +752,7 @@ void remap_button(struct program_button_remap *btn) {
|
||||
}
|
||||
}
|
||||
|
||||
-void set_joystick_number(__uint16_t vendor, __uint16_t product, __uint16_t event_id, int device) {
|
||||
+void set_joystick_number(uint16_t vendor, uint16_t product, uint16_t event_id, int device) {
|
||||
struct mapping *mapper;
|
||||
mapper = get_device(vendor, product, event_id, 1);
|
||||
|
||||
diff --git a/mapparser.c b/mapparser.c
|
||||
index e48a2fe..924cd6e 100644
|
||||
--- a/mapparser.c
|
||||
+++ b/mapparser.c
|
||||
@@ -185,7 +185,7 @@ static int parse_flags(char *s) {
|
||||
return flags;
|
||||
}
|
||||
|
||||
-static void parse_sequence(__uint16_t *sequence, char *s, int base, int type) {
|
||||
+static void parse_sequence(uint16_t *sequence, char *s, int base, int type) {
|
||||
char *p;
|
||||
int releaseflag=0;
|
||||
int value;
|
||||
diff --git a/mapper.h b/mapper.h
|
||||
index cea53cd..cd765b5 100644
|
||||
--- a/mapper.h
|
||||
+++ b/mapper.h
|
||||
@@ -37,7 +37,7 @@ void release_mouse_buttons(void);
|
||||
void release_keys(void);
|
||||
void remap_button(struct program_button_remap *btn);
|
||||
void remap_axis(struct program_axis_remap *axis);
|
||||
-void set_joystick_number(__uint16_t vendor, __uint16_t product, __uint16_t event_id, int device);
|
||||
+void set_joystick_number(uint16_t vendor, uint16_t product, uint16_t event_id, int device);
|
||||
int mapper_code_install(void);
|
||||
int mapper_code_uninstall(void);
|
||||
void program_run();
|
||||
diff --git a/program.h b/program.h
|
||||
index c3533e1..cd5a8b7 100644
|
||||
--- a/program.h
|
||||
+++ b/program.h
|
||||
@@ -2,6 +2,8 @@
|
||||
#define __program_h
|
||||
|
||||
#include <sys/types.h>
|
||||
+#include <stdint.h>
|
||||
+#include <unistd.h>
|
||||
|
||||
#define DEVICE_JOYSTICK 128
|
||||
#define DEVICE_KBD 64
|
||||
@@ -104,53 +106,53 @@
|
||||
// system. Otherwise the map is ignored.
|
||||
// if vendor=255 and product=0, then this refers to the virtual CODE joystick
|
||||
struct program_axis_remap {
|
||||
- __uint8_t program; //PROGRAM_AXIS_REMAP
|
||||
- __uint8_t joystick;
|
||||
- __uint16_t vendor;
|
||||
- __uint16_t product;
|
||||
- __uint8_t srcaxis;
|
||||
- __uint8_t device; //low bits of device identify joystick
|
||||
- __uint8_t type;
|
||||
- __uint8_t flags;
|
||||
- __uint16_t axis;
|
||||
- __uint16_t plus[MAX_SEQUENCE]; //if top bit set, release
|
||||
- __uint16_t minus[MAX_SEQUENCE]; //if top bit set, release
|
||||
- __int32_t saved_value; // for implementing binary decisions
|
||||
- __int32_t min;
|
||||
- __int32_t max;
|
||||
- __int32_t deadzone;
|
||||
- __int32_t speed;
|
||||
+ uint8_t program; //PROGRAM_AXIS_REMAP
|
||||
+ uint8_t joystick;
|
||||
+ uint16_t vendor;
|
||||
+ uint16_t product;
|
||||
+ uint8_t srcaxis;
|
||||
+ uint8_t device; //low bits of device identify joystick
|
||||
+ uint8_t type;
|
||||
+ uint8_t flags;
|
||||
+ uint16_t axis;
|
||||
+ uint16_t plus[MAX_SEQUENCE]; //if top bit set, release
|
||||
+ uint16_t minus[MAX_SEQUENCE]; //if top bit set, release
|
||||
+ int32_t saved_value; // for implementing binary decisions
|
||||
+ int32_t min;
|
||||
+ int32_t max;
|
||||
+ int32_t deadzone;
|
||||
+ int32_t speed;
|
||||
};
|
||||
|
||||
struct program_axis_properties {
|
||||
- __uint8_t program; //PROGRAM_AXIS_PROPERTIES
|
||||
- __uint8_t joystick;
|
||||
- __uint16_t vendor;
|
||||
- __uint16_t product;
|
||||
- __uint8_t srcaxis;
|
||||
- __uint8_t flags;
|
||||
- __int16_t scale; //8.8 fixed point
|
||||
- __int16_t bias; //shift after scale
|
||||
- __uint16_t threshhold;
|
||||
+ uint8_t program; //PROGRAM_AXIS_PROPERTIES
|
||||
+ uint8_t joystick;
|
||||
+ uint16_t vendor;
|
||||
+ uint16_t product;
|
||||
+ uint8_t srcaxis;
|
||||
+ uint8_t flags;
|
||||
+ int16_t scale; //8.8 fixed point
|
||||
+ int16_t bias; //shift after scale
|
||||
+ uint16_t threshhold;
|
||||
};
|
||||
|
||||
#define press sequence[0]
|
||||
#define release sequence[0]
|
||||
struct program_button_remap {
|
||||
- __uint8_t program; //PROGRAM_BUTTON_REMAP
|
||||
- __uint8_t joystick;
|
||||
- __uint16_t vendor;
|
||||
- __uint16_t product;
|
||||
- __uint16_t srcbutton;
|
||||
- __uint8_t device; //low bits of device identify joystick
|
||||
- __uint8_t type;
|
||||
- __uint8_t flags;
|
||||
- __uint16_t sequence[MAX_SEQUENCE]; //if top bit set, release
|
||||
- __int32_t speed;
|
||||
+ uint8_t program; //PROGRAM_BUTTON_REMAP
|
||||
+ uint8_t joystick;
|
||||
+ uint16_t vendor;
|
||||
+ uint16_t product;
|
||||
+ uint16_t srcbutton;
|
||||
+ uint8_t device; //low bits of device identify joystick
|
||||
+ uint8_t type;
|
||||
+ uint8_t flags;
|
||||
+ uint16_t sequence[MAX_SEQUENCE]; //if top bit set, release
|
||||
+ int32_t speed;
|
||||
};
|
||||
|
||||
struct program_code {
|
||||
- __uint8_t program; //PROGRAM_CODE
|
||||
+ uint8_t program; //PROGRAM_CODE
|
||||
unsigned char code[MAX_CODE_SIZE]; //1024 4 byte codes
|
||||
};
|
||||
|
||||
diff --git a/vm.c b/vm.c
|
||||
index 48371fc..1103a58 100644
|
||||
--- a/vm.c
|
||||
+++ b/vm.c
|
||||
@@ -38,24 +38,24 @@ static int installed=0;
|
||||
|
||||
static int timestamp=0;
|
||||
static int tick=0;
|
||||
-static __uint64_t started=0;
|
||||
+static uint64_t started=0;
|
||||
static int executing=0;
|
||||
|
||||
//controller variables
|
||||
-static __int16_t code_analog[64];
|
||||
+static int16_t code_analog[64];
|
||||
//controller variables
|
||||
-static __uint8_t code_bit[128];
|
||||
+static uint8_t code_bit[128];
|
||||
//controller variables
|
||||
-static __int16_t js_analog[16][64];
|
||||
+static int16_t js_analog[16][64];
|
||||
//controller variables
|
||||
-static __uint8_t js_bit[16][128];
|
||||
-static __int16_t currentmode=0;
|
||||
-static __int16_t firstscan=1;
|
||||
-static __int16_t clocktick=1;
|
||||
-static __int16_t xrel=0;
|
||||
-static __int16_t yrel=0;
|
||||
-static __int16_t zrel=0;
|
||||
-static __uint8_t code[MAX_CODE_SIZE];
|
||||
+static uint8_t js_bit[16][128];
|
||||
+static int16_t currentmode=0;
|
||||
+static int16_t firstscan=1;
|
||||
+static int16_t clocktick=1;
|
||||
+static int16_t xrel=0;
|
||||
+static int16_t yrel=0;
|
||||
+static int16_t zrel=0;
|
||||
+static uint8_t code[MAX_CODE_SIZE];
|
||||
//registers inaccessible to user
|
||||
//allocated by compiler
|
||||
static int status=0; //0 = no valid program 1=valid program
|
@@ -0,0 +1,127 @@
|
||||
From 11ef6a05adf55fded350d46ff6ad771b626c0c30 Mon Sep 17 00:00:00 2001
|
||||
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
|
||||
Date: Mon, 28 Oct 2024 22:21:09 +0100
|
||||
Subject: [PATCH 1/2] use tv instead of time member for input_event
|
||||
|
||||
---
|
||||
devices.c | 48 ++++++++++++++++++++++++++++++++++++++++--------
|
||||
1 file changed, 40 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/devices.c b/devices.c
|
||||
index 63cb104..00f3710 100644
|
||||
--- a/devices.c
|
||||
+++ b/devices.c
|
||||
@@ -13,6 +13,14 @@
|
||||
#include "program.h"
|
||||
#include "mapper.h"
|
||||
|
||||
+#ifndef input_event_sec
|
||||
+#define input_event_sec time.tv_sec
|
||||
+#endif
|
||||
+
|
||||
+#ifndef input_event_usec
|
||||
+#define input_event_usec time.tv_usec
|
||||
+#endif
|
||||
+
|
||||
#define NUM_JOYSTICKS 10
|
||||
#define INTERVAL 50
|
||||
#define ABS_UL 1 + ABS_MAX / ULONG_BITS
|
||||
@@ -343,7 +351,10 @@ void unregister_devices();
|
||||
|
||||
void press_key(int code, int value) {
|
||||
struct input_event event;
|
||||
- gettimeofday(&event.time, NULL);
|
||||
+ struct timeval tv;
|
||||
+ gettimeofday(&tv, NULL);
|
||||
+ event.input_event_sec = tv.tv_sec;
|
||||
+ event.input_event_usec = tv.tv_usec;
|
||||
event.type=EV_KEY;
|
||||
event.code=code;
|
||||
event.value=value;
|
||||
@@ -363,7 +374,10 @@ void release_keys(void) {
|
||||
|
||||
void press_mouse_button(int code, int value) {
|
||||
struct input_event event;
|
||||
- gettimeofday(&event.time, NULL);
|
||||
+ struct timeval tv;
|
||||
+ gettimeofday(&tv, NULL);
|
||||
+ event.input_event_sec = tv.tv_sec;
|
||||
+ event.input_event_usec = tv.tv_usec;
|
||||
event.type=EV_KEY;
|
||||
event.code=code;
|
||||
event.value=value;
|
||||
@@ -401,7 +415,10 @@ void move_mouse_wheel(int rdw) {
|
||||
|
||||
void send_move_mouse_x(int dx) {
|
||||
struct input_event event;
|
||||
- gettimeofday(&event.time, NULL);
|
||||
+ struct timeval tv;
|
||||
+ gettimeofday(&tv, NULL);
|
||||
+ event.input_event_sec = tv.tv_sec;
|
||||
+ event.input_event_usec = tv.tv_usec;
|
||||
event.type=EV_REL;
|
||||
event.code=REL_X;
|
||||
event.value=dx;
|
||||
@@ -414,7 +431,10 @@ void send_move_mouse_x(int dx) {
|
||||
|
||||
void send_move_mouse_wheel(int dwheel) {
|
||||
struct input_event event;
|
||||
- gettimeofday(&event.time, NULL);
|
||||
+ struct timeval tv;
|
||||
+ gettimeofday(&tv, NULL);
|
||||
+ event.input_event_sec = tv.tv_sec;
|
||||
+ event.input_event_usec = tv.tv_usec;
|
||||
event.type=EV_REL;
|
||||
event.code=REL_WHEEL;
|
||||
event.value=dwheel;
|
||||
@@ -427,7 +447,10 @@ void send_move_mouse_wheel(int dwheel) {
|
||||
|
||||
void send_move_mouse_y(int dy) {
|
||||
struct input_event event;
|
||||
- gettimeofday(&event.time, NULL);
|
||||
+ struct timeval tv;
|
||||
+ gettimeofday(&tv, NULL);
|
||||
+ event.input_event_sec = tv.tv_sec;
|
||||
+ event.input_event_usec = tv.tv_usec;
|
||||
event.type=EV_REL;
|
||||
event.code=REL_Y;
|
||||
event.value=dy;
|
||||
@@ -500,7 +523,10 @@ void release_mouse_buttons(void) {
|
||||
|
||||
void press_joy_button(int j, int code, int value) {
|
||||
struct input_event event;
|
||||
- gettimeofday(&event.time, NULL);
|
||||
+ struct timeval tv;
|
||||
+ gettimeofday(&tv, NULL);
|
||||
+ event.input_event_sec = tv.tv_sec;
|
||||
+ event.input_event_usec = tv.tv_usec;
|
||||
if (j==255) {
|
||||
event.type=EV_KEY;
|
||||
event.code=code;
|
||||
@@ -564,7 +590,10 @@ int calibrate(int j, int v) {
|
||||
|
||||
void set_joy_axis(int j, int axis, int value) {
|
||||
struct input_event event;
|
||||
- gettimeofday(&event.time, NULL);
|
||||
+ struct timeval tv;
|
||||
+ gettimeofday(&tv, NULL);
|
||||
+ event.input_event_sec = tv.tv_sec;
|
||||
+ event.input_event_usec = tv.tv_usec;
|
||||
value = rescale(value);
|
||||
if (j==255) {
|
||||
event.type=EV_ABS;
|
||||
@@ -590,7 +619,10 @@ void set_joy_axis(int j, int axis, int value) {
|
||||
|
||||
void set_joy_ff_status(int j, int effect, int value) {
|
||||
struct input_event event;
|
||||
- gettimeofday(&event.time, NULL);
|
||||
+ struct timeval tv;
|
||||
+ gettimeofday(&tv, NULL);
|
||||
+ event.input_event_sec = tv.tv_sec;
|
||||
+ event.input_event_usec = tv.tv_usec;
|
||||
event.type=EV_FF_STATUS;
|
||||
event.code=effect;
|
||||
event.value=value;
|
||||
--
|
||||
2.45.2.windows.1
|
||||
|
@@ -0,0 +1,32 @@
|
||||
From bac06cd0d1a0438cccf0db1f35b29dfc70f52bbd Mon Sep 17 00:00:00 2001
|
||||
From: Apaczer <94932128+Apaczer@users.noreply.github.com>
|
||||
Date: Mon, 28 Oct 2024 23:39:40 +0100
|
||||
Subject: [PATCH 2/2] Fix division-by-zero for ARM EABI in musl
|
||||
|
||||
---
|
||||
tools/input_info.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/tools/input_info.c b/tools/input_info.c
|
||||
index 11211c4..6dac8d2 100644
|
||||
--- a/tools/input_info.c
|
||||
+++ b/tools/input_info.c
|
||||
@@ -11,6 +11,15 @@
|
||||
#define ULONG_BITS (8 * sizeof (unsigned long))
|
||||
#endif
|
||||
|
||||
+int __aeabi_idiv0(int return_value)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+long long __aeabi_ldiv0(long long return_value)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
int has_bit(unsigned long data[], const size_t bit) {
|
||||
return !!(data[bit / ULONG_BITS] & (1uL << (bit % ULONG_BITS)));
|
||||
}
|
||||
--
|
||||
2.45.2.windows.1
|
||||
|
@@ -1,2 +1,2 @@
|
||||
# Locally calculated
|
||||
sha256 9766b33992f829489b559947979cf9d74518c4a24e254f7015a29d606d28f403 joymap-0.5.5.tar.gz
|
||||
sha256 9cbd4db0781d06ad49930d8cc47735c065d7c5249f5f921164fa93b52445da64 joymap-0.5.8.tar.gz
|
||||
|
@@ -4,14 +4,14 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
JOYMAP_VERSION = 0.5.5
|
||||
JOYMAP_VERSION = 0.5.8
|
||||
JOYMAP_SOURCE = joymap-$(JOYMAP_VERSION).tar.gz
|
||||
JOYMAP_SITE = http://downloads.sourceforge.net/project/linuxjoymap
|
||||
JOYMAP_LICENSE = GPL-2.0
|
||||
JOYMAP_LICENSE_FILES = COPYING
|
||||
|
||||
define JOYMAP_BUILD_CMDS
|
||||
$(MAKE) CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" LD="$(TARGET_LD)" -C $(@D)
|
||||
$(MAKE) CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" LD="$(TARGET_LD)" -C $(@D) loadmap
|
||||
"$(TARGET_CC)" $(@D)/tools/input_info.c -o $(@D)/tools/input_info
|
||||
endef
|
||||
|
||||
|
Reference in New Issue
Block a user