Skip to content
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

feat(demos): add demo for the OSAL #6182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

faxe1008
Copy link
Contributor

@faxe1008 faxe1008 commented May 5, 2024

Adds a demo demonstrating the use of the OSAL.

Resolves: #6049

Description of the feature or fix

A clear and concise description of what the bug or new feature is.

Notes

Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Fabian!

Here you can see some errors reported by CI. Fortunately, they are easy to fix.

I feel like this update could be rather an example. Usually we add complex eye catching things in the demos folder. So would you mind moving it to the examples folder?

demos/osal/lv_demo_osal.c Outdated Show resolved Hide resolved
demos/osal/lv_demo_osal.c Outdated Show resolved Hide resolved
demos/osal/lv_demo_osal.c Outdated Show resolved Hide resolved
uint32_t press_count = 0;

counter_label = lv_label_create(lv_scr_act());
lv_obj_align(counter_label, LV_ALIGN_CENTER, 0, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need a mutex here? What if this thread is running concurrently with the thread of lv_timer_handler?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but this would mean that the lv_timer_handler thread would also need to take this lock. I do not understand how this can be achieved though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. See the latest comments in #6059

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if I followed the disussion correctly there will be some sort of global mutex that may be taken on the PR for that is ready, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, after that PR, there will be a new API you can use in this PR to acquire the global mutex.

@FASTSHIFT FASTSHIFT changed the title feat(demos): Add demo for the OSAL feat(demos): add demo for the OSAL May 12, 2024
@faxe1008 faxe1008 force-pushed the osal_demo branch 3 times, most recently from f095d89 to 9c099e3 Compare May 16, 2024 08:30
@faxe1008
Copy link
Contributor Author

Moved this to examples/porting as it felt the most appropriate. How can I make sure that this is build during CI?

Copy link
Collaborator

@liamHowatt liamHowatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add

#include "porting/osal/lv_example_osal.h"

to lv_examples.h

examples/porting/osal/lv_example_osal.c Outdated Show resolved Hide resolved
examples/porting/osal/lv_example_osal.c Outdated Show resolved Hide resolved
Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to run it with the CI we need to add it here. However now the CI is running only with pthread. Do you think it still makes sens to run it as a test?

.devcontainer/__lv_conf.h__ Outdated Show resolved Hide resolved
@kisvegabor
Copy link
Member

lv_conf_internal.h is generated by scripts/lv_conf_internal_gen.py and shouldn't be edited by manually.

Adds a example demonstrating the use of the OSAL.

Resolves: lvgl#6049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Demo for the OSAL
3 participants