[Approved] Fix for MiniDisplayLibrary - swapped lines on DM140GINK VFD displays (1 Viewer)

michael_t

Portal Pro
November 30, 2008
1,258
813
Home Country
Germany Germany
There is a bug in MiniDisplayLibrary that causes swapped lines on the DM140GINK VFD display.

In the device driver (DM140GINK.cs) lines are written to the display by calling writeLine(int LineNo, string text) in VFD_Control.cs. Unfortunately the LineNo parameter in DM140GINK.cs counts up fom 0 (1st line) to 1 (2nd line), while writeLine() expects it to count up from 1 to 2. As there is only a simple check
Code:
if (LineNo == 1)
in writeLine() this results in showing the first line as bottom line and the second line as top line.
My patch corrects this by adding +1 to LineNo before calling writeLine() in DM140GINK.cs .

Michael

PS:
I made the patch in DM140GINK.cs because I can verify the bug only for the DM140GINK display that I have in my PC and do not want to cause side effects for other displays. But it seems to me most likely that the real bug is not in DM140GINK.cs but in the writeLine() code in VFD_Control.cs which is using a wrong way of counting. If I were right then the other display (SCALEO E) calling this writeLine() procedure would also show swapped lines and the code in VFD_Control.cs should be revised instead of patching the calling code. It would be great if someone with a SCALEO E could check that...
 

Attachments

  • Fix for MiniDisplayLibrary - swapped lines on DM140GINK VFD displays (using SVN24281).patch
    30.9 KB

michael_t

Portal Pro
November 30, 2008
1,258
813
Home Country
Germany Germany
I have got feedback from a SCALEO user who confirmed the swapped lines bug in VFD_Control.cs (see this thread).
So I patched VFD_Control.cs now and tests of the fixed MiniDisplayLibrary.dll with both my DM140GINK VFD display and krzysior's SCALEO E were successful. The new patch file is attached.

Michael
 

Attachments

  • Swapped lines on DM140GINK and Scaleo E displays (using SVN24669).patch
    30.8 KB

Users who are viewing this thread

Top Bottom