Commit graph

5949 commits

Author SHA1 Message Date
bunnie
4e027b676c remove logic from status primitive and make the interface simpler
- status bar text is just status bar text now
- idle animation runs/stops based on an explicit run/stop message

Note that at the moment if one starts the busy bar and a modal pops
up, you might overflow the queue of the ui drawing thread with animation
requests, because the thread blocks when the modal is summoned.

Modals "take the screen" anyways, so maybe the solution to this is
to add an additional interlock around any modal calls within the UI
main thread. Need to think about it a bit more.
2023-10-29 01:08:38 +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
4142549804 try to lay in some hooks for how to interact with the busy API
this is just an example, want to get this up for review before
debugging all the problems
2023-10-20 00:50:29 +08:00
bunnie
be39c44b17 add a stand-in initial startup message
This prompts users on how to raise the menu. Not sure if it's
the right thing, but it's something.
2023-10-20 00:48:10 +08:00
bunnie
b456bfaf3b add busy-wait animation server and hooks for managing the same
Busy-wait animaitions are handled by a helper server that is normally
blocked. A single shared `bool` indicates whether the animation should
run or not.

When woken up, the busy-wait animator will check if the shared `bool`
is set, and if so, send a message to the main loop to update
the animation, then send wait an appropriate timeout and send itself
a message to re-check the animation status.

This particular format of server is fairly compact but can be vulnerable
to a "message storm" if busy state updates happen in rapid
succession without allowing the server to unblock and handle messages.
Thus, all messages to this server use a `try_send` method, with a silent
failure if the message can't be sent. In other words, if the animator
is already super busy and its queue is full, don't send it more messages,
just drop the existing updates so we can fail without a panic or deadlock.
The typical consequence of this is some UX inconsistency, which is
not a critical error.
2023-10-20 00:43:09 +08:00
bunnie
355425726d add data structures to track status bar state
- status bar gets some initial text on boot
- previous status message is saved when entering a busy state,
and restored on exit
- add routines for hopefully making the redraw a bit more efficient
if the only thing happening is a busy-wait update.
2023-10-20 00:41:19 +08:00
bunnie
8401d924e0 add opcodes for updating status bar and running busy animations 2023-10-20 00:40:26 +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
367ca1c132
Merge pull request #441 from betrusted-io/busy-text
implement an underlying graphics primitive for a busy bar animation
2023-10-19 17:10:21 +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
6a3e9f1584 fix gfx dev target 2023-10-18 14:13:08 +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
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
67c2f36789 bump lockfile to match updated packages 2023-10-10 16:55:46 +08:00
bunnie
d63b5912b1 absorb new xous-rs version 2023-10-10 16:50:00 +08:00
bunnie
5d82630502 fix return bug in xous-rs
turns out we were testing against the published version on crates.io
the local version was irrelevant in previous tests.
2023-10-10 16:47:08 +08:00
bunnie
d53c78b472 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2023-10-10 16:43:14 +08:00
bunnie
0ec13e7d18
Merge pull request #425 from betrusted-io/ticktimer-refactor
Ticktimer refactor
2023-10-10 16:40:16 +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
bunnie
908312c7bf bump lockfile to track latest Cargo.toml 2023-10-09 18:25:46 +08:00
Sean Cross
c7c5a56a7d xous-rs: cache the current process ID
This value does not change, so cache it in order to reduce the number of
trips to the kernel.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-10-09 17:47:47 +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
Sean Cross
f5bfe28bd1 Merge branch 'main' of github.com:betrusted-io/xous-core 2023-10-05 11:27:11 +08:00
bunnie
83256257e1 bump xous-rs crate to absorb Send derives on Messages
this is necessary for the smoltcp port
2023-10-03 20:54:14 +08:00
bunnie
81a8720d1d
Merge pull request #419 from betrusted-io/smoltcp-port
let's get it into ci, it's passing all the local tests
2023-10-03 19:23:06 +08:00
bunnie
d330376fba update release notes 2023-10-03 19:12:49 +08:00
bunnie
765a3e6294 harden against invalid EC configurations
panics happen due to certain default states of the EC
wire protocol, due to a MAC address being passed in that is
not unicast when garbage data is present.
2023-10-03 19:12:15 +08:00
bunnie
c072b18df6 remove nettest from the default args 2023-10-03 18:43:38 +08:00
bunnie
3dda5b967b add notes about net-tests that are intermittent or failing but waiving 2023-10-03 18:39:50 +08:00
bunnie
2faa518df8 add debug level setting on net stack 2023-10-03 17:18:07 +08:00
bunnie
ee18cb8e14 passing most nettests now. mostly an issue of poking at loopbacks. 2023-10-03 17:12:34 +08:00
bunnie
c8b5ba40da temporarily move smoltcp to track git URL
this needs to stabilize once they tag out a release but for now
it cleans up the warnings.

will have to remember to do a cargo updae on that repository though
from time to time to get the latest code...
2023-09-29 14:01:29 +08:00
bunnie
e78b40aa36 cleanup the poll timeouts 2023-09-29 11:48:52 +08:00
bunnie
5e411f3562 clean up warnings, fix icmp init 2023-09-29 06:36:27 +08:00
bunnie
64e9248815 move smoltcp to latest; no hard errors, but also panics 2023-09-29 05:30:55 +08:00
bunnie
11b6ca1266 add Send trait to the xous Message type 2023-09-26 15:09:13 +08:00
bunnie
7e204604e9
Merge pull request #418 from nworbnhoj/chat
integrate tls trusted root_store into mtxchat
2023-09-26 11:02:18 +08:00
nworbnhoj
a89a344480 update mtxchat README.md 2023-09-25 21:10:35 +10:00
nworbnhoj
61c1747475 integrate tls trusted root_store into mtxchat
Set up tls with rustls::ClientConnection,
BUT - on Error::InvalidCertificate - then
probe the host for the untrusted certificate chain and prompt the user
to perhaps trust one of the certificates in the chain - then try again.
2023-09-25 11:22:47 +10:00
bunnie
e6c61455ba update PIO code for SoC integration
- add duart debug for bare iron testing
- add wait states on FIFO commits for when CPU clock is much
faster than PIO clock.

more wait states will be needed for correct operation in the
future
2023-09-22 22:19:32 +08:00
bunnie
b8125a5b1f add @xobs patch to get a local-only interface working
EC can talk to the emulated/fake network, but this network
does not have connectivity to the outside world.
2023-09-21 18:39:32 +08:00
bunnie
122febafea remove status from mtxcli 2023-09-20 22:13:33 +08:00
bunnie
08827633ac bring Chat dependencies up to date 2023-09-19 19:41:56 +08:00