Closed aentinger closed 2 years ago
In the first tests with this code, the firmware crashs in the REPLAY mode. Thus, it was necessary to restart the Arduino Board.
@91volt @umbynos can you also test it out?
I had no issues with the sketch actually
Following up a private conversation with @Esquirio I think there is reason to believe that unprotected, multi-threaded access to LVGL (no Braccio.lvgl_lock/unlock
statements) are cause for the spurious crashes.
@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).
Memory usage change @ eae94014238e2c3c50d95b38110d19bfb2b45981
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:mbed_nano:nanorp2040connect | :small_red_triangle: 0 - +196 | 0.0 - 0.0 | :small_red_triangle: 0 - +8004 | 0.0 - +2.96 |
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
Hi @Esquirio :coffee: :wave:
I've merged #72 and rebased this PR.
Can you give it a test and let me know if this works for you?
Btw, I've noticed that despite #72 claims to use ENTER for "clicking events" clicking the joystick still works just fine CC @91volt .
Memory usage change @ d80e3a11f38f0994c82d69b1eb94af10a3005f6c
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:mbed_nano:nanorp2040connect | :small_red_triangle: 0 - +184 | 0.0 - 0.0 | :small_red_triangle: 0 - +8004 | 0.0 - +2.96 |
Hi @Esquirio ☕ 👋
I've merged #72 and rebased this PR.
Can you give it a test and let me know if this works for you?
Btw, I've noticed that despite #72 claims to use ENTER for "clicking events" clicking the joystick still works just fine CC @91volt .
This was the intended behavior, both joystick click and enter button should allow the user to select an option.
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 :+1:
@aentinger We have tested the PR, here me and @umbynos feedbacks:
MAX_SAMPLES
lasts significantly more than 20 seconds.MAX_SAMPLES
being reached, the REPLAY action doesn't work as expected and stops immediately.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.
The problem with this example is that
a) there are a fair number of state transitions b) there are sometimes state enter/exit actions and that c) state and stateful variables are both manipulated in loop and the LVGL event header.
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.
@91volt @Esquirio your 2 cents here?
@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.
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 :bug: .
@Esquirio :pray: test :bow:
Memory usage change @ b2384df1c76afa1a3dadaf216b13304f1fa9ccec
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:mbed_nano:nanorp2040connect | :small_red_triangle: 0 - +596 | 0.0 - 0.0 | :green_heart: -30380 - 0 | -11.24 - 0.0 |
@Esquirio Can you please test?