Skip to content

Full Screen support for TS101 OLED 132x32 #2215

Open
tvidal-net wants to merge 27 commits into
Ralim:devfrom
tvidal-net:main
Open

Full Screen support for TS101 OLED 132x32 #2215
tvidal-net wants to merge 27 commits into
Ralim:devfrom
tvidal-net:main

Conversation

@tvidal-net

@tvidal-net tvidal-net commented Jun 20, 2026

Copy link
Copy Markdown

First of all, I want to be completely upfront about this. I made these changes with the help of LLM for my own usage and I have zero expectation of this PR ever being merged, I am just raising it as a courtesy so you can be aware of the changes I made to your project and decide if any of this can actually be useful.

I know there's a refactor going on to support pre-rendered screens and this PR may break the ongoing work, so please, feel free to completely ignore it or reject it if it's not up to standard.

  • 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?

TS101 uses a bigger OLED screen with 132x32 pixels and the current screens don't fit the full display, showing the text at the top left corner.

  • What is the current behavior?

As reported by #2212 #2063 and a few other issues.

  • What is the new behavior (if this is a feature change)?

Information is displayed using the full screen.

  • Other information:

I imported the Terminus 8x16 and 12x24 bitmap fonts, which are taller but not too much wider and refactored some of the screens to draw the full screen with the help of LLM.

TS101

Claude Code by Anthropic and others added 27 commits June 20, 2026 12:42
Terminus normal weight, to become the SMALL (8x16) and LARGE (12x24)
fonts on 128x32 panels. By Dimitar Toshkov Zhekov, SIL OFL 1.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Instead of adding new font styles, the existing SMALL and LARGE fonts
are simply bigger on 128x32 panels: make_translation.py emits
USER_FONT_6x8 / USER_FONT_12 from Terminus 8x16 / 12x24 under
OLED_128x32 (same array names, so FontSection is unchanged), and falls
back to the hand-drawn 6x8 / 12x16 elsewhere. drawChar picks the
dimensions per panel and can render at a non-strip-aligned y so a 24px
glyph can be vertically centred (y=4). No new FontStyle or struct
fields; every existing screen inherits the larger fonts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ui_draw_tip_temperature_readout draws the tip temp left-aligned with
exactly its digit count in the (now 12x24) LARGE font, and
ui_tip_temperature_readout_width reports its width for right-aligning
under rotation. Used by the detailed 128x32 screens.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Both detailed 128x32 screens draw the tip temperature in the LARGE
(12x24) font, vertically centred (y=4) and flush to one edge, with two
SMALL (8x16) status rows flush to the other edge (set-temp/voltage on
idle, wattage/voltage on soldering). Uses the standard print/printNumber
API. Sides flip with rotation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 128x32 LARGE readout font should be the bold Terminus weight
(ter-u24b) for a heavier temperature display; SMALL stays regular
(ter-u16n). Swaps in ter-u24b.bdf and drops the unused ter-u24n.bdf.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Revert to the standard ui_draw_tip_temperature (fixed 3-digit field, so
no digit-counting needed) and position it right-aligned within an 80px
zone, vertically centred at y=4. Removes the
ui_draw_tip_temperature_readout / ui_tip_temperature_readout_width
helpers added earlier.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The single-line large readout was centred for the 16px font (y=8); on
128x32 the LARGE font is now 24px, so use y=4 for true vertical centre.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
With SMALL now 16px tall on 128x32, the second row of two-line screens
must sit at y=16 (not y=8) to avoid overlapping the first. Updates the
PD-debug, debug menu, undervoltage warning, CJC sampling, and detailed
sleep screens.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The DegC/DegF symbol constants were just 'C'/'F', so
printSymbolDeg(SMALL|LARGE) printed only the letter (the degree was
only available via the EXTRAS combined icon). Make them '°C'/'°F'; the
degree glyph (U+00B0) exists in both the hand-drawn 6x8/12x16 fonts and
in Terminus, so it renders on all panels.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On 128x32 the EXTRAS degree icon is 16px and looked wrong next to the
24px LARGE tip temperature (the degree was effectively lost). Draw the
big number alone, then the degree+unit in the SMALL font at y=12 so it
sits bottom-aligned with the 24px digits, closer to the TS100 look.
Temp width updated to 3 large digits + small degree (52px).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The setting value column is tuned for a 96px panel and drawn at y=0. On
128x32 shift it right by the extra panel width so it stays edge-aligned
(was floating mid-screen / overlapping wrapped names), and draw it at
y=4 to vertically centre the 24px value. 96x16 builds are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reduce the temperature zone from 80px to 68px so the readout sits 12px
further from the status block, using the extra room on the 128px panel.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Draw the 24px tip temperature at y=8 on the simplified idle and
soldering screens so the digits sit lower/centred on the 32px panel.
The heat indicator stays at y=0 (its fill is hardcoded there).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
drawCheckbox now centres the 16px box for the panel height instead of
inheriting the value cursor's y=4. No change on 96x16 (y stays 0).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The help/description text was drawn in the 24px large font at y=0,
sitting above centre. On 128x32 use the 8x16 small font centred at y=8
(and width it at 8px/char so the scroll math matches). 96x16 unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The PD voltage indicator stacked two 24px digits (y=0 and y=16) which
overran the 32px panel. Use the 8x16 font so the two digits fill the
height, and centre the battery/DC logo at y=8. On the simplified
soldering screen position the icon near the right edge (x=116) to match
the idle screen instead of floating mid-screen.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The value is now '°C'/'°F' (two large glyphs); combined with the wider
value column it ran off the right edge. Right-align it to the panel and
centre it vertically.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The variable-width tip name (AutoSense/TS100/...) overran the wider
value column. Right-align it to the panel width and centre it for the
16px font so it stays on screen.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The PD mode values already contain a newline (e.g. 'Default\nMode') but
were anchored at the far-right value column and overran the edge. Anchor
them to the right ~64px so the newline wraps them into two 16px rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Menu descriptions are encoded against the large-font symbol table, so
rendering them with the small font on 128x32 indexed the wrong glyphs
and produced garbled help text. Draw them with the large font (the one
they are encoded for) and centre the 24px glyphs vertically; revert the
now-unneeded panel-aware messageWidth helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Tip names embed a newline (e.g. "Auto\nSense"), but drawChar only
wraps at y==0; drawing the value at y=8 skipped the newline and the
name floated mid-screen over the title. Anchor a right-aligned,
two-line block at the top so the name wraps like the PD Mode value,
using the widest line to keep the block edge-aligned.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Descriptions were ranked and encoded against the large font, so drawing
them with the small font on 128x32 indexed the wrong glyphs. When the
build defines OLED_128x32 (detected via the macros file already passed to
make_translation.py), route descriptions through the small font pool and
encode them with the small conversion table, then draw them with the
small font at 16px. Non-128x32 builds are unchanged.

Supersedes the earlier large-font workaround; English (and any all-ASCII
language) now renders correct, compact help text. A language needing
glyphs absent from the small font built for a 128x32 panel will fail
generation with a clear error rather than rendering garbled text.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The 24px tip temperature on the simplified cooling and soldering screens
sat on the bottom edge (y=8 bottom-aligned it). Use y=4 to centre it
vertically and nudge it one digit (12px) to the right.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The basic sleep readout drew "Zzz NNN°" top-left at (0,0). Centre the
96px block horizontally (x=16) and vertically (y=4) on the 32px panel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Warnings were printed top-left via printWholeScreen. Measure the widest
line and line count (honouring the leading-newline large-font marker and
the multi-byte encoding) and centre the text both horizontally and
vertically; single-line 24px warnings land at y=4, two-line 16px ones
fill the panel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Explain that this fork temporarily addresses the TS101 large-display
issues until upstream's refactor lands, that the PR is a courtesy with
no expectation of merge, and that it is only tested for right-handed,
English, TS101 use.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add special build rule for policy_engine.cpp to use -O1 optimization
instead of -Os. This prevents aggressive compiler optimizations that
disrupt timing-critical I2C communication with the FUSB302 PD controller.

Root cause: Compiler update in commit 849d1f7 (Alpine 3.16 GCC 11.x
to Alpine 3.19+ GCC 14.x) introduced aggressive optimizations.

Fixes boot loops on TS101 when connected to USB-C power sources that
worked with v2.22 but fail with v2.23+.

Tested on TS101 with 100W USB-C power bank.
@tvidal-net

Copy link
Copy Markdown
Author

btw, it's rebased from v2.23-rc4 but I can raise from a new branch based on dev, it there is any chance this could be useful

@Ralim

Ralim commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Hia,

I don't hate AI assisted code so long as its carefully reviewed, just don't like largely un-reviewed code. Soooo....

I've skimmed though this and at a high level I see no big issues with this. However, I do want to review and merge this piecemeal to let me review more carefully than a 70k line delta.

I do not have access to a TS101 to hand as of present, but if your happy to make PR's that are more targeted to one feature at a time and test each one I'm happy to review and merge.

Would you be willing to do a little work to break this up into a PR at a time and merge those in?

I think loosely it would be to collect up related changes and open a PR for them to dev in a more piecemeal approach. The changes in the drawing/mono_128x32 path all seem about logical.

I think if you can open pr's to dev for:

  1. Adding the new font rendering
  2. The non drawing/mono_128x32 changes
  3. The remaining drawing/mono_128x32 changes

I can review these one at a time and then it will be a bit easier for us to get these changes in.

I don't have super big issues with the changes; but probably smaller cleanup things. It would be good to avoid overloading things like USER_FONT_12 or USER_FONT_6x8 with a bigger font that isn't those sizes. I'd rather we refactor the font storage to store under the correct name or we rename these to just small and large.

Also, with (1) can you add to the Readme a note about the font, where to get it, and its licensing status.

You should be able to split this into dependant branches and make PR's that base on each other, so as I review them they should hopefully rebase cleanly.


The refactor is more about trying to make declaring screens easier, pre-rendering for documentation is a later concern tbqh. I'm happy rebase the changes I'm making there on this as I'd rather take the energy you have and get some fixes in, I can always come back to that when I have time and it wont take much to backport these.


Also if you have time, for the PD regression on miniware devices, I dont know if that will still be required after this change and I'd love some testing.

@Ralim

Ralim commented Jun 21, 2026

Copy link
Copy Markdown
Owner

I hope that all makes sense 😁 of course lmk if there are issues with that

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.

3 participants