Date: Sun, 13 Jun 2004 16:55:43 -0400 From: tj <999alfred@comcast.net> Subject: Re: [nanogui] Re: timer not working fixed, at least for now, I think. Greg, Just a quick note. In order to get something running quick, ie not write a kernel driver, I implemented my keyboard decoder as a user space app using the fifo file /tmp/.nano-X-softkbd and set PIPEKBD =Y in config. The app decodes the keyboard and writes the result to the fifo. Which in turn is read in nano-X by kbd_pipe.c. This works just fine. I start nano-X and my key decoder app in the background at boot and everything seems to run fine, including the timer events. It looks like only TTYKBD causes the timer event problem. Well, until I find the next bug, see ya. Oh yea, what happened to "Gary's Docs" at http://home.twcny.rr.com/embedded/microwin/index.html? I noticed it seemed to be "rotting away" this weekend as a lot of pages started coming up "404, not found" and then the site itself went away. Strange. cul, tj Greg Haerr wrote: >: TTYKBD = N // was Y >: NOKBD = Y // was N >: >: And now the timer events happen when nano-X is started at boot time. I >: even start the app at boot time at it gets the timer events. > >Amazing. And I'm glad you've got it working. This has got to do >with the kbd init code or select() in nanox/srvmain.c I think. > > >: I still have a question though. I will be using a keypad hooked to GPIO >: hardware. I already have the code working to scan it. Right now I run it >: in a thread. Whenever the thread sees key state changem, it uses >: GrInjectKeyboardEvent() to get it to the event queue in the main thread. > >This is the right way to do it when you require an external process >to get the keyboard information. For code that reads a pipe for >kbd input, you can use drivers/kbd_pipe.c (from the external process), >or not change anything. For instance, the PIXIL PDA handwriting >and on-screen keyboard work as you describe, using a completely >seperate process and GrInjectKeyboardEvent(). > > >:: I see the SCANKBD in config, but what /dev device would it use. Would I >: need to replace /dev/console with my driver? > >Take a look at it: drivers/kbd_ttyscan.c. It uses /dev/tty. You can >just modify it to use whatever device you require. > > >I wonder how it will effect >: the starting at boot? Will it re-introduce the timer event problem again >: now that a keyboard is specified? > >Hopefully not. You know, I'm thinking here what might be the problem. >Since all the keyboard drivers use /dev/tty, perhaps what happens is that >the device IS opened at boot time, and, instead of waiting in select() >for the keyboard to return a character, the select ALWAYS returns true >for keyboard input on that device. If that were the case, then select() >would NEVER hang and timeout, producing timeout events. The >read() in drivers/kbd_tty.c could return 0, meaning no kbd data, >and the cycle continues. To check this, you could printf() the >return value from read() in TTY_Read. I'll bet this is the problem. >Also, note that the tty driver uses environ var CONSOLE if >it exists instead of /dev/tty. > >Regards, > >Greg > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: nanogui-unsubscribe@linuxhacker.org >For additional commands, e-mail: nanogui-help@linuxhacker.org > > > >