Commit graph

303 commits

Author SHA1 Message Date
nworbnhoj
d33d7958f2 Merge branch 'main' of github.com:nworbnhoj/xous-core into main 2022-06-17 23:08:37 +10:00
nworbnhoj
148e0fdd99 remove unnecessary Img clone 2022-06-17 23:06:39 +10:00
nworbnhoj
346847104a
Merge branch 'betrusted-io:main' into main 2022-06-17 21:17:52 +10:00
nworbnhoj
39815cc596 fix gam::Tile render RHS 2022-06-17 21:16:25 +10:00
bunnie
cf89ebe5f5 add wrapper around main functions that need bigger stacks
This allows for `ditherpunk` config to have a much larger
stack size on select processes only.

The cost comes at a 4k fixed overhead for the sacrificial
wrapper thread, so we lose about 20k of runtime RAM, even
when ditherpunk is *not* activated (because we're
always wrapping the threads).

There is no impact on scheduling or CPU utilization, as the
wrapper thread blocks and is never scheduled once the real
main starts. However, it does subtract one thread from the
total available thread pool.
2022-06-16 03:40:19 +08:00
bunnie
b31c727f81 clean up some warnings 2022-06-15 03:55:03 +08:00
bunnie
02a097d0c4 comment out autoscale/rotate
the code seems to not work with images that are actually smaller
than the frame buffer, and for now, our images are smaller
2022-06-15 01:29:24 +08:00
bunnie
81961b20a2 fix issue with title bar creeping in on image modals 2022-06-15 01:28:59 +08:00
bunnie
1bd82b9ea4 try to debug why images aren't showing up 2022-06-14 19:06:33 +08:00
bunnie
dbd7ad1770 fix warning on ditherpunk test routine 2022-06-14 17:09:26 +08:00
bunnie
fc8e5df2b1 Merge remote-tracking branch 'origin/dither2' into dp2-merge 2022-06-14 16:45:38 +08:00
nworbnhoj
5be713d09e rustfmt modals tests 2022-06-14 16:19:02 +10:00
nworbnhoj
dda78b4ef3 implement clifford attractor as modal test image 2022-06-14 10:09:01 +10:00
nworbnhoj
6dfed76b66 remove dither crate dependency from modal tests 2022-06-14 05:16:50 +10:00
nworbnhoj
0bf71b84c1 implement gam Bitmap Dither
- remove depencency on dither crate
- Burkes diffusion scheme
2022-06-14 04:27:04 +10:00
bunnie
e32ea4d3f5 fix #174 2022-06-10 21:36:53 +08:00
bunnie
0830513ef1 debugging for dynamic resize issue 2022-06-07 16:42:10 +08:00
bunnie
ebd4e7a1ba improve dynamic notifications / kbhit reporting 2022-06-06 03:46:57 +08:00
bunnie
2161771b09 fix keyboard listener on dynamic notifications 2022-06-05 01:45:25 +08:00
nworbnhoj
f7395ae0d5 add example of jpeg decoding 2022-06-04 21:18:54 +10:00
nworbnhoj
069b54f86b rustfmt modals api 2022-06-04 16:54:22 +10:00
nworbnhoj
8deb266c45 remove image crate dependency from modals 2022-06-04 16:54:08 +10:00
nworbnhoj
beb2778ce6 implement gam bitmap.rotate90() 2022-06-02 14:23:09 +10:00
bunnie
da06d95acd add a deferred listener for keyboard events from a dynamic notification 2022-06-01 22:31:44 +08:00
bunnie
59550978f4 fix warnings that have cropped up for transition to 2021 edition 2022-06-01 11:54:24 +10:00
Sean Cross
d342d7a885 apps/services: remove xous::xous_main macro usage
This macro will be removed, since it is no longer necessary. Remove this
macro across the project and replace it with a standard `main()`
function.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-01 11:54:24 +10:00
bunnie
98289b1405 fix warnings that have cropped up for transition to 2021 edition 2022-05-31 14:38:41 +08:00
Sean Cross
3ae9d8abf0 apps/services: remove xous::xous_main macro usage
This macro will be removed, since it is no longer necessary. Remove this
macro across the project and replace it with a standard `main()`
function.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-31 13:33:30 +08:00
bunnie
116015dff8 fixups and debug 2022-05-27 22:45:23 +08:00
bunnie
05f705a931 prove that we've restored ditherpunk functionality to hosted mode
this basically brings us back to the point of the original PR,
but with the code being optional.
2022-05-27 18:05:36 +08:00
bunnie
a8e7809087 fixup feature fest 2022-05-27 17:41:22 +08:00
bunnie
7d020182d4 integrate ditherpunk as a feature 2022-05-27 17:28:15 +08:00
nworbnhoj
342e8e82b1 implement shellchat test modals
remove modals feature ux_tests
2022-05-25 10:29:21 +10:00
nworbnhoj
f19b2ac939 implement auto size rotate & center for Image Modal 2022-05-24 12:08:07 +10:00
nworbnhoj
ba1f9d017a exclude troublesome features from dither crate 2022-05-22 14:17:11 +10:00
nworbnhoj
7f66291a38 implement Image modal
Now you can:
let mut input = std::env::current_dir().unwrap();
input.push("../services/modals/src/tests/bunny.png");
let img = Img::<RGB<u8>>::load(&input).unwrap();
modals.show_image(img).expect("image failed");
2022-05-21 06:42:27 +10:00
nworbnhoj
dd1ce051d1 refine qrcode handling
- expand max text.len to 4096
- throw error on overrun
- simplify qrcode rendering (reduced memory & math)
- correct module size by 1px
2022-05-08 10:00:41 +10:00
bunnie
f8246b14f5 run rustfmt on the modals crate 2022-04-24 21:40:42 +08:00
bunnie
547783d195
Merge pull request #150 from nworbnhoj/qrcode
enable notification modal text + qrcode
2022-04-24 21:36:38 +08:00
bunnie
62d56fb70b
Merge pull request #149 from nworbnhoj/index
modal selected index support
2022-04-24 21:27:08 +08:00
nworbnhoj
0e561802ce enable notification modal text + qrcode
change the notification modal to accept the primary message and an
Option of independent text to display as a qrcode

pub fn show_notification(&self, notification: &str, qrtext:Option<&str>) -> Result<(), xous::Error> {}
2022-04-24 21:29:15 +10:00
nworbnhoj
2070236695 minor refinements requested on PR 2022-04-24 20:09:43 +10:00
nworbnhoj
e879ff4b17 modal selected index support
Support for:
- obtaining the index of the selected radiobutton & checkbox
- adding a Vec<&str> of items
2022-04-24 08:28:02 +10:00
bunnie
dd462aebb2 remove trailing/open white spaces 2022-04-22 15:54:43 +08:00
bunnie
2c3143f790 Merge branch 'main' into multi-text-modals 2022-04-22 15:54:18 +08:00
bunnie
bac6c25bfe conversion toward standard testing method 2022-04-22 15:10:51 +08:00
Gianguido Sorà
d06c6dcb32 modals: refuse to build modal if no fields have been provided 2022-04-13 16:59:17 +02:00
Gianguido Sorà
0c17bb6e34 modals: get rid of fields_amt value in alert modal builder, can be inferred 2022-04-13 16:57:36 +02:00
Gianguido Sorà
89c768625d modals: add builder-based interface to present alerts with text fields inside 2022-04-13 15:49:31 +02:00
bunnie
3f962b6bb0 make progress updates fail gracefully on server queue full
Progress updates can come at a right too high for the renderer
to keep up, so instead of deadlocking, we discard update messages
that are too frequent.
2022-04-08 18:55:56 +08:00
bunnie
3ef2dae2f0 revert test config and make chinese text also render qr code 2022-04-08 16:05:42 +08:00
bunnie
b4dad54315 fix missing unlock() statement at end of modals 2022-04-08 15:58:59 +08:00
bunnie
fb4ce334c4 missed an instance in a demo app 2022-04-08 15:27:40 +08:00
bunnie
cd8c762c55 patch up QR code PR, change method signature as discussed
now any modal notification can also render as a QR code
2022-04-08 15:19:56 +08:00
bunnie
679fde33a7
Merge pull request #137 from nworbnhoj/qrcode
add as_qrcode to Notification modal
2022-04-08 14:28:26 +08:00
nworbnhoj
8c5c2228d2 Merge branch 'main' into qrcode 2022-04-08 16:22:19 +10:00
nworbnhoj
2a957e55cd add as_qrcode to Notification modal 2022-04-08 14:16:15 +10:00
Gianguido Sorà
ec9fdb0e42 make text entry work
pro tip: make sure your types are synchronized between Buffer calls!
2022-04-07 17:05:19 +02:00
Gianguido Sorà
8dd41a1ffa adapt interface to newer modals 2022-04-07 16:39:16 +02:00
Gianguido Sorà
8123393a7d Merge branch 'main' into feature/multi-text-modals 2022-04-07 16:39:03 +02:00
bunnie
28de1b27a6 add some documentation to modals 2022-04-07 14:24:10 +08:00
bunnie
c97a00ed1f refactor validator to not create a new single-use server 2022-04-07 04:38:38 +08:00
bunnie
f720f3175c refactor main loop to use deferred responses
I think things could be compactified even further, but this is a
first-step "merge the threads and break as few things as possible"
pass. Would like to get @gsora's multi-line boxes merged into this
new system before doing even more optimization.
2022-04-07 04:04:37 +08:00
bunnie
360e50a8bb refactor locking to use deferred responses 2022-04-07 02:19:37 +08:00
Gianguido Sorà
5c975fdee4 make single-field modals accept a placeholder 2022-04-05 16:28:58 +02:00
Gianguido Sorà
ba347f6c79 add placeholders, current selection highlight 2022-04-05 16:18:43 +02:00
Gianguido Sorà
0b62a2657a feature: generalization of modals.get_text()
Added a get_text_multi() method on modals which builds, shows and returns text taken from a modal view with a given amount of fields.

Calling get_text() is equal to a call to get_text_multi() with fields = 1.
2022-03-31 19:24:53 +02:00
Gianguido Sorà
83e61f5f1b feat: add wiring for multiple TextEntryPayloads drawing 2022-03-31 17:54:22 +02:00
bunnie
29dab322ed add some comments on the modals tests. 2022-03-30 03:40:11 +08:00
bunnie
bd78ba94f1 refactor time setting modals into a separate thread
modals don't work when triggered in the status thread in hosted
mode (but they do, somehow, on real hardware). I think this
is an actual locking problem that would exhibit itself if
we had a true multiprocessor system, but since real hardware
is a single processor it doesn't show.
2022-03-28 15:25:43 +08:00
bunnie
6fefd6cdf5 small tweak that makes hosted mode run a little more smoothly 2022-03-28 04:31:37 +08:00
bunnie
7b45241f2a cleanup a warning when not in tts mode 2022-03-11 18:39:10 +08:00
bunnie
9f6e444e3f back out testing structures 2022-03-10 23:45:49 +08:00
bunnie
33c25b0804 add TTS translations strings for describing modal meta-actions 2022-03-10 23:44:56 +08:00
bunnie
e8b13fcb44 integrate TTS into more dialog boxes and modals
also tighten up the `blocking` method for TTS for prompts that
absolutely should not be truncated or overriden.
2022-03-10 23:40:35 +08:00
bunnie
80a835ba83 fix up warnings and latest cargo.toml 2022-03-10 15:33:14 +08:00
bunnie
b4a34bd9ec add busy-wait queuing for alerts in case multiple alerts pop up
this case happens when e.g. you're asking for a password but
then the connection manager throws an error.
2022-02-05 02:03:56 +08:00
bunnie
08421999ad part-way through a refactor of trust levels to prevent alerts from popping over password boxes 2022-02-04 23:59:20 +08:00
bunnie
b35f2a1d3e catch and handle fat-finger UX events better
they used to panic, now they just print a warning
2022-02-04 18:22:17 +08:00
bunnie
827888ccbb fix up the REFCOUNT on connections
Was doing disjoint loads and stores on an Atomic, really, should
be using the fetch_add, fetch_sub variants to be proper.

Didn't seem to impact anything but maybe there's a future version
of me that high fives me for doing this.
2022-01-31 23:13:10 +08:00
bunnie
6653d42114 cleanup UX context registry
it's now a much smaller nightmare to maintain the registry, as all
the items are concentrated into a single location
2022-01-23 14:31:21 +08:00
bunnie
747891eaad clean up some minor details on UX formatting 2022-01-22 01:51:02 +08:00
bunnie
2642e6c075 various UX fixes that take advantage of the new font rendering engine 2022-01-22 00:10:31 +08:00
bunnie
0677753680 it's not a flaming mess anymore, but still a lot more tuning to do 2022-01-21 02:35:46 +08:00
bunnie
356d95a266 yet another refactor of the word wrapping
Really clear up the roles and structures of word wrapping.

Significantly, we have now figured out that the word wrapper
should be the word wrapper, and that the text bounds should
be computed by a text bounds computation.

Conflating flexible text bounds with word wrapping makes
the math really hard.

So, the word wrapper always works with a bounding area starting
at 0,0, and will wrap until it hits a Point designated as its
absolute max bounds.

The returned typeset block is referenced to 0,0, and then it
is shifted to the correct location by the rendering function.

This externalizes the computation of the final location plus
the rendering bounds to the outer functions that need to care
about this, thus simplifying the word wrapper significantly.
2022-01-20 18:30:13 +08:00
bunnie
18130cddae fix suspend/resume regression
had to pin down the correct order of events to avoid lockups on suspend
2022-01-17 22:46:18 +08:00
bunnie
2c711036a9 add a submenu for PDDB operations 2022-01-17 01:59:38 +08:00
bunnie
a8d7c7e9e2 cleann up the oqc test 2022-01-12 02:01:33 +08:00
bunnie
b3788a54af clarify the dependency policy 2022-01-10 16:50:10 +08:00
bunnie
995915ed4e nail down a couple more dependencies, and add a policy note to Cargo.toml
Each Cargo.toml now includes a comment which remnids maintainers
of the dependency policy for Xous (that is, nail down every dependency
to the minor number).
2022-01-10 15:54:27 +08:00
bunnie
dd943c5416 pin down versions and harmonize versions across servers
Versions are pinned down to the minor number. Yes, this means that
we don't automatically pull in features and bug updates from crates.io,
but it also means we don't pull in new attack surfaces and code that
hasn't been tested or reviewed. I'd like this process to be very deliberate
and not automatic for Xous.

The `rand` crate is almost pinned down to a single version, except
for an odd dependency that's pulled in by hosted mode that depends
on rand 0.8.4 via a subordinate dependency via the `tempfile` crate.
Pondering if it's worth it to try and eliminate that, because the
0.8.4 version doesn't get compiled into any version that touches
real hardware. It just makes it harder to analyze the Cargo.lock
file, mostly. I think I'll leave it as-is.
2022-01-10 15:39:55 +08:00
bunnie
489a26dd11 fix an issue where we don't decrement the connection counter on drop 2022-01-05 20:01:54 +08:00
bunnie
55abbd3f3e fix bugs in progress bar computation 2022-01-04 21:57:09 +08:00
bunnie
8c66e04bc3 refactor RTC module to use modals server 2021-12-17 02:49:38 +08:00
bunnie
725d943198 add interlocking so multiple threads don't interfere with each other 2021-12-17 01:55:36 +08:00
bunnie
0fb1bea428 add radio buttons and checkboxes to the modals meta-handler 2021-12-17 00:32:44 +08:00
bunnie
44453bcbde refactor checkboxes and radiobuttons to use dynamically allocated lists 2021-12-16 23:16:21 +08:00
bunnie
60fc03351a add progress bar primitives 2021-12-16 21:39:49 +08:00
bunnie
4a0f062558 add notification api 2021-12-16 02:28:37 +08:00
bunnie
dcad15284d refactor tests into a separate file 2021-12-16 01:48:11 +08:00
bunnie
2ddbc224b2 check in to swap branches 2021-12-15 14:08:38 +08:00
bunnie
f3f3e677d2 turn the validator error message into a newtype
this allows us to fine-tune the error message static size parameter
later on more easily
2021-12-15 13:53:53 +08:00
bunnie
e48c472b32 helps to add the code for the new service 2021-12-15 13:46:43 +08:00