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

2023.9.1-PR116: Move sbitmap to EHMTX::queue #119

Merged

Conversation

andrewjswan
Copy link

@andrewjswan
Copy link
Author

andrewjswan commented Oct 23, 2023

Didn't notice the increase in size...
Before:

RAM:   [=         ]  14.4% (used 47152 bytes from 327680 bytes)
Flash: [========= ]  86.2% (used 1582105 bytes from 1835008 bytes)

After

RAM:   [=         ]  14.4% (used 47152 bytes from 327680 bytes)
Flash: [========= ]  86.2% (used 1581913 bytes from 1835008 bytes)

@andrewjswan
Copy link
Author

4 days, no problems, everything is stable in all modes.

@lubeda
Copy link
Owner

lubeda commented Oct 28, 2023

This is a waste of RAM if you are using other components like a microphone or other components, this isn't good. I agree with having more dynamic icons would be nice, but not like this. Perhaps you can set the amount of sbitmaps at compile time and introduce a new screen_type bitmapx_screen => {"bitmap_slot","[0,4523,0,2342,0,..... (64 values 16bit values rgb565)]", "lifetime", "screen_time"}, this is an acceptable compromise (I think).

@andrewjswan
Copy link
Author

I haven't noticed any problems, I have WEB enabled, and other additional sensors, no memory issues.

@andrewjswan
Copy link
Author

To save memory, it is necessary to make a dynamic queue and a dynamic array of icons, then when adding an entity will be created and added to the required list, when it is not needed memory is released.
But it is better to do it in Version 3. Here this variant works perfectly well.

@andrewjswan
Copy link
Author

@lubeda We can try to make this array dynamic:

Color* sbitmap;

and allocate memory as needed:

if (sbitmap== NULL) 
{
  sbitmap= new Color[64];
}

But I don’t yet know where to properly clean it. When a screen is removed from the queue.

@andrewjswan
Copy link
Author

I changed sbitmap to a dynamic array, checked it, it works.

@andrewjswan
Copy link
Author

About three to five screens a day. Everything's stable. No degradation has been noticed.

@andrewjswan
Copy link
Author

Conflict resolved.

@lubeda
Copy link
Owner

lubeda commented Nov 1, 2023

nice implementation

@lubeda lubeda merged commit e4ba41d into lubeda:2023.9.1 Nov 1, 2023
5 checks passed
@andrewjswan
Copy link
Author

Thanks

@andrewjswan andrewjswan deleted the 2023.9.1-PR116-Move_sbitmap_to_EHMTX_queue branch November 1, 2023 16:30
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.

2 participants