Skip to content

Commit

Permalink
Fix screen on/off (Fixes #6). Fix controller id display
Browse files Browse the repository at this point in the history
  • Loading branch information
isage committed Sep 30, 2024
1 parent f0c3114 commit 66d2d0d
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions module/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,8 @@ void vividStop(void)
ksceUdcdStart("USB_MTP_Driver", 0, NULL);
ksceUdcdActivate(0x4E4);

g_led_mask = 0;

EXIT_SYSCALL(state);
}

Expand Down Expand Up @@ -838,7 +840,6 @@ void vividUpdateGyro(uint16_t z)
EXIT_SYSCALL(state);
}


void vividScreenOn()
{
uint32_t state;
Expand All @@ -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();
}

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

0 comments on commit 66d2d0d

Please sign in to comment.