Skip to content

ez.SetButtonEvent(sButtonHandler) document concurrency issues when drawing to the screen in the handler #78

@JacobChrist

Description

@JacobChrist

Describe the issue

In working on some example code, I have run across several display anomalies when drawing to the screen. I have decided that this is probably due to code running in the button handler that is affecting the internal X,Y global variables (Column, Row). When these variable are changed it causes confusions in the thread that is handling the main Lua loop. This issue doesn't necessarily need to be fixed in code (as it is easy to set a flag to do the updates in the main loop) but a warning should be put in the manual to inform users that they should not write to the screen in the button event. The one exception that I don't fully understand at this time is the ez.Button(id, event) call that is given in the example code in section 14.4. The comment with this code indicates that is may redraw a button, this too may cause this concurrency issue to rear its head.

Location of Issue

  • Which Document: ezLCD-5x Lua API Manual 082922.pdf
  • Pages(s) containing issue: Section 14 Button Functions

Metadata

Metadata

Assignees

Labels

LuabugSomething isn't workingdocumentationImprovements or additions to documentation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions