Hi
I am quite new to Linux and Openwrt but I managed to compile a C program and make it work on my WRT54G (v3.1).
Well.. almost work. I wanted to port a program that send binary signal to RTS line of serial port and send this signal through DMZ led (GPIO 7 on my router).
I took inspiration from the SD/MMC source codes and came up with something like
--8<--snip----
static unsigned char mask = 1 << 7;
static volatile unsigned char *gpio_output = ( unsigned char * ) 0xb8000064;
if (atoi(argv[1])==1){
*gpio_output |= mask;
} else {
*gpio_output &= ~mask;
}
--8<--snip----
The program compiles but I get a "Bus error" when executed
I tried to fwrite to /proc/diag/led/dmz but I think that the file writing is buffered and my signal gets all messed up.
What am I missing ? I suspect that the gpio_output address is different from a chip to another, may this be the cause of my problem ?