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

LVGL 5.3: lcd::print() is broken #25

Open
Richard-Stump opened this issue Feb 7, 2023 · 5 comments
Open

LVGL 5.3: lcd::print() is broken #25

Richard-Stump opened this issue Feb 7, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@Richard-Stump
Copy link
Contributor

Task:

The lcd::print function for llemu.cpp/hpp is not printing anything. An example of this can be seen with the default main.cpp:

...
while (true) {
        pros::lcd::print(0, "%d %d %d", (pros::lcd::read_buttons() & LCD_BTN_LEFT) >> 2,
		               (pros::lcd::read_buttons() & LCD_BTN_CENTER) >> 1,
		               (pros::lcd::read_buttons() & LCD_BTN_RIGHT) >> 0);
...

This should print the states of the 3 buttons as 0 or 1 on the first line, but currently seems to print nothing. It should look like:
image

Beta Server Link:

https://discordapp.com/channels/1025259843763847229/1029666535553384498/1071536722996887602

Testing:

This can be tested using the default main.cpp. The button states should be printed at the top, and change when the buttons are pressed.

@Richard-Stump Richard-Stump added the bug Something isn't working label Feb 7, 2023
@WillXuCodes
Copy link
Member

Def something to do with the weak symbol not being overidden. Probably because it's one of the functions inside screen.hpp

@WillXuCodes
Copy link
Member

This is going to be the order of troubleshooting for some poor soul that actually has time to do this:

  1. Add some sort of print statement or feedback to the lcd::print statement on the Kernel side.
  2. Turn Kernel into template, apply it to a default project, y'all know the drill w/ that.
  3. Apply current version of liblvgl to that.
    4a. See if feedback occurs. If feedback does occur, we need to figure out how to create a templated function that is also considered with attribute weak.
    4b. While my initial google search did not yield anything of substance, attempting to RTFM more or moving the "attribute(weak)" before the template part might work? We might also want to consider dynamically figuring out if the print func is initialized and calling some new "dummy" printv weak function that uses a variadic argument parameter instead of the argument list which may allow us to bypass using a template.

@Richard-Stump
Copy link
Contributor Author

Richard-Stump commented Mar 23, 2023

Update: The weak symbol works as intended, and the api.h file in the kernel simply does not include the llemu headers, since they were pulled out of the kernel repo.

@Richard-Stump
Copy link
Contributor Author

We need to somehow make it so that they are included in API.h, only when liblvgl is applied to the project. I am currently trying to figure out the best way to go about this.

@WillXuCodes
Copy link
Member

Update: This is now only a liblvgl 5.3 (legacy) issue. Would be nice to solve ASAP but higher priority tasks such as doxygen and Okapi should be finished first before working on this backwards compatibility version working.

@WillXuCodes WillXuCodes changed the title PROS 4: lcd::print() is broken LVGL 5.3: lcd::print() is broken Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants