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

WIP: Split Render for multiple screen resolutions #1888

Merged
merged 33 commits into from
Jul 11, 2024
Merged

WIP: Split Render for multiple screen resolutions #1888

merged 33 commits into from
Jul 11, 2024

Conversation

Ralim
Copy link
Owner

@Ralim Ralim commented Feb 28, 2024

  • Please check if the PR fulfills these requirements
  • [] The changes have been tested locally
  • [] There are no breaking changes
  • What kind of change does this PR introduce?
    To enable future expansion by having multiple screen sizes, this aims to pull all the OLED rendering code out into a folder per screen size.
    This way we can mask in these files only and collect all the drawing logic.

Things to do:

  • Boot screen
  • Audit other drawing code
  • Check no regressions on smaller screens
  • Create drawing functions and screen layouts for larger screens
  • What is the current behavior?
  • What is the new behavior (if this is a feature change)?

  • Other information:

@discip
Copy link
Collaborator

discip commented Feb 29, 2024

Thank you! 😀 👍🏻

Successfully tested on both TS80P & Pinecil-2.

Oh, 🤦🏻 I just realized that I may have ticked that box too soon in the first post, since you're obviously going to change more of the code, right?
I'm sorry if that's true.

@Ralim
Copy link
Owner Author

Ralim commented Feb 29, 2024

Its all good on the tick.
Boot logo is the only problem I know of, as the current encoding for animated ones doesnt work on 128x32. (as the addressing for pixels only allows for 256 positions (where as this screen needs 512)).

@Ralim
Copy link
Owner Author

Ralim commented Mar 22, 2024

Alrighty all the templating is done (I think).
So; now we need to find every screen that needs to be updated and fix them all 😓
Which.. is basically all of them 😅

@Ralim
Copy link
Owner Author

Ralim commented Apr 3, 2024

I think the OLED driver is good to go now.
I'm happy for testing and a list of things that should be fixed.

Things I'm not sure how to handle:

  1. Settings menu entry names (do we just draw them with the larger font and try and make it all line up)
  2. Bootup logo, do we centre draw the existing ones, or new format for larger images? (will get far fewer animation frames due to larger image unless we increase size allocated to bootup logos)

@discip
Copy link
Collaborator

discip commented Apr 3, 2024

I'm happy for testing and a list of things that should be fixed.

Will do later (when back home again). 😊

@discip
Copy link
Collaborator

discip commented Apr 8, 2024

@Ralim
After a test on the S60P I noticed, that:

  1. The icons for the idle-screen and the main menu animations work as intended. 👍

  2. Settings menu entry names (do we just draw them with the larger font and try and make it all line up)

    Most likely this is related, since the unavailable icon and the other 2 icons for the bootlogo timing are not displayed correctly, scrambled & only partially.

  3. the scrollbar is only visible in the upper half of the screen.

  4. The horizontal sliding animation is sometimes torn in that the top and bottom halves slide out of sync.



Not related to the GUI changes (Nonetheless, needs to be fixed in order to be able test these too.)

  1. The Power settings-menu is still missing.
  2. The auto screen orientation does not work.



Settings menu entry names (do we just draw them with the larger font and try and make it all line up)

I assume this should be enough for now.

Bootup logo, do we centre draw the existing ones, or new format for larger images? (will get far fewer animation frames due to larger image unless we increase size allocated to bootup logos)

Yes, please center the logo for now, to preserve the current frame count.

btw:
Should I close #1819, since you already implemented it into this PR?

@Ralim
Copy link
Owner Author

Ralim commented Apr 9, 2024

Settings menu entry names (do we just draw them with the larger font and try and make it all line up)

So I gave this a try, but about 60% of the messages dont fit if I print them with the large font, so not sure what best move will be for this. unless we add another font size to the mix? (maybe make the big & little font different sizes on these?)

Most likely this is related, since the unavailable icon and the other 2 icons for the bootlogo timing are not displayed correctly, scrambled & only partially.

Hmm thats new, will look

the scrollbar is only visible in the upper half of the screen.

Thats a bug, will look

The horizontal sliding animation is sometimes torn in that the top and bottom halves slide out of sync.

The tearing is from the slow I2C :'( will have to look into ways to fix this at the end (leaving till last)

Should I close #1819, since you already implemented it into this PR?

I think so, it makes a bit more sense to get it in with this one?

The Power settings-menu is still missing.

Thats a bug

The auto screen orientation does not work.

Thats not supported on the Sequre devices (they dont have the sensor)

@Ralim
Copy link
Owner Author

Ralim commented Apr 9, 2024

The Power settings-menu is still missing.

Is this on the S60/S60P? Its missing at the moment as there is nothing to show in it (not settings are applicable yet)

@Ralim
Copy link
Owner Author

Ralim commented Apr 9, 2024

Okay should have most of them squashed 😅

@Ralim Ralim marked this pull request as ready for review April 9, 2024 10:30
@Ralim Ralim force-pushed the gui-multi-screen branch 2 times, most recently from 6144333 to b165584 Compare April 9, 2024 10:35
}

void BootLogo::showOldFormat(const uint8_t *ptrLogoArea) {
#ifdef OLED_128x32
// Draw in middle
OLED::drawAreaSwapped(16, 8, 96, 16, (uint8_t *)(ptrLogoArea + 4));
Copy link
Collaborator

@discip discip Apr 10, 2024

Choose a reason for hiding this comment

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

Just from a parametric perspective:
Could we use something like this here (instead of static values):
https://github.com/Ralim/IronOS-dfu/blob/7ab0a57c49e1913b87b49ae458e641aa48adea87/src/oled.c#L168

Copy link
Owner Author

Choose a reason for hiding this comment

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

At the moment the whole bootlogo stuff is setup only for that sizing. Which is sort of why I left it like that. 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious? 😊

Copy link
Owner Author

Choose a reason for hiding this comment

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

Very valid question.
Still on the fence for what to do about the boot logo stuff.
Since limited frames could be messy, but also nice to do static full screen at the least.
But having half-half also feels messy.

So maybe I just carve out a little more logo space on these devices to have at least some frames of boot logo?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Inclined to leave it as-is for the super short term as there are probably bigger issues to solve 🙃

@discip
Copy link
Collaborator

discip commented Apr 10, 2024

btw:
Unfortunately I was not able to revive my TS80P to test a certain behavior I'm not sure how it worked on the TS80P.

  1. issue
    On the S60P, if in detailed idle screen the unit is on top of the value if the tip is disconnected.

  2. Regarding the TS80P:
    I'm able to get into the DFU mode but not able to flash anything as it states something like: not writeable (unfortunately not near my PC and iron).
    And when trying to flash via ST-Link id does not work either.

Will provide screenshots later. 😊

@Ralim
Copy link
Owner Author

Ralim commented Apr 10, 2024

I'm able to get into the DFU mode but not able to flash anything as it states something like: not writeable (unfortunately not near my PC and iron).

Ah that will be because I fixed it so you can try and write out-of-bounds.

Can you dump the logs over on the that thread and ill try and make you a recovery method

@discip
Copy link
Collaborator

discip commented Apr 10, 2024

Can you dump the logs over on the that thread and ill try and make you a recovery method

Will do. 😃👍

@discip
Copy link
Collaborator

discip commented Apr 10, 2024

@Ralim

Can you dump the logs over on the that thread and ill try and make you a recovery method

I hope this is what you asked for:

dfu-util -D TS80P_EN.dfu                                                      
dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Match vendor ID from file: 1209
Match product ID from file: db42
Multiple alternate interfaces for DfuSe file
Opening DFU capable USB device...
Device ID 28e9:0189
Device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Interface #0 ...
Determining device status...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
DFU mode device DFU version 011a
Device returned transfer size 1024
DfuSe interface name: "Internal Flash "
File contains 1 DFU images
Parsing DFU image 1
Target name: ST...
Image for alternate setting 0, (1 elements, total size = 41012)
Setting Alternate Interface #0 ...
Parsing element 1, address = 0x08004000, size = 41004
Erase   	[                         ]   0%            0 bytesdfu-util: Page at 0x08004000 is not writeable

@discip
Copy link
Collaborator

discip commented Apr 10, 2024

Is this on the S60/S60P? Its missing at the moment as there is nothing to show in it (not settings are applicable yet)

But could we then set PD timeout to 0 for now, as there is no other way to set this?

@Ralim
Copy link
Owner Author

Ralim commented Apr 11, 2024

PD Timeout isnt supported by S60P or used anywhere in the code really. :/ what should this do in your book?

@discip
Copy link
Collaborator

discip commented Apr 11, 2024

It delays the CJC calibration.
At least I think that it is caused by PD timeout. Don't know what else could cause this. 🤷‍♂️

@Ralim
Copy link
Owner Author

Ralim commented Apr 11, 2024

Ahh, hmmm, it shouldn't affect CJC 🙃

For the TS80 bootloader, I had a crazy idea that may work (and be low effort). Can you try and flash the S60P runtime in the bootloader (screen will look wonky, but usb might work). Then if the runtime works, use that to flash the TS80(P) version and try that. If it doesnt work LMK and ill try and make a custom built to do this

@discip
Copy link
Collaborator

discip commented Apr 11, 2024

Can you try and flash the S60P runtime in the bootloader

Nice approach, will definitely try.
But than it should be the old runtime, that one prior to the change that made the S60P work, the one from the build that bricked the TS80P, right?

@Ralim
Copy link
Owner Author

Ralim commented Apr 11, 2024

Naah I meant the new working one.

What we did by accident (sorry again) is flashed a main bootloader that wants the code at the wrong offset. the new S60 code is at that wrong offset so should take. Once you have a working runtime on there, that should let you flash the main bootloader to the right one

@discip
Copy link
Collaborator

discip commented Apr 11, 2024

@Ralim
Flashing the runtime.dfu worked as expected, but unfortunately in DFU RUNTIME flashing the bootloader.dfu didn't work:

dfu-util -D bootloader.dfu
dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Match vendor ID from file: 0483
Match product ID from file: df11
dfu-util: No DFU capable USB device available

@Ralim
Copy link
Owner Author

Ralim commented Apr 12, 2024

Dang, can you try and flash the runtime from this, then flash the correct normal bootloader if this runtime works?
TS80P.zip

@discip
Copy link
Collaborator

discip commented Apr 12, 2024

can you try and flash the runtime from this

Unfortunately that didn't work.

@discip
Copy link
Collaborator

discip commented Apr 19, 2024

@Ralim
Not sure how to approach this, but have you had by any chance time to think about a viable solution to revive my TS80P? 😊

thanks in advance

@Ralim
Copy link
Owner Author

Ralim commented Apr 19, 2024

Best answer is SWD over the usb-c port.

I'm just not sure in which way it's wrong and not starting

@discip
Copy link
Collaborator

discip commented Apr 20, 2024

Best answer is SWD over the usb-c port.

No clue what that might mean. 😓

What am I supposed to do?

@Ralim
Copy link
Owner Author

Ralim commented Jun 12, 2024

Updated 🤞🏼

@discip
Copy link
Collaborator

discip commented Jun 12, 2024

Updated 🤞🏼

As far as I can tell this seems to work on the S60P.
Will have to test the other devices later. 😅

@discip
Copy link
Collaborator

discip commented Jun 15, 2024

@Ralim

Finally! My TS80P is alive again! 👍

Did flash this PR to all the irons I own.
And this seems to work as intended.

Only adapting the size of the text on the S60P is left. 😊

@Ralim
Copy link
Owner Author

Ralim commented Jun 15, 2024

Fantastic news

What do you think we should do for the text on the larger screens?
Like do you think a new font size for them or?

@discip
Copy link
Collaborator

discip commented Jun 16, 2024

@Ralim
I'm not quite sure.
But I think an appropriate aproach would be to use a suitable new font.

The 2nd option is more of a temporary workaround if it's not that hard to code:
Center the text vertically.

@discip
Copy link
Collaborator

discip commented Jul 11, 2024

@Ralim
What do you think about implementing this PR in the current state?
Of course I would like to have it in the finale state, but when testing other PRs on e.g. the S60P the missing symbols are somewhat annoying.

Otherwise, let me know what I can do to get it to its final state, as I currently have some free time.

@Ralim
Copy link
Owner Author

Ralim commented Jul 11, 2024

Yeah I'm thinking of just merging it too.bi haven't had as much time to work on things so better to get this going I think.

@Ralim Ralim merged commit 4864990 into dev Jul 11, 2024
34 checks passed
@Ralim Ralim deleted the gui-multi-screen branch July 11, 2024 22:27
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