Draft
Conversation
1501931 to
e6aa184
Compare
Add a mode to return the framebuffer to the user without being cleared. Allows for a slightly better framerate when the whole screen is overdrawn.
Add builtins for X2, X4 and OFF so we can: image.antialias = X2
9df9098 to
23b6d91
Compare
Closed
Deprecate passing True/False into display.update() to pick pixel doubled vs full resolution. Move this to display.fullres(True / False)
a778ad1 to
5bc7c5b
Compare
This violated the cardinal rule: don't write to FAT from the board. Highly probable source of our corrupt-from-just-resetting issue. Remove any attempt to recover the FAT during boot and instead emit an error. This leaves us with room to inspect or attempt to recover the filesystem rather than the board simply resetting it.
Allow the user to attach Thonny or a serial terminal and try to diagnose, recover or reformat the filesystem. Note: _boot_fat.py occurs before USB is enabled.
c9d22ea to
b645e17
Compare
text.scroll broke convention with other drawing methods by accepting a bg and fb pen, which is confusing terminology we don't use elsewhere. Remove the pen settings to fix this. The "continuous" argument also made no sense, and was easily confused as "keep scrolling forever". Change it to "gap" to be more explicit that it controls the gap between scrolling text instances, not how many times the text will scroll. Finally make the default target *just* screen so that screen.pen will work, otherwise this gets copied to the implicit window only once on scroll init and cannot be subsequently changed.
We had lost support for UTF-8 codepoints and by extension everything from the degrees sign to many accented characters. Add this support back in and expand MonaSans-Medium.af with the necessary codepoints for (incomplete) European language support.
Move much of the busywork handled by main into run() and allow it to accept an app path. Fix fonts set by import being overriden at runtime (except where an inline run(update) is used). Don't clear twice on the first update. Make sure all cleanup happens on HOME exit, exceptions etc. NOTE: "on_exit" will fire in all cases, even if the app crashes with an exception. Care should be taken not to write garbage if app init has failed.
Return bytes in all cases so we're not mixing units.
badge.default_pen(pen) -> badge.default_pen = pen badge.default_clear(pen) -> badge.default_clear = pen w, h = badge.resolution() -> w, h = badge.resolution badge.set_caselights(c1[, c2, c3, c4]) -> badge.caselights(c1[, c2, c3, c4]) c1, c2, c3, c4 = badge.get_caselights() -> c1, c2, c3, c4 = badge.caselights()
8d7973e to
cd2ab9e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog
with-filesystembuild since there are breaking changes which require the apps to be updated. Back up your filesystem first!Latest experimental build here: https://github.com/pimoroni/tufty2350/actions/runs/21787998506/artifacts/5419215551
Thonny
The MVP for a working program is either:
or - avoiding run:
FAT FS corruption issues
After much deliberation I realised we're setting the filesystem label every time the board boots. This means there's a write to the FAT filesystem which could potentially go wrong†. This is now removed, with the label set in the filesystem image instead. Hopefully this leads to a more robust FAT.
In addition to this, the board will save a checksum file and backup of the 16K FAT at the head of the filesystem. If the board fails you may be able to use Thonny and a simple script to recover the last backed up FAT.
TODO: Maybe make this an explicit feature of MSC mode requiring a button combo/long press or something unlikely to happen accidentally.
† - by wrong, I mean that a flash write starts with a block erase and if your board resets between the erase and the new data being written then you have a 4k empty block where there should have been 1/4th of file allocation table.
Picovector
jpeg image support
loading images from RAM/buffers support
image.load(open("image.jpeg", "rb").read())A small bugfix to fix the right-hand edge of some vector shapes being cut off.
The dda algorithm ended up being full raycast and was renamed to
raycastwithddafor a single ray.vspan_texis nowblit_vspanwith floating point texture coordinatesio is now badge
iohas been - roughly - renamed tobadgeand buttons are now builtin, this changesio.BUTTON_A in io.pressedto eitherBUTTON_A in io.pressed()orio.pressed(BUTTON_A)io.ticks->badge.ticksio.ticks_delta->badge.ticks_deltabadgeware.get_battery_level()->badge.battery_level()badgeware.is_charging->badge.is_charging()badgehas new features:badge.modelreturns "tufty", "blinky", or "badger" depending on boardbadge.uidreturns the board UID as hexadecimal represented as an ASCII stringfree()is now builtinCaselights
The caselights, the four lights illuminating the case, are now accessed through:
badge.set_caselights(v1[, v2, v3, v3])and:
v1, v2, v3, v4 = badge.get_caselights()rtc functions now have their own module
Functions related to the RTC have been moved into the builtin
rtc. This includes helpers likertc.set_timer(minutes=N).Images
🥳 jpeg image support!
Both JPEG and PNG images support downsizing on load.
Text Module
text_tokenise()->text.tokenise()text_draw()->text.draw()scroll_text()->text.scroll()Mode now includes VSYNC (Tufty only)
mode()is nowbadge.mode(), it still supportsLORESandHIRESand has an additionalVSYNCoption to enableVSYNC. AvoidingVSYNCwill normally give you a better framerate where your app logic takes over ~8ms, since you wont be missing entireVSYNCperiods and having to wait up to 16.6ms. UsingVSYNCwill fix screen tearing at the cost of raw framerate. Currentlydisplay.update()on Tufty blocks for around 7.7ms leaving you only 8ms for logic/drawing.To enable VSYNC when changing mode use
badge.mode(HIRES | VSYNC)orbadge.mode(LORES | VSYNC)