simple program

gags
Following is the simplest of all, and its not working.
No LED blinks , i even tried while loop on ioctl as to keep it open 
to monitor, i am working mini2440. Anybody please suggest me.
It got build at PC i transfer the binary to taget but led is not blinking
plz help

int main()
{
  int on;
  int led_no;
  int fd;
  fd = open("/dev/leds0", 0);
  if (fd < 0) {
    fd = open("/dev/leds", 0);
  }
  if (fd < 0) {
    perror("open device leds");
    exit(1);
  }


  ioctl(fd, 1, 1);
  close(fd);

  return 0;
}

davef
The first thing to check is do you actually have a /dev/leds0 and a
/dev/leds

What do you get when you cat those files?

gags
well i dont have led0 but i have leds under dev directory of target.

here is paste:

[root@FriendlyARM /dev]# ls
adc                 random              tty42
audio               root                tty43
backlight           rtc                 tty44
buttons             rtc0                tty45
camera              shm                 tty46
console             timer               tty47
controlC0           tty                 tty48
cpu_dma_latency     tty0                tty49
device              tty1                tty5
dsp                 tty10               tty50
fb0                 tty11               tty51
full                tty12               tty52
i2c                 tty13               tty53
input               tty14               tty54
kmsg                tty15               tty55
leds                tty16               tty56
log                 tty17               tty57

mark leds .. 
looking for reply ! thanks devfs

vib
You need to know exactly what /dev/??? you want to control.  No guessing.
Try the user manual.

gags
hello vib, 
well i did changed it to leds only
but still no success.
i do get binary and run it on target like:
./ledtesting

but i dont see any affect on LED 1,
btw on mini2440 4 leds keep on running ..looks like a count to me
please help

davef
That's because when you boot up the standard distro that FriendlyArm
supplies there is a little leds utility running.

Think you have to stop that program running then try running your program.

Look in /etc/rcS and comment out the line referencing the LED app.

gags
Hello Davef

I got it working led2 , now it dont blink. Thanks a lot

1 more thing , how to change the boot up logo i mean the linux logo?
Do you have any idea how to change or replace it?