mirror of
https://github.com/wiiu-env/USBSerialLoggingModule.git
synced 2024-11-28 04:44:15 +01:00
Use libmocha
This commit is contained in:
parent
fd647fc2e8
commit
f8f33ea7c2
4
Makefile
4
Makefile
@ -48,13 +48,13 @@ CXXFLAGS += -DDEBUG -DVERBOSE_DEBUG -g
|
|||||||
CFLAGS += -DDEBUG -DVERBOSE_DEBUG -g
|
CFLAGS += -DDEBUG -DVERBOSE_DEBUG -g
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIBS := -lwums -lwut -lkernel
|
LIBS := -lwums -lwut -lkernel -lmocha
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# list of directories containing libraries, this must be the top level
|
# list of directories containing libraries, this must be the top level
|
||||||
# containing include and lib
|
# containing include and lib
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
LIBDIRS := $(PORTLIBS) $(WUT_ROOT) $(WUMS_ROOT)
|
LIBDIRS := $(PORTLIBS) $(WUT_ROOT) $(WUT_ROOT)/usr $(WUMS_ROOT)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# no real need to edit anything past this point unless you need to add additional
|
# no real need to edit anything past this point unless you need to add additional
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include <coreinit/cache.h>
|
#include <coreinit/cache.h>
|
||||||
#include <coreinit/ios.h>
|
#include <coreinit/ios.h>
|
||||||
#include <kernel/kernel.h>
|
#include <kernel/kernel.h>
|
||||||
|
#include <mocha/mocha.h>
|
||||||
#include <wums.h>
|
#include <wums.h>
|
||||||
|
|
||||||
WUMS_MODULE_EXPORT_NAME("homebrew_usbseriallogging");
|
WUMS_MODULE_EXPORT_NAME("homebrew_usbseriallogging");
|
||||||
@ -12,15 +13,16 @@ extern "C" void SC_0x51();
|
|||||||
|
|
||||||
WUMS_INITIALIZE() {
|
WUMS_INITIALIZE() {
|
||||||
initLogging();
|
initLogging();
|
||||||
// Start syslogging on iosu side
|
|
||||||
int mcpFd = IOS_Open("/dev/mcp", (IOSOpenMode) 0);
|
int res;
|
||||||
if (mcpFd >= 0) {
|
if ((res = Mocha_InitLibrary()) != MOCHA_RESULT_SUCCESS) {
|
||||||
int in = 0xFA; // IPC_CUSTOM_START_USB_LOGGING
|
DEBUG_FUNCTION_LINE_ERR("Mocha_InitLibrary() failed %d", res);
|
||||||
int out = 0;
|
return;
|
||||||
IOS_Ioctl(mcpFd, 100, &in, sizeof(in), &out, sizeof(out));
|
}
|
||||||
IOS_Close(mcpFd);
|
|
||||||
} else {
|
if (Mocha_StartUSBLogging(false) != MOCHA_RESULT_SUCCESS) {
|
||||||
DEBUG_FUNCTION_LINE_ERR("Failed to open /dev/mcp");
|
DEBUG_FUNCTION_LINE_ERR("Mocha_StartUSBLogging failed");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Patch loader.elf to spit out less warnings when loading .rpx built with wut
|
// Patch loader.elf to spit out less warnings when loading .rpx built with wut
|
||||||
|
Loading…
Reference in New Issue
Block a user