From: Reinhard T. <sir...@ta...> - 2006-10-02 14:14:50
|
Michael Reinelt <re...@eu...> writes: > Hi Reinhard, > >> In our appliance, we have 2 variants: one with an HD44780 display and >> some machines without. I'd like to have some mechanism in lcd4linux, >> which makes the daemon exit gracefully when there is no display on the >> paralell port. >> >> Does lcd4linux offer something like that? > > Well, as usual, that depends. > > If you don't use busy-flag checking, the communication is pure > unidirectional, and there's no way to detect wether there's a display > connected or not. > > If you use the busy-flag, there's a possibility to read back at least > some status information from the display. LCD4Linux uses this to test > wether the display can accept a new command or not. Yes, all our displays use the busy flag. Currently we have an really evil hack which greps in syslog for "timeout waiting for busy flag on controller" and terminates lcd4linux if found. as said, really evil. > At the moment there's kind of a fallback, which means that if the > busy-flag check fails several times, the HD44780 driver goes back into > normal unidirectional mode (using some worst-case delay values). Yes, I found that in the code. In principle, I could perhaps insert some exit(1) statements at some strategical point, but that's really hackish, and I wanted to consult this list before doing that. > But I'm afraid this check won't be sufficient: normally the display is > that fast (or the parport is that slow) that the first 'check-busy' test > reports the display as idle. And a successful busy check is done by > testing some signals for logical 'high' (or 1), which is the default > state if the pin is not connected (there's sort of a 'pull up resistor' > built into the parallel port). Ah, I thought about something like that :/ > I'll have to dig into the HD44780 specs to find out if there's another > possibility to check for a connected display. We could implement such a > test into the code (if there is one). This would be best! Thanks for your effords! -- Gruesse/greetings, Reinhard Tartler, KeyID 945348A4 |