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

2024.1.0: Advanced Boot Logo #191

Merged

Conversation

andrewjswan
Copy link

@andrewjswan andrewjswan commented Jan 2, 2024

Advanced mode of boot logo display

Allows you to show a custom boot logo instead of the default animation when booting.
advanced_boot (optional, boolean, only on ESP32, Default: false) Enables advanced mode of boot logo display.
boot_logo (optional, string, only on ESP32): Mask defined as rgb565 array used to display boot logo, color is completely ignored, output depends on boot logo display mode.
boot_mode (optional, integer, only on ESP32, Default: 3) Mode of displaying boot logo, can take value from 0 to 3:

  • 0 - Display boot_logo in white color
  • 1 - Display boot_logo in white color, the mask appears from the center to the sides.
  • 2 - Display boot_logo with rainbow color
  • 3 - Display boot_logo in rainbow color, the mask appears from the center to the sides
    Mode 3 is best used with the option
display:
    auto_clear_enabled: false

After startup, to save memory, you can clear the array with the boot logo by calling the boot_logo setup function with an empty parameter.

id(rgb8x32)->set_boot_logo("");

But in case time is lost (unsynchronization), the standard animation will be shown.

PS: I see the readme is constantly being updated, so I decided not to add this text to the file itself. I will leave the text of changes here.

@lubeda
Copy link
Owner

lubeda commented Jan 2, 2024

Hi, also a nice addition. I will add it to the readme before releasing.

Co-authored-by: chertvl <38353584+chertvl@users.noreply.github.com>
@lubeda lubeda merged commit 0169554 into lubeda:2024.1.0-prerelease Jan 4, 2024
@andrewjswan andrewjswan deleted the 2024.1.0-Advanced_Boot_Logo branch January 4, 2024 11:52
@lubeda
Copy link
Owner

lubeda commented Jan 4, 2024

You dont use advanced_boot` and there is no option to show the boot_logo as it is without the masking or animation stuff

@lubeda
Copy link
Owner

lubeda commented Jan 4, 2024

I also think boot_mode 0 should be default e.g. the normal pure display and from 1 to to 4 should be your animations

@andrewjswan
Copy link
Author

You dont use advanced_boot` and there is no option to show the boot_logo as it is without the masking or animation stuff

I didn't quite understand the question. If advanced_boot is not used, then the default code works, i.e. rectangle.
If advanced_boot is used and boot_logo is specified and it is processed without errors i.e. the array is full and not NULL, then advanced_boot works. If you clear the array, the default code works again, i.e. rectangle.

@andrewjswan
Copy link
Author

I also think boot_mode 0 should be default e.g. the normal pure display and from 1 to to 4 should be your animations

I don’t see the point, if we indicate in the configuration that we want the default logo (mode 0 you suggested), then what difference does it make to change the mode or comment out any line from advanced_boot or boot_logo. In both cases there will be a default logo.

@lubeda
Copy link
Owner

lubeda commented Jan 4, 2024

On a fresh installation of 2024.1.0-prerelease there is no boot_logo at all because it was removed in 2023.8.0 (I think) and "replaced" with the

on_start_running:
  id(rgb32x8)->bitmap_screen(.....

way of showing a "boot-logo".

The visual result is the same as your method.

Now you reintroduced the boot_logo and your part is working, but somehow our code base drifted. Just try the version 2024.1.0-prerelease in the repo and you will see.

@andrewjswan
Copy link
Author

This is not quite true if you don't turn on advanced_boot, but add

on_start_running:
  id(rgb32x8)->bitmap_screen(.....

The startup process will be like this:

  • Show the expanding rectangle until the time is synchronized and the clock starts running
  • Show the regular bitmap_screen while it is alive, alternating with other screens

If you enable advanced_boot, add boot_logo and leave the configuration as it is, the startup process will be like this:

  • Show the image from boot_logo in the selected mode instead of the rectangle until the time is synchronized and the clock starts running
  • Show the regular bitmap_screen while it is alive, alternating with other screens.

@chertvl
Copy link

chertvl commented Jan 4, 2024

I tested this feature and liked it.
I drew myself, using zeros and ones, a semblance of a blank screen during loading, which then turns into a real watch face screen.
looks very good.

code and video:

image

https://drive.google.com/file/d/1GGKvRePjlyhDy6QFaLkTMfeWjZEa8yZG/view?usp=sharing

@lubeda
Copy link
Owner

lubeda commented Jan 4, 2024

The startup process will be like this:

  • Show the expanding rectangle until the time is synchronized and the clock starts running
  • Show the regular bitmap_screen while it is alive, alternating with other screens

If you enable advanced_boot, add boot_logo and leave the configuration as it is, the startup process will be like this:

  • Show the image from boot_logo in the selected mode instead of the rectangle until the time is synchronized and the clock starts running
  • Show the regular bitmap_screen while it is alive, alternating with other screens.

I see, I was a little wrong. But still, I think it would be clearer to have:

if boot_logo is set and the default_bootmode is 0, the advanced_boot is the obsolete

0 - Display boot_logo without filter and mask, just colorful
1 - Display boot_logo in white color
2 - Display boot_logo in white color, the mask appears from the center to the sides.
3 - Display boot_logo with rainbow color
4 - Display boot_logo in rainbow color, the mask appears from the center to the sides

The on_start_runing lambda way could then be optional. You could even free the boot_logo space automatically. So all boot_logo things are in one place.

@lubeda
Copy link
Owner

lubeda commented Jan 4, 2024

I tested this feature and liked it.

Yes it is

@andrewjswan
Copy link
Author

if boot_logo is set and the default_bootmode is 0, the advanced_boot is the obsolete

Well now it is, to enable this mode it is necessary to write advanced_boot and boot_logo, if it is not done, then we do not enable this mode at all and it works as before. But at the same time we save some memory because there is no pointer to the array.

Look:
https://github.com/lubeda/EspHoMaTriXv2/blob/2024.1.0-prerelease/components/ehmtxv2/__init__.py#L596

@andrewjswan
Copy link
Author

But we can do it just in the base, without any advanced keys, based on the mode and the presence of the logo. I just decided not to overload not all the necessary functionality.

@andrewjswan
Copy link
Author

@lubeda I think I get your idea, sorry I didn't get it right away. You suggest to remove advanced_boot and rely only on boot_logo and boot_mode, I like this idea, I support it.
I'll redo it.

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.

None yet

3 participants