From 66d2d0d22927b0c5f7c74bfcbfe46ca040eddd87 Mon Sep 17 00:00:00 2001 From: Ivan Epifanov Date: Mon, 30 Sep 2024 12:41:59 +0300 Subject: [PATCH] Fix screen on/off (Fixes #6). Fix controller id display --- module/src/main.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/module/src/main.c b/module/src/main.c index 8a20de2..98dc94e 100644 --- a/module/src/main.c +++ b/module/src/main.c @@ -771,6 +771,8 @@ void vividStop(void) ksceUdcdStart("USB_MTP_Driver", 0, NULL); ksceUdcdActivate(0x4E4); + g_led_mask = 0; + EXIT_SYSCALL(state); } @@ -838,7 +840,6 @@ void vividUpdateGyro(uint16_t z) EXIT_SYSCALL(state); } - void vividScreenOn() { uint32_t state; @@ -865,12 +866,12 @@ void vividScreenOff() if (g_is_oled) { - g_prev_brightness = ksceOledGetBrightness(); +// g_prev_brightness = ksceOledGetBrightness(); ksceOledDisplayOff(); } else if (g_is_lcd) { - g_prev_brightness = ksceLcdGetBrightness(); +// g_prev_brightness = ksceLcdGetBrightness(); ksceLcdDisplayOff(); } @@ -910,6 +911,16 @@ int module_start(SceSize argc, const void *args) ksceKernelPrintf("is_lcd: %d\n", g_is_lcd); ksceKernelPrintf("is_oled: %d\n", g_is_oled); + if (g_is_oled) + { + g_prev_brightness = ksceOledGetBrightness(); + } + else if (g_is_lcd) + { + g_prev_brightness = ksceLcdGetBrightness(); + } + + g_usb_thread_id = ksceKernelCreateThread("VITAPAD_USB_THREAD", vividUsbThread, 0x3C, 0x1000, 0, 0x10000, 0); g_event_flag_id = ksceKernelCreateEventFlag("VIVID_EF", 0, 0, NULL); ksceUdcdRegister(&vividUdcdDriver);