From: Dave H. <dhy...@gm...> - 2006-01-12 16:39:15
|
Hi Dan, > Basically, I removed some semicolons and instead of piping the output > of various commands to /dev/null, I allowed them to be echo'd. I've > no idea why this works, or what particular change made it work, but it > was obviously some error with my scripting (I'm used to using bash, > not sh). Heh - Here's the reason why it didn't work. You wrote: echo "blah" > /proc/something > /dev/null; which means the same thing as: echo "blah" > /dev/null You're basically saying send "blah" to stdout. The > /proc/something says "send stdout to /proc/something". The > /dev/null says "No I've changed my mind. Send stdout to /dev/null" So the pins weren't being configured. I think I understand the motivation behind your additional redirection. If you do: echo "AF2 in" > /proc/gpio/GPIO46 then you'll see this message on the console: Set (AF2,in,set) via /proc/gpio/GPIO46 You were probably trying to get rid of this message, but redirection isn't going to work :( This is because the proc_gpio "driver" is using printk to print its output to the console. Now, if you really want to get rid of this output, you can do something like this: save_printk=3D$(cat /proc/sys/kernel/printk) echo 6 > /proc/sys/kernel/printk echo "AF2 in" > /proc/gpio/GPIO46 echo $save_printk > /proc/sys/kernel/printk What this does is tell printk to filter out messages tagged as level 6 (KERN_INFO) or higher. The proc_gpio driver doesn't use any level modifier, so it gets out as KERN_INFO level. You run the risk that any INFO messages printed by other drivers between the echo 6 and the restore will also get lost, but on your embedded system, that's probably pretty unlikely. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |