mirror of
https://github.com/wiiu-env/USBSerialLoggingModule.git
synced 2024-11-24 02:49:18 +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
|
||||
endif
|
||||
|
||||
LIBS := -lwums -lwut -lkernel
|
||||
LIBS := -lwums -lwut -lkernel -lmocha
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# list of directories containing libraries, this must be the top level
|
||||
# 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
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <coreinit/cache.h>
|
||||
#include <coreinit/ios.h>
|
||||
#include <kernel/kernel.h>
|
||||
#include <mocha/mocha.h>
|
||||
#include <wums.h>
|
||||
|
||||
WUMS_MODULE_EXPORT_NAME("homebrew_usbseriallogging");
|
||||
@ -12,15 +13,16 @@ extern "C" void SC_0x51();
|
||||
|
||||
WUMS_INITIALIZE() {
|
||||
initLogging();
|
||||
// Start syslogging on iosu side
|
||||
int mcpFd = IOS_Open("/dev/mcp", (IOSOpenMode) 0);
|
||||
if (mcpFd >= 0) {
|
||||
int in = 0xFA; // IPC_CUSTOM_START_USB_LOGGING
|
||||
int out = 0;
|
||||
IOS_Ioctl(mcpFd, 100, &in, sizeof(in), &out, sizeof(out));
|
||||
IOS_Close(mcpFd);
|
||||
} else {
|
||||
DEBUG_FUNCTION_LINE_ERR("Failed to open /dev/mcp");
|
||||
|
||||
int res;
|
||||
if ((res = Mocha_InitLibrary()) != MOCHA_RESULT_SUCCESS) {
|
||||
DEBUG_FUNCTION_LINE_ERR("Mocha_InitLibrary() failed %d", res);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Mocha_StartUSBLogging(false) != MOCHA_RESULT_SUCCESS) {
|
||||
DEBUG_FUNCTION_LINE_ERR("Mocha_StartUSBLogging failed");
|
||||
return;
|
||||
}
|
||||
|
||||
// Patch loader.elf to spit out less warnings when loading .rpx built with wut
|
||||
|
Loading…
Reference in New Issue
Block a user