Switching on/off the LEDs? How?
Switching on/off the LEDs? How?
Is it possible to switch on/off the PSP LEDs (wifi, power, MS) via software? I've read that last version of IR Shell can do this, but I don't know how it's done.
Thanks.
Thanks.
First, use the search, 2nd read the headers...
-Aura
Code: Select all
int sceSysconCtrlLED(int SceLED, int state);
Hi! Thank you very much for your reply.
I did use the search but I couldn't find anything useful searching "led" or "leds". And if I search sceSysconCtrlLED, I find a thread, but it doesn't talk about that function.
I found the file with that function, but it says "only SCE_LED_POWER". Is this right? Isn't any way to control the other 2 LEDs?
Thanks again.
I did use the search but I couldn't find anything useful searching "led" or "leds". And if I search sceSysconCtrlLED, I find a thread, but it doesn't talk about that function.
I found the file with that function, but it says "only SCE_LED_POWER". Is this right? Isn't any way to control the other 2 LEDs?
Thanks again.
If I remember correctly, none of those values can control the LEDs except the one for power. However, I did find some code from the IPL SDK that does work in controlling the other two LEDs:Nekuz0r wrote:i suggest you to test other value by your self ;)
like 0, 2, 3 .... ;)
#define REG32(a) *(volatile unsigned long *)(a)
// Turn on both LEDs at the same time
REG32( 0xbe240008 ) = 0xC0; /* GPIO SET */
// Turn off both LEDs
REG32(0xbe24000c) = 0xC0; /* GPIO CLEAR */
// Turn on the LED for memory stick
REG32( 0xbe240008 ) = 0x40;
// Turn off the LED for memory stick
REG32( 0xbe24000c ) = 0x40;
Hope it helps.
-
- Posts: 110
- Joined: Tue Feb 27, 2007 9:43 pm
- Contact:
Unless you plan to bypass the kernel completely dont use the IPL sdk to do it. It can produce unwanted side effects.
Use the sceLed lib instead (only controls ms/wlan leds).
Im sure someone will post a proper sample on how to use, *cough*adrahil*cough*.
Use the sceLed lib instead (only controls ms/wlan leds).
Code: Select all
// led (0-ms, 1-wlan)
// mode (on/off, and some others)
// param controls a bunch of other things like blinking, the rate it blinks, how long to blink for, etc.
int sceLedSetMode(int led, int mode, SceLedParam *param);
For the Power LED you should use Syscon call, but for WLAN/MS leds, you can use this:
Just link in the led.prx exports and off you go :) (Forget about modes 2 and 3, as 0 and 1 are enough)
Code: Select all
typedef struct{
int oncnt;
int offcnt;
int endcnt;
int endstat;
}SceLedParam;
#define LED_MODE_OFF 0
#define LED_MODE_ON 1
#define LED_MODE_TIMED 2
#define LED_MODE_DELAY 3
#define LED_TYPE_MS 0
#define LED_TYPE_WLAN 1
int sceLedSetMode(int led, int mode, SceLedParam* param);
as im a N00B do you mean likeadrahil wrote:
Just link in the led.prx exports and off you go :) (Forget about modes 2 and 3, as 0 and 1 are enough)
Code: Select all
LoadStartModule("flash0:/kd/led.prx");
Code: Select all
SceUID mod;
mod = LoadStartModule("flash0:/kd/led.prx");
if (mod < 0)
{
ErrorExit(6000, "Error %08X loading/starting led.prx\n", mod);
}
and i found this code somewere and im not sure if it would help?
Code: Select all
#include <pspkernel.h>
//==============================
//Definitions for the LED function. For now, only
// the power LED is functioning....
#define POWER_LED 1
#define STATE_ON 1
#define STATE_OFF 0
extern int sceSysconCtrlLED(int LedID,int state);
//==============================
[...]
while(1){
sceSysconCtrlLED(POWER_LED, STATE_ON);
sceKernelDelayThreadCB(100000);
sceSysconCtrlLED(POWER_LED, STATE_OFF);
sceKernelDelayThreadCB(100000);
}
[...]
It's good to see this finaly out, thanks.
Potential for controlling other devices through relays is really here with this
if you wanted to open a PSP to tap the LED ports.
I hope there is nothing naughty about doing it this way?
I don't notice any bad side effects.
Cheers, Art.
Potential for controlling other devices through relays is really here with this
if you wanted to open a PSP to tap the LED ports.
I hope there is nothing naughty about doing it this way?
I don't notice any bad side effects.
Code: Select all
int sceSysconCtrlLED(int SceLED, int state);
sceSysconCtrlLED(1,0); // turn off LEDs
sceSysconCtrlLED(0,0);
sceSysconCtrlLED(2,0);
sceSysconCtrlLED(3,0);
If not actually, then potentially.
-
- Posts: 1
- Joined: Thu Jul 31, 2008 12:31 am