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

native SDL drivers refactor so they can work with embedded libCs #60036

Merged
merged 5 commits into from
Jul 6, 2023

Conversation

aescolar
Copy link
Member

@aescolar aescolar commented Jul 5, 2023

This is a plain refactor of the native SDL drivers into tops (Zephyr side) and bottoms (Linux side),
so the tops can be built with an embedded libC, while the bottoms remain built in the host context.

For native_posix there is effectively no change. For native_sim with this change, these drivers can be built now also when the user selects to build Zephyr with an embedded libC.

There is no functional changes, just code moved around.

Copy link
Member

@fabiobaltieri fabiobaltieri left a comment

Choose a reason for hiding this comment

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

Good stuff, just few nitpicks.

boards/posix/common/sdl/sdl_events_bottom.c Outdated Show resolved Hide resolved
drivers/display/display_sdl_bottom.c Outdated Show resolved Hide resolved
drivers/input/CMakeLists.txt Outdated Show resolved Hide resolved
drivers/input/input_sdl_touch_bottom.c Outdated Show resolved Hide resolved
drivers/gpio/gpio_emul_sdl_bottom.h Outdated Show resolved Hide resolved
@pdgendt
Copy link
Collaborator

pdgendt commented Jul 6, 2023

Nit: I find the naming top/bottom a bit... odd IMO, commonly this is frontend/backend. But I guess it is a different context here.

EDIT: why not simply use the _posix suffix?

@aescolar
Copy link
Member Author

aescolar commented Jul 6, 2023

EDIT: why not simply use the _posix suffix?

Given all the confusion with the POSIX naming, I'm trying to avoid it as much as I can when referring to the "native" boards now.
I guess I could have called the bottom sides "_host" or something like that. top/bottom also felt kind of ok. I guess it doesn't matter much.

@aescolar
Copy link
Member Author

aescolar commented Jul 6, 2023

Thanks for the review @fabiobaltieri @pdgendt . I have done all changes @fabiobaltieri asked for. I hope you guys will be happy with it :)

Split the SDL event handling code in a top and bottom
to enable building it with embedded libCs.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Split the SDL display driver in a top and bottom
to enable using it with embedded libCs.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Split the SDL input driver in a top and bottom
to enable using it with embedded libCs.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Split the SDL GPIO emulator driver in a top and bottom
to enable using it with embedded libCs.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Now all SDL drivers can be used with the embedded libCs.
Let's update the table.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
@aescolar aescolar merged commit cc67aaf into zephyrproject-rtos:main Jul 6, 2023
19 checks passed
@aescolar aescolar deleted the native_sdl branch July 6, 2023 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Display area: GPIO area: Input Input Subsystem and Drivers area: native port Host native arch port (native_sim)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants