Skip to content

Commit

Permalink
Code refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf3s committed Nov 18, 2024
1 parent 4cf4874 commit ce551bc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions modules/pademu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions modules/pademu/ds34usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions modules/pademu/pademu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit ce551bc

Please sign in to comment.