From ce551bcb91eee90c5318da99149c85686c8dcaad Mon Sep 17 00:00:00 2001 From: Wolfywolfy Date: Thu, 14 Nov 2024 11:39:37 -0300 Subject: [PATCH] Code refactor. --- Makefile | 4 ++-- modules/pademu/Makefile | 8 ++++---- modules/pademu/ds34usb.c | 4 ++-- modules/pademu/pademu.c | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 85e434589..1e4f644c0 100644 --- a/Makefile +++ b/Makefile @@ -328,7 +328,7 @@ clean: download_lwNBD echo " -ds34bt" $(MAKE) -C modules/ds34bt clean echo " -pademu" - $(MAKE) -C modules/pademu USE_USB=1 USE_BT=1 clean + $(MAKE) -C modules/pademu USE_DS34USB=1 USE_DS34BT=1 clean echo "-pc tools" $(MAKE) -C pc clean @@ -521,7 +521,7 @@ $(EE_ASM_DIR)ds34usb.c: modules/ds34usb/iop/ds34usb.irx | $(EE_ASM_DIR) $(BIN2C) $< $@ $(*F)_irx modules/pademu/pademu.irx: modules/pademu - $(MAKE) USE_USB=1 USE_BT=1 -C $< all + $(MAKE) USE_DS34USB=1 USE_DS34BT=1 -C $< all $(EE_ASM_DIR)pademu.c: modules/pademu/pademu.irx $(BIN2C) $< $@ $(*F)_irx diff --git a/modules/pademu/Makefile b/modules/pademu/Makefile index c6cf9efd1..8cd504286 100644 --- a/modules/pademu/Makefile +++ b/modules/pademu/Makefile @@ -2,13 +2,13 @@ IOP_OBJS = pademu.o sys_utils.o imports.o exports.o padmacro.o ds34common.o IOP_BIN = pademu.irx -ifeq ($(USE_USB),1) -IOP_CFLAGS += -DUSB +ifeq ($(USE_DS34USB),1) +IOP_CFLAGS += -DDS34USB IOP_OBJS += ds34usb.o endif -ifeq ($(USE_BT),1) -IOP_CFLAGS += -DBT +ifeq ($(USE_DS34BT),1) +IOP_CFLAGS += -DDS34BT IOP_OBJS += ds34bt.o endif diff --git a/modules/pademu/ds34usb.c b/modules/pademu/ds34usb.c index 63b8d60bc..bbdefcc81 100644 --- a/modules/pademu/ds34usb.c +++ b/modules/pademu/ds34usb.c @@ -133,7 +133,7 @@ static int usb_connect(int devId) ds34pad[pad].status = DS34USB_STATE_AUTHORIZED; - ds34pad[pad].controlEndp = UsbOpenEndpoint(devId, NULL); + ds34pad[pad].controlEndp = sceUsbdOpenPipe(devId, NULL); device = (UsbDeviceDescriptor *)sceUsbdScanStaticDescriptor(devId, NULL, USB_DT_DEVICE); config = (UsbConfigDescriptor *)sceUsbdScanStaticDescriptor(devId, device, USB_DT_CONFIG); @@ -544,7 +544,7 @@ static int ds34usb_get_status(struct pad_funcs *pf) static int ds34usb_get_model(struct pad_funcs *pf, int port) { - (void *)port; + (void)port; ds34usb_device *pad = pf->priv; int ret; diff --git a/modules/pademu/pademu.c b/modules/pademu/pademu.c index b8bb8b0e9..197efedcc 100644 --- a/modules/pademu/pademu.c +++ b/modules/pademu/pademu.c @@ -12,13 +12,13 @@ static struct pad_funcs *padf[MAX_PORTS]; -#ifdef BT +#ifdef DS34BT #include "ds34bt.h" #endif -#ifdef USB +#ifdef DS34USB #include "ds34usb.h" @@ -135,10 +135,10 @@ int _start(int argc, char *argv[]) pademu_setup(pad_enable, pad_vibration); -#ifdef BT +#ifdef DS34BT ds34bt_init(pad_enable, pad_options); #endif -#ifdef USB +#ifdef DS34USB ds34usb_init(pad_enable, pad_options); #endif @@ -181,10 +181,10 @@ void pademu_disconnect(struct pad_funcs *pf) void _exit(int mode) { -#ifdef BT +#ifdef DS34BT ds34bt_reset(); #endif -#ifdef USB +#ifdef DS34USB ds34usb_reset(); #endif }