-
Notifications
You must be signed in to change notification settings - Fork 3
Rewrite examples/Braccio_Learn_and_Repeat
using State design pattern
#71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In the first tests with this code, the firmware crashs in the REPLAY mode. Thus, it was necessary to restart the Arduino Board. |
af07b2a
to
a37cfdf
Compare
Following up a private conversation with @Esquirio I think there is reason to believe that unprotected, multi-threaded access to LVGL (no @Esquirio can you please test the most recent code in this PR? Please ensure to download the whole library, not only the example (i.e. via this link). |
a37cfdf
to
eae9401
Compare
Memory usage change @ eae9401
Click for full report table
Click for full report CSV
|
I've tested with the newest version of Braccio ++, and it presented the same problem. I am trying to check the code and find any issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is in the if statement in lines 35-39. When I removed it, the example didn't crash.
26e6597
to
9d1abd3
Compare
Memory usage change @ d80e3a1
Click for full report table
Click for full report CSV
|
This was the intended behavior, both joystick click and enter button should allow the user to select an option. |
In this case all is fine 👍 |
@aentinger We have tested the PR, here me and @umbynos feedbacks:
For what concerns the leds they work like a charm now. |
I've tested the two codes intensively (@91volt code and @aentinger code). Both codes crashed. I will continue to investigate for issues and try to discover the cause of the crashes. |
d80e3a1
to
f904f95
Compare
…t (which is not so meaningful).
…h delays by 100 ms PLUS code execution time.
…y mismatch). Real sampletime is now 20 seconds.
f904f95
to
1813c99
Compare
The problem with this example is that a) there are a fair number of state transitions I've tried avoiding it until now, but this whole examples needs a clean rewrite, otherwise it will be always be a trial-and-error programming with the smallest change breaking the whole flow. |
@aentinger Did you mean the issue is in the state transitions in the display? I think it is possible to test the example using the Serial Monitor (or buttons and LEDs) instead of the LVGL library (If this test hasn't been done). I can do this test and report my findings. |
examples/Braccio_Learn_and_Repeat
using State design pattern
Once an application exceeds a certain number of states and state transitions it becomes very hard to keep track of the control flow is variables storing state are manipulated on several different locations in the code. Employing the State programming pattern I've untangled the transitions and make them more visible so that now there should be no more lurking 🐛 . @Esquirio 🙏 test 🙇 |
Memory usage change @ b2384df
Click for full report table
Click for full report CSV
|
@Esquirio Can you please test?