I've searched but couldn't find anything.
This is the code for the LEDControl plugin.
Code: Select all
#include <pspkernel.h>
#include <pspctrl.h>
#define MS_LED 0
#define WLAN_LED 1
#define POWER_LED 2
#define STATE_ON 1
#define STATE_OFF 0
PSP_MODULE_INFO("LEDControl", 0x1000, 1, 0);
PSP_MAIN_THREAD_ATTR(0);
int currentState = STATE_ON;
int main_thread(SceSize args, void *argp)
{	
	SceCtrlData pad;
	while(1)
	{
		sceCtrlReadBufferPositive(&pad, 1);
		if(pad.Buttons & PSP_CTRL_LTRIGGER) {
			if(pad.Buttons & PSP_CTRL_VOLDOWN)
			{
				if(currentState == STATE_ON)
				{
					sceSysconCtrlLED(MS_LED, STATE_OFF);
					sceSysconCtrlLED(WLAN_LED, STATE_OFF);
					sceSysconCtrlLED(POWER_LED, STATE_OFF);
					currentState = STATE_OFF;
				}
				else
				{
					sceSysconCtrlLED(MS_LED, STATE_ON);
					sceSysconCtrlLED(WLAN_LED, STATE_ON);
					sceSysconCtrlLED(POWER_LED, STATE_ON);
					currentState = STATE_ON;
				}
			}
		}
    		sceKernelDelayThreadCB(100000);
	}
	return 0;
}
int module_start(SceSize args, void *argp)
{
	// Create a thread
	int thid = sceKernelCreateThread("LEDControl", main_thread, 0x30, 0x1000, 0, NULL);
	if(thid >= 0) sceKernelStartThread(thid, args, argp);
	return 0;
}