Commit graph

37 commits

Author SHA1 Message Date
bunnie
a421b7abfa replace watchdog hack with an atomicbool; reset cam on setup
This patch replaces the watchdog thread with a spin-wait on
an atomicbool that is set by the IRQ handler once an IRQ
triggers. This is a much cleaner, lower-overhead way to handle
the time out.

This patch also puts the camera setup into a retry loop, and
by default on setup it does a hardware reset of the display
subsystem (this includes the OLED screen). This hopefully
gives the subsystem a much better chance of recovering from
the camera being in a scrambled state. The working theory
for why the camera might get scrambled is that it assumes
it is a sole I2C device, and when its init sequence is
interrupted by other devices handling requests it does
not handle this situation gracefully.
2026-05-29 00:08:02 +08:00
bunnie
d325f80e31 gate camera wdt behind a feature flag
not needed in all scenarios
2026-05-27 13:19:11 +08:00
bunnie
6a7caff54c improve display boot stability
an instance of the SPI interface timing out was observed on boot.
It's rare, but it happens.

This wraps those early calls with a retry loop and then
fail to reboot in case something really goes wrong.

Assisted-by: qwen3.6:27b (local)
2026-04-26 17:32:05 +08:00
bunnie
4d1dc33ef1 add a diffusive transition option to the graphics library
makes changing between bitmaps less jarring
2026-04-23 15:14:27 +08:00
bunnie
0c23c5e5bc add eternal-scan feature
this is useful for aligning factory test features
2026-04-13 00:03:42 +08:00
bunnie
d4933e96a4 make baochip boot logo drawing optional in the kernel driver 2026-03-23 17:23:58 +08:00
bunnie
3f869ca389 bump utralib version for publication 2026-01-29 19:12:00 +08:00
bunnie
b2cf705c59 bump ticktimer version to drop susres dependency 2026-01-28 20:53:57 +08:00
bunnie
e329ebeb1d oem-baosec-lite support to bao-video
remap pwm lock output. This reduces power consumption in
camera mode by removing an I/O conflict with the keyboard
scanner.
2026-01-24 23:51:22 +08:00
bunnie
fba011db3a commit version bump so that we may publish our packages 2026-01-08 03:04:19 +08:00
bunnie
d874c3e5c2 commit for version bump 2025-12-16 02:02:37 +08:00
bunnie
1f9ab022f2 implement on-demand QR code scanning 2025-11-27 16:50:47 +08:00
bunnie
dbb0a75118 bump versions
have to absorb a version change due to xous-semver change

might as well also update the utra/svd generator dependencies
since that's been held off for a long time now.
2025-10-06 13:23:18 +08:00
bunnie
1255bf12d9 FLAG DAY: fix all names to harmonize around 'bao1x'
The code base had evolved through several code names, interim
names, company names and chip names that alternatively did or did
not exist.

Baochip is the definitive name of the company, and the Baochip1x
(full part number BAO1X2S4F-WA) is the definitivey part number of
the SoC. For convenience, the part number is shortened to 'bao1x'
in most feature flags and variable references.

This commit fixes all of the odd names and removes some unmaintained
early targets.
2025-09-18 21:25:51 +08:00
bunnie
0df2cb73f7 fixup bao-video deps 2025-09-09 22:24:55 +08:00
bunnie
1c8a3a3ee9 migrate to using the latest rqrr with perfromance enhancements 2025-09-06 22:47:48 +08:00
bunnie
ac458c4b07 reduce pixel math (do mirroring in camera module)
also add some more analytics output
2025-08-20 03:07:12 +08:00
bunnie
1d950033af add base64 dumping of captured images for off-line optimization 2025-08-19 22:44:15 +08:00
bunnie
b63371a56f turn off autotest for now 2025-05-21 10:23:15 +08:00
bunnie
e2379821e6 republish xous-rs to fix cargo test 2025-05-11 15:36:17 +08:00
bunnie
8a4959056b bump version for xous crate update - commit so we can publish crates 2025-05-11 14:45:24 +08:00
bunnie
30fcc3016f use bao-video to route the acquire/release of the modals focus
it has to route through here anyways, so this is the sensible
place to also forward on the keyboard release/acquire messages
2025-05-06 01:47:55 +08:00
bunnie
cb0cfb3f2c cleanup dependencies 2025-02-28 17:31:14 +08:00
bunnie
4f067dc090 add gfx-testing option to bao-video 2025-02-26 14:46:47 +08:00
bunnie
a66a541488 pass the cramium-soc flag to blitstr2 when compiling for hardware 2025-02-24 02:30:07 +08:00
bunnie
8c9abf6c5b add implemnetation for most graphics primitives
this is mostly a copy of what's in graphics-server. Perhaps
we can find a way to share the code between the two, but I
am going to leave it duplicated for now because it's unclear
if I can use this implementation as-is, or if it needs lots
of modifications.

If it turns out to basically work without mods, then, we can
wrap a bunch of the opcode dispatch into mega-function perhaps
that takes a display and opcode as parameters and wraps a lot
of the boilerplate into a re-usable routine.
2025-02-23 12:05:00 +08:00
bunnie
69c2b84e42 bao-video: fix dependencies and minor API tweaks due to ux-api refactor 2025-02-21 17:52:41 +08:00
bunnie
5ffacf63f3 cleanup bao-video to use the new API
also condense main into a single routine again, now that
we have gone through the trouble of creating interoperable
APIs.
2025-02-20 15:06:15 +08:00
bunnie
14bfa42aec fixup feature specifiers 2025-02-18 23:21:41 +08:00
bunnie
b76f02bb11 get past some configuration issues 2025-02-13 17:38:14 +08:00
bunnie
edab1ddcf2 refactor bao-video structure to facilitate hw and hosted modes 2025-02-13 17:30:04 +08:00
bunnie
c0822a6109 refactor bao-video to use ux-api 2025-02-02 07:02:53 +08:00
bunnie
45a8eb2227 stage tomls for version bump: try_send added to xous-ipc 2024-12-16 18:50:11 +08:00
bunnie
93b9ec00bf bump version numbers on all the packages so we can absorb num-derive changes 2024-12-02 19:14:11 +08:00
bunnie
83e26ff4c7 update num-derive dependency
this became mandatory in 1.83 to remove warnings. I think it
should have no impact on functionality.
2024-12-02 18:52:59 +08:00
bunnie
dc0fd47ff4 add an option to decongest udma
There is a hardware bug that causes SPIM RX packets to fail when
the UDMA bus is busy (like when streaming video). This causes
swap memory to fail because it relies on the SPIM bus.

This patch causes the video to sample *after* any computation
happens, so that any swap memory that might be hit taken care of.

This reduces the efficiency of the loop somewhat, because without
the decongesting, we could kick off the camera read and do useful
computation while the camera streamed data. Now we have to keep
them separate to work around this bug.
2024-11-08 00:14:21 +08:00
bunnie
2692d374c6 add some test scaffolding for userspace video processing
The whole graphical interface - camera + display & QR code processing -
is incorporated into a single process space to minimize on the amount
of swapping/memory message passing necessary to implement a low-latency,
high-frame rate video interface.

The current service just starts a camera-to-display loopback
while searching for and aligning QR code markers, without consulting
any other service on whether it should do that or not. Suitable
for debug and performance characterization, but not usable for
product integration.

The good news is we're getting an acceptable frame rate on
the camera during search mode with the kernel running.
2024-11-07 16:14:29 +08:00