hwhw/kindlepdfviewer — pull request #88 by houqp (2012-04-06 06:07:15+00:00)
Title: Screen rotation handling for entering/leaving screen saver

Not sure whether this is the best way, but at least it works :P

I gave up the idea of using ioctl on `/proc/pmic` in `input.c` because I cannot come up with a good solution to watch the event with `select` system call. So I decide to fake an event file like those in `/dev/input`.

My first try was using the `uinput` module. But the `uinput` module in kindle seems a little wired, I can create a new file under `/dev/input`, but write to it generates no fake event. Then I switched to the named pipe.

The big change in this commit is I stopped the framework on kpv start, so if kpv crashed, people need to restart it and exit normally to resume the framework.

PS:
I guess the `slider_watcher.c` can be better improved by calling ioctl on `/proc/pmic`, but I don't have so much free time playing on it :)