Skip to content

cyberpunkunicorn-os 0.1.3: one owner for the hat bus, reader poll stats - #16

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

@hellofrequencylab hellofrequencylab commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

This follows up 0.1.2 (#15). Daniel's Device log showed two problems on 0.1.2. The write opened the reader, then polled for 30 s with "No card", even with the sticker on the read area. Screen packets also showed up as binary in the text log, only while commands were running. One project: cyberpunkunicorn-os/.

One owner for pins 22/27. The UI task and the remote command task could both drive the hat bus. For example, a menu's hw::rescan() called probeHat(), which ends the I2C bus, and it could do that while the remote task was polling the PN532. The fix is a recursive hat-bus mutex:

  • It is held from readerOpen() to readerClose(), and during every probe.
  • A probe from another task returns the last result and does not touch the bus.
  • readerOpen() waits up to 600 ms for a probe that is already running.

Poll stats on a timeout. A remote tap that times out now says how the selects ended (no ack, no answer, no card, seen), in the reply and on serial.

Patch 0020: the screen stream stays on its link. With the Bluetooth API on, serialDevice is the BLE serial except while a USB command runs. So the stream went to the phone, and reached the cable only in torn pieces during commands. The stream now keeps the device that sent display start, and cli.run refuses display.

OS_VERSION is 0.1.3. CI is green. Nothing has been tested on hardware yet.

🤖 Generated with Claude Code

https://claude.ai/code/session_015Aw32AU4vVqCSEoNA5aP3U

- The UI task and the remote command task could both drive pins 22/27: a
  menu's rescan (probeHat) ended the I2C bus under a tag being read for the
  website, and readerOpen saw 'no reader'. A recursive hat-bus mutex now
  covers readerOpen..readerClose and every probe; a probe from the other
  task returns the last result instead of touching the bus, and readerOpen
  waits up to 600 ms for a running probe.
- A tap that times out now says how the reader's selects ended (no ack, no
  answer, no card, seen) in the reply and on serial, so the website's
  device log tells a dead reader from an empty field.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Aw32AU4vVqCSEoNA5aP3U
…(patch 0020)

With the Bluetooth API on (Daniel's board has it on at boot), serialDevice is
the BLE serial except while a USB command runs, so the screen stream went to
the phone and reached the website only in torn pieces during commands: the
garbled mirror and the binary in the device log. The stream now keeps the
device that sent 'display start'. cli.run refuses 'display' so that device is
never a capture that dies with the call.

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 02:54
@hellofrequencylab
hellofrequencylab merged commit d67b500 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