P5: device integration - host battery, the 6x8 A/B font, deploy updates
- BatteryService grows the host provider (Platform.battery="host"): the PicoCalc's own pack through the kernel power_supply driver - a true percent and charging flag from sysfs, no voltage-curve estimation, no radio connection needed. Unreadable supply = absent, gauge hidden. - The console-font script now builds TWO 512-glyph PSF2 fonts: the 6x12 Terminus-based default (53x26) and a 6x8 A/B candidate (53x40) based on the kernel's own font_6x8 (CP437 coverage - documented as having no Cyrillic), with the braille block at 2px dot pitch and all 18 marks redrawn for the shorter cell. Built and verified live on the Lyra: stty reports 53x40 under meshterm8, specimen legible (.claude/plans/p5-specimen-6x8.png); flip with setfont, persist the winner in vconsole.conf. JP judges the A/B by eye. - calculinux-setup.sh puts the deploy user in input/dialout/video (input is the modifier watch's /dev/input access). - theme's platform binding now drops the fold table and cache on every switch: its emoji pads bake in cell_len at build time, which the regular platform's emoji-width calibration can re-measure - a stale table survived platform swaps in randomized test runs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2b658f47a9
commit
89eef7f4d2
5 files changed
+279
-105
No files matched your search
@@ -669,8 +669,13 @@ _fold_impl: Callable[[str], str] = _no_fold
|
||||
@on_platform
|
||||
def _bind(platform: Platform) -> None:
|
||||
"""Bind the theme's platform-dependent choices (runs now and on every switch)."""
|
||||
global _ACTIVE_THEME, _name_impl, _glyph_impl, _fold_impl
|
||||
global _ACTIVE_THEME, _name_impl, _glyph_impl, _fold_impl, _FOLD_TABLE
|
||||
_ACTIVE_THEME = MESH_THEME if platform.truecolor else MESH_THEME_16
|
||||
_name_impl = _name_style_by_key if platform.name_colour == "key" else _name_style_by_type
|
||||
_glyph_impl = _glyph_identity if platform.emoji else _glyph_compact
|
||||
_fold_impl = _fold_to_font if platform.ascii_fold else _no_fold
|
||||
# The fold table's emoji pads are computed with cell_len at build time. Cell widths
|
||||
# can be re-measured/patched (the emoji-width calibration on the regular platform),
|
||||
# so a platform switch drops the table and cache rather than trusting stale pads.
|
||||
_FOLD_TABLE = None
|
||||
_fold_to_font.cache_clear()
|
||||
Reference in new issue
Block a user