Skip to content

cyberpunkunicorn-os 0.1.2: bounded hat probe, reliable tag reads, success flash, whole-frame mirror - #15

Merged
hellofrequencylab merged 2 commits into
mainfrom
claude/project-thread-lhkr1c
Oct 21, 2026
Merged

hellofrequencylab merged 2 commits into
mainfrom
claude/project-thread-lhkr1c

Conversation

@hellofrequencylab

Copy link
Copy Markdown
Owner

Fixes four things Daniel hit on the board on 2026-10-21. One project: cyberpunkunicorn-os/.

"Printing but not answering commands." The startup hat probe runs before Bruce starts its serial command task. When the I2C bus was stuck (usually a wedged PN532 on DIP 3), every one of the 112 addresses hit Wire's 50 ms timeout, and the probe scanned six times. That pushed the command task past the website's 40 s wait. Changes:

  • The probe skips the scan when SDA or SCL is held low.
  • Each address gets 10 ms, each scan gets 250 ms, and the scan stops at the first timeout.
  • No SPI probing after a stuck bus.
  • hat.probe and system.status report i2c_stuck.

A sticker held on the reader is never seen. Bruce's PN532::read() and write_ndef() select the card again and read the answer without waiting for RDY, because nothing waits over I2C. So every retry could fail. We now read and write on from our own selectCard(), which waits. The poll wait goes from 40 to 150 ms, so a poll never talks over the PN532's "no card" answer.

No speaker. A successful write or member scan now flashes the onboard RGB LED through the rainbow. It runs on its own task, so the reply doesn't wait.

The live screen shows fragments. New patch 0018 changes Bruce's tft logger. With display start on, it dropped draws when the 40–64 entry queue was full, and it never sent a draw already in its log, such as an erase in the same colour. Now every draw is queued, waiting up to 50 ms for room.

OS_VERSION is 0.1.2. I could not build locally because the container's proxy breaks PlatformIO's toolchain download, so CI is the build check. Nothing has been tested on hardware yet.

The website side is hellofrequencylab/frequency-web on branch claude/project-thread-lhkr1c.


Generated by Claude Code

…lash, whole-frame mirror, 0.1.2

- Hat probe: a stuck I2C bus (usually a wedged PN532) ran every address into
  Wire's 50 ms timeout, six scans at boot, so the command task started after
  the website stopped waiting ('printing but not answering'). Now: lines held
  low skip the scan, 10 ms per address, 250 ms per scan, stop at the first
  timeout, no SPI after. hat.probe and system.status report i2c_stuck.
- Tags: Bruce's read() and write_ndef() re-select the card and read the
  answer without waiting for RDY, so a tag held still could miss every retry.
  Read and write on from our own select, which waits. Poll wait 40 -> 150 ms
  so a poll never talks over the PN532's no-card answer.
- No speaker on this board: a successful write or scan flashes the onboard
  RGB LED through the rainbow (own task, the reply doesn't wait).
- Patch 0018: the screen stream sends every draw, waiting for queue room,
  instead of dropping a busy screen and de-duplicating erases.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Aw32AU4vVqCSEoNA5aP3U
@hellofrequencylab
hellofrequencylab marked this pull request as ready for review October 21, 2026 01:56
…019)

PN532's format_data(), set_uid(), read_data_blocks() and write_ndef_blocks()
are private, and card.cpp's '#define private public' only opens Adafruit_PN532,
so the CI build refused them. Patch 0019 adds two public PN532 methods that
wrap them; card.cpp calls those.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Aw32AU4vVqCSEoNA5aP3U
@hellofrequencylab
hellofrequencylab merged commit 559d006 into main Oct 21, 2026
2 checks passed
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