Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zsotroav committed Feb 20, 2023
1 parent 3904c54 commit 800655c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ public void Destroy()

/// <summary>Re-write the whole screen with the driver's optimizations in place</summary>
/// <param name="data">Data to write</param>
public void FullScreenWrite(byte[] data)
/// <param name="toReverse">If the bytes need to be reversed (little endian &lt;--&gt; big endian)</param>
public void FullScreenWrite(byte[] data, bool toReverse = true)
{
if (toReverse) data = Utils.ReverseBytes(data);
try
{
byte[] msg = { CD, 0x11, (byte)(data.Length >> 8), (byte)data.Length };
Expand All @@ -110,8 +112,11 @@ public void FullScreenWrite(byte[] data)
/// regular full screen writing doesn't work as expected.
/// </summary>
/// <param name="data">Data to write</param>
public void ForceScreenWrite(byte[] data)
/// <param name="toReverse"></param>
public void ForceScreenWrite(byte[] data, bool toReverse = true)
{
if (toReverse) data = Utils.ReverseBytes(data);

// Force writing is slow and a timeout error is very likely at usual values.
Port.ReadTimeout += 2000;
try
Expand Down
4 changes: 2 additions & 2 deletions SerialCommPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ public int Run(IContext context, int runID)
Disconnect();
break;
case 8:
ManualWrite(SDK.GetScreenState());
ManualWrite(context.ScreenState);
break;
case 9:
ManualWrite(SDK.GetScreenState(), true);
ManualWrite(context.ScreenState, true);
break;
}
return 0;
Expand Down

0 comments on commit 800655c

Please sign in to comment.