Commit graph

2858 commits

Author SHA1 Message Date
bunnie
aaa52ca02c fix warning in en-tts build 2023-12-23 23:50:57 +08:00
bunnie
9c2523ded4 fix #227 2023-12-22 22:20:55 +08:00
bunnie
46588a418c pin smoltcp to a local fork
we need to tag out a release, so we're temporarily forking
`smoltcp` at its current head, testing it, and holding it
there until a full release is tagged out that captures all
of the good stuff that has been going on in that repo since
June.
2023-12-22 22:04:07 +08:00
bunnie
4917d16a02 add some notes about debugging smoltcp 2023-12-22 09:39:11 +08:00
bunnie
85def0adc5 don't block on connection manager
refactor CM routines so if the CM is hung it won't block the net
main thread.
2023-12-22 09:38:43 +08:00
bunnie
fcd7bc9bb8 allow pump to be falliable
attempt to reduce blocking in net path
2023-12-22 09:36:17 +08:00
nworbnhoj
7a75bf73e3
make net ws more robust to test websocket server connection failure 2023-12-12 16:12:22 +11:00
bunnie
fe2eb732a0 add a test for std seek 2023-12-10 12:54:06 +08:00
bunnie
2a521b5b86 fix stdseek to match std word ordering 2023-12-10 12:53:50 +08:00
bunnie
e0e908dbf4 fix utctimems to match std 2023-12-10 12:53:39 +08:00
bunnie
0a0ac292c3 modernize opcode debug on PDDB 2023-12-07 18:41:51 +08:00
bunnie
d9b8fe686d on second thought, no need to check if tz is 0
any time setting would have a non-zero utc offset since the hw
RTC starts near epoch. it is sufficient to just check for that.
2023-12-07 10:01:58 +08:00
bunnie
a36545073d fix #459
This is an error in the "unset time" validator -- should be an &&
statement instead of an || in checking for an unit'd state.
2023-12-07 02:15:25 +08:00
bunnie
9ab66eea80 change error message that's more of a warning 2023-12-07 02:15:05 +08:00
bunnie
7da070f37c fix #460 - prevent PDDB mount dialog from popping up during updates
check the newly-minted EC ready bit prior to running the PDDB mount
handler.
2023-12-07 01:31:06 +08:00
bunnie
6c39534a7b mark the EC as ready at the conclusion of all update activity
by marking the EC as ready after all the update checks are done
we can ensure that the PDDB mount dialog does not attempt to come
up during an EC update.
2023-12-07 01:30:33 +08:00
bunnie
5bff1f6c46 add routines to set/get EC readiness
The nominal purpose of this is to allow other services to delay
interactions that could interfere with an EC update.

Note that anyone could call this routine and mark the EC as not
ready, since the llio block is not secured and the API is public.

I don't think it's a security problem, but is a DoS vector.
2023-12-07 01:29:05 +08:00
bunnie
5aff0f2413 cleanup doc comment errors 2023-12-01 22:08:34 +08:00
bunnie
fa3f349a0a bump pins as xous-rs has changed 2023-12-01 21:20:01 +08:00
nworbnhoj
e8e875742e replace more TcpStream::connect(&str) with TcpStream::connect((&str, u16))
resolves #453
2023-11-30 20:29:15 +11:00
bunnie
367ede62b1 convert usbd-human-interface-device to xous-usb-hid 2023-11-16 17:27:00 +08:00
bunnie
419e547641 bump usbd-hid-device crate to latest
API changes to see if we want to absorb this prior to forking.
2023-11-12 00:02:07 +08:00
bunnie
4f75cd76a8 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2023-11-11 23:13:19 +08:00
bunnie
5ad6106daf fix missing arg on unsafe-app-loading 2023-11-11 23:12:51 +08:00
bunnie
d4624124c9
Merge pull request #443 from betrusted-io/chat-status
WIP: Chat status
2023-11-03 13:54:34 +08:00
bunnie
6ab88117f6 bump xous-api-log version & fix version pins 2023-10-31 20:07:28 +08:00
bunnie
f1cd3a4325
Merge pull request #439 from vihaanjim/main
An App Loader
2023-10-31 19:56:45 +08:00
bunnie
699372d8d3 add hashmarks to the status bar when a new name is registered
we can't guarantee that we're running only signed code at this point,
so create a visual indicator of this.
2023-10-31 00:42:25 +08:00
bunnie
c346485832 isolate unsafe app loading features behind unsafe-app-loading feature gate 2023-10-31 00:18:42 +08:00
bunnie
ae7ee770ee expose the GAM minimum redraw period
this could be useful for functions that have to rapidly
toggle events on the screen and want to make sure that
the last event actually is rendered.
2023-10-29 23:02:44 +08:00
bunnie
cdada99705 miss copy-back of the animation state 2023-10-29 19:14:57 +08:00
bunnie
4423339059 move wifi delay hook to the correct area
- remove modal pop-up for wifi connection, and replace with
busy animation
- specify units of delay in the constants (_MS to indicate milliseconds;
this is a convention I'm trying to adhere to)
- partial progress on debugging why the animation isn't running
(value of animation variable is not being passed back at the GAM layer).

Also a general note on coding styles that probably is going to cause
confusion now that more people are contributing to the code base.

Generally, when a lot of "generic" library functions fail, we've been
passing an error message up the stack. However, these functions are
actually meant to be infalliable, and when you kick the error up the
stack you just end up with a panic at an unhelpful location (because
you finally catch the error only at the main loop or something and
by that point there's nothing you can really do about it but panic,
since it's supposed to be an infalliable operation).

As a result I have been trying to tamp down on needless error propagations
and having them fail with a unwrap or expect at the point where the
abstraction should be infalliable. This helps in debugging the actual
failure root cause because you're closer to the line of code that
actually broke, instead of just some line at a generic error handler.

Of course if you build with stack unwinding the top-level unwraps are more
useful because you can peer down into the call chain, but even then,
with the limited screen real estate I think deeply nested failures
would probably overflow any panic display. So even with panic unwinding
I think we stil want to keep the root cause within a few stack frames,
instead of errors being passed up sixteen levels of abstraction before
finally dying.

This only applies to things that are meant to be truly infalliable,
like syscalls that should not fail, or like unpacking a buffer or
memory message that has already been allocated. In this case the errors
are more like asserts, and are helpful if they fail at the line where
they break instead of being passed up the call stack (which was the
original architecture).

Probably I should add a note about this to the Xous Book.
2023-10-29 16:33:03 +08:00
bunnie
d844c4306c reduce size of chat status bar to match status bars above 2023-10-28 22:50:23 +08:00
bunnie
8f549b3031 pick a more "happens to be aesthetic" setting for the XOR op defacing
XOR op should not be usable to create fake security boxes

but it also looks really ugly to have it defaced.

This small tweak makes the XOR function look decent for the initial
purpose of the function (chat status bar wait indicator).

Eventually, this will be a controversial decision, but I'll kick
that down the road.
2023-10-28 22:48:52 +08:00
bunnie
e2594a3000 fix visibility of default font 2023-10-20 00:39:03 +08:00
bunnie
006530a1f5 make the default style for the text box something API-level accessible
this allows other functions to lay out based on the default style
without having to guess it.
2023-10-19 22:39:06 +08:00
bunnie
4e93e903a3 didn't mean to check in this flag 2023-10-19 17:45:09 +08:00
bunnie
64346522b3 make the vertical stripe smaller relative to the overall height
this ratio should be enough to spoil the XOR effect for any
forging application but small enough that it's not as visually distracting.
2023-10-18 15:08:05 +08:00
bunnie
50ef03e319 alternate XOR pattern for busy-bar
this it to avoid abusing the primitive to create inverted text
(for secure UI elements only). It does degrade from the aesthetics
of a busy bar but it is a computationally efficient way to patch
around the concern.
2023-10-18 14:13:25 +08:00
bunnie
2d13e7c2a7 implement an underlying graphics primitive for a busy bar animation
This is just the TextView primitive with a "state" variable added
that controls how far the strips should march across the screen.

Users can specify with or without a bounding box.

The exact location of the text within the bar depends on the
BoundingBox option picked.

The primitive computes the total region to animate based upon
the typesetting engine's output. Thus it is not recommended
to "compress" the amount of whitespace allocated to the animation,
because it can cause the animation to have artifacts due to
whitespace overflow of typesetting.
2023-10-16 14:25:47 +08:00
Vihaan Jim
752642f62d Cleanup
I noticed that I actually hadn't changed anything in the xous-rs
directory, so I got rid of the patch. I also removed a few files
that weren't being used. Furthermore, I noticed that a couple of
random files were different from upstream so I changed them back.
I also modified the README slightly.
2023-10-15 15:55:25 -04:00
Vihaan Jim
0a7a4fcfc1 Merge branch 'main' of https://github.com/betrusted-io/xous-core 2023-10-14 14:45:50 -04:00
bunnie
6b98322754 fix invalid unwrap()
unwrap on a routine always returns None, so the unwrap() has no meaning
(probably originally introduced just as a way to get match arms to
have the same return result without thinking too much about it).
2023-10-12 02:45:43 +08:00
bunnie
d457f8b555 add assert around sleep_heap() discipline in ticktimer
Every entry into the sleep_heap() should be unique. Any insert()
call that returns a value means we're going to drop a wake-up event.

Add an assert()! that will trigger a panic if this invariant is not
met.
2023-10-10 22:22:30 +08:00
bunnie
bc18c7e629 port changes to cramium platform 2023-10-10 17:21:34 +08:00
bunnie
d63b5912b1 absorb new xous-rs version 2023-10-10 16:50:00 +08:00
bunnie
13e01fd823 corrections and improvements to the current PR
- set slack to 0
- change panic to advisory statement

reasons are commented in the code.
2023-10-10 16:35:53 +08:00
Sean Cross
18f3ac5507 xous-ticktimer: add back in mutex unlocking
Add back in the ability to pre-unlock a Mutex. This is used for slow
path unlocking without needing to wait for a response.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-10-09 19:27:42 +08:00
Sean Cross
c96514d365 xous-ticktimer: rewrite mutex and condvar implementations
This rewrites the Mutex and Condvar backends after gaining a better
understanding of how they're supposed to work.

Additionally, the Ticktimer backend implementation has changed:

* There is now a `recalculate_sleep_offline()` call that skips starting
  and stopping the ticktimer. This is an unsafe function because the
  user must manually manage the ticktimer state. It is used to perform
  multiple operations while the ticktimer is unscheduled.
* Ticktimers now deal in `TimerRequest` types rather than raw `i64`
  types. This is a newtype that is distinct from the previous `i64`, but
  should behave largely the same.
* Waking a Condvar now reports the number of items that were awoken,
  provided the requester sends a blocking scalar value. This allows for
  backwards compatibility.
* Attempting to wake 0 Condvars now wakes all pending Condvars.
* We no longer keep track of lock-then-unlock for Mutexes, nor
  notify-then-wait for Condvars. This makes those cases undefined
  behavior, which puts us in line with Posix. Don't unlock mutexes that
  haven't been locked, or notify Condvar recipients when nobody is
  waiting.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-10-09 17:41:46 +08:00
Vihaan Jim
e7445e1b62 Merge branch 'main' of https://github.com/betrusted-io/xous-core 2023-10-05 17:17:26 -04:00