Commit graph

3960 commits

Author SHA1 Message Date
bunnie
d46fa5a153 fix windows related regression in hosted mode run 2026-05-05 23:53:40 +08:00
bunnie
8440706279 reduce debug 2026-05-05 23:53:18 +08:00
bunnie
e9a0b59ab0 soft-fail on request for console 2026-05-05 23:53:02 +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
9815e33f4e fix missing packet issue due to storage overflow 2026-04-23 00:34:35 +08:00
bunnie
4319faa9d0 improve layout for modals 2026-04-23 00:34:15 +08:00
bunnie
a40eba8199 fix hosted mode warnings 2026-04-22 12:07:49 +08:00
bunnie
8f16270efa fix handling of orientation inputs 2026-04-22 03:05:00 +08:00
bunnie
fbe6aad8bb try to improve suspend/resume stability 2026-04-22 01:22:31 +08:00
bunnie
d020bda4be ignore accelerometer "keys" in video loop 2026-04-22 01:22:18 +08:00
bunnie
8521d698d7 add hooks for pre-clock transition on bio
this hook allows the application logic to warn the BIO
app that a clock transition is coming so that glitches can be
suppressed.
2026-04-21 16:27:10 +08:00
bunnie
2ec739e54e fix orientation flipping during QR scan mode
turns out you don't just flip everything all the time! when
you flip the board upside down, the camera also flips. so then
you end up with a flipped image which is super-confusing.

however, the overlay text needs to flip. so this adds the
cases to handle that.
2026-04-21 01:21:51 +08:00
bunnie
0d2c7233d6 improve stability of USB when not plugged in
don't try to use the USB stack when nothing is plugged in
2026-04-21 01:21:13 +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
6eecc52961 rollover handling in rtc wake alarm routine 2026-04-07 18:02:47 +08:00
bunnie
b8194e7c83 add RTC wakeup alarm handling
a bit convoluted:

- RTC wakeup goes through the "always on" subsystem
- keyboard routes through "always on" because the system can wake
on keyboard press
- thus the keyboard mechanism is abused/re-used to pass wakeup
events throughout the system.

Other notes - a wakeup alarm sent within 2 seconds of the current
time will trigger an assert. It's not recommended to use the RTC
for very near-term wakeups because if you e.g. hit swap or have
something else going on that's very "busy" (like QR code scanning)
the system might not get to waking things up in time.

Some code can be written to handle this and set up a degenerate
wakeup, maybe, but for now, I am leaving it as an assert because
I want to remind myself that there is an edge case here.
2026-04-07 15:57:19 +08:00
bunnie
4637fc7037 fix hosted mode 2026-04-07 00:56:57 +08:00
bunnie
70543731d1 add keyboard remapping that also tracks screen flipping 2026-04-07 00:37:15 +08:00
bunnie
1ce29e80fa add ability to flip rendering of sh1107 screen
this allows a device to be flipped upside-down and have
the screen track orientation
2026-04-07 00:36:39 +08:00
bunnie
6b0972a551 add code to implement irq trigger edge updating
also improve comments so I can remember how this actually works.
2026-04-07 00:35:34 +08:00
bunnie
30ca5dec71 adjust disk space usage for lite platform 2026-04-05 23:23:11 +08:00
bunnie
6e528f9678 fix regression on wfi vs bio setting 2026-04-05 23:22:45 +08:00
bunnie
44a53e590a move error definition to api crate, fixes hosted ci 2026-04-04 00:08:39 +08:00
bunnie
f2371f49eb add implementation for owc frobbing
by default the knob is not frobbable because frobbing the
knob can lead to potential griefing

more specifically the owc (one way counters) control some
security state. they are all designed to "fail on increment"
but just giving someone a button to increment random counters
gives a DoS vector. So unless you need to open the API it's
recommended to not have it activated.
2026-04-03 23:43:57 +08:00
bunnie
979d00dedf attempt to debug the wfi/bio clock conundrum
the commited code works, but there's something weird going on
with the clock setting math that indicates i'm not understanding
exactly what's going on. Need to move on and solve other problems,
but this will be an outstanding issue.
2026-04-03 23:00:35 +08:00
bunnie
2f9a7cd723 reset the udma block for the camera on every frame
improves stability across multiple captures
2026-04-03 01:53:13 +08:00
bunnie
4f9584ec9e cleanup qr code capture behavior
goes to blank screen after capture instead of previous ui state
also cleans up transitions between camera and run mode
2026-04-02 03:47:46 +08:00
bunnie
ee9bec19a1 fix key mappings and delay times 2026-04-02 03:47:15 +08:00
bunnie
e46a65e21f fix precursor targets 2026-03-31 01:51:56 +08:00
bunnie
e3408f5346 fix more emulated modes 2026-03-31 01:18:53 +08:00
bunnie
5d0c490a55 fix other hosted mode 2026-03-31 00:54:57 +08:00
bunnie
97efc2a162 fix hosted mode 2026-03-31 00:22:36 +08:00
bunnie
3993a0dc88 'fix' for timeout issue on SPIM during display writes
occassionally the hardware block just goes unresponsive. the
'fix' is to reset it, and then re-initialize the interface.

I suspect this has to do with the UDMA silently dropping transactions
when there's too much contention on the bus.
2026-03-30 23:34:25 +08:00
bunnie
b7826c2ebc flesh out backup register interfaces
- adds API for retrieving & setting the ephemeral key. This is
a key that is erased by a power-on reset, but is preserved between
deep-sleep sleep/wake cycles. It is intended for securing a lock
PIN, and can be up to 192 bits long.

- adds API for checking the warm boot flags, which are also stored
in the backup registers.
2026-03-29 18:04:09 +08:00
bunnie
527f256ec1 add API call to determine if in developer mode 2026-03-26 02:12:11 +08:00
bunnie
73021cb2ed add brightness setting function 2026-03-23 18:33:43 +08:00
bunnie
d4933e96a4 make baochip boot logo drawing optional in the kernel driver 2026-03-23 17:23:58 +08:00
bunnie
4f37317427 add bitmap rendering API for baosec targets 2026-03-23 14:52:00 +08:00
bunnie
3035143172 fix hosted mode 2026-03-06 21:26:22 +08:00
bunnie
017ab2a5fd report QR code when test code is scanned 2026-03-06 19:18:05 +08:00
bunnie
3ac87613d1 add UI feedback on baosec targets for PDDB init
useful for MP flow progress monitoring
2026-03-06 19:17:43 +08:00
bunnie
90c3f095ec add support for more keyboard input configs on baosec 2026-02-26 18:29:47 +08:00
bunnie
663139b607 split ADC into its own service thread
this allows the ADC to depend on core HAL services. It's structured
so that other 'misc' services would go into the "other" module,
just to keep the overhead of threads/services down a bit. Up until
this point all the other services mapped to existing/other
server names, like the RTC, susres, etc.
2026-02-24 01:33:25 +08:00
bunnie
18e72a970c add draft ADC support to hal service 2026-02-23 18:53:37 +08:00
bunnie
5a8d5a8de5 fix allocation bug for ifram 2026-02-23 18:15:14 +08:00
bunnie
40a275232c udpate tomls to explicitly enumerate features used 2026-02-20 23:54:07 +08:00
bunnie
cdf489d2b1 fix std-implementation for code size/offset/padding specification 2026-02-20 21:02:19 +08:00
bunnie
b991a54b52 add debug call for bio 2026-02-20 02:09:09 +08:00
bunnie
90b1f2f345 cleanup warnings 2026-02-09 02:48:31 +08:00