Commit graph

149 commits

Author SHA1 Message Date
bunnie
1b25f4c11d fix hosted mode 2022-04-06 13:38:44 +08:00
bunnie
33d8275321 refactor I2C to use deferred message responses instead of busy waits
This is a start on issue #111, where instead of starting a throw-away
server and doing a "yield" loop to emulate blocking behavior, messages
are instead stored so they don't drop, thus keeping a blocking
message blocking.
2022-04-06 03:35:43 +08:00
bunnie
c503316c3d refactor suspend/resume ordering
Add a "Later" stage, and have exactly one "Last" stage.

"Last" to suspend is the ticktimer -- this is crucial for
basically everything else to work. The other really
low level stuff that needs to work to the last minute is
now in the "Later" bin.
2022-03-30 02:30:39 +08:00
bunnie
da89a61a28 retire work around for rust issue 90195 in I2C 2022-03-29 16:24:14 +08:00
bunnie
2da52a1d5c fix millis vs seconds bug in hosted mode 2022-03-28 15:39:42 +08:00
bunnie
c69b9e451d unbreak hosted mode 2022-03-28 04:04:38 +08:00
bunnie
c78273f540 refactor time setting to make a little more sense
now you set time in local time. If time zone hasn't been set already,
it'll prompt you to enter a time zone.

The main oddity is now that you have to know your time zone as
an offset from UTC. This can be fixed later with a proper symbolic
TZ to numeric mapping, but, that's actually a surprisingly hard
feature to implement.
2022-03-28 03:37:27 +08:00
bunnie
ed8f4d71cf fix suspend/resume issue with RTC (forgot to mask out bits on control register) 2022-03-28 01:19:02 +08:00
bunnie
ee695d0181 turn off time init check after it returns true
this reduces a bit of message chatter for a call that may be
called quite frequently.
2022-03-27 17:08:16 +08:00
bunnie
2340686e80 rate limit error messages 2022-03-27 16:45:00 +08:00
bunnie
2751aa03d3 add a localtime server plus other annotations
std::time::SystemTime returns time in UTC.

That's great, but a lot of times we want local time.

Unfortunately, we can't use `chrono` to do that, because
chrono figures out what your time zone is usind `libc`, which
is a thing Xous doesn't have.

the `LocalTime` server is Xous' solution to that problem. it
returns the corret time offset based on the time zone.

You can still use `chrono` to convert the returned time into
strings and to compute durations.
2022-03-27 04:08:36 +08:00
bunnie
4b25be75d5 fix bcd/binary conversion problems 2022-03-27 03:00:50 +08:00
bunnie
4ac38027a2 add function to return the hardware RTC value as u64
the u64 in and of itself is meaningless, without the context
from the PDDB that adds the offset to wall clock time plus
time zone. This is glued together by the time.rs stub inside
the status service.
2022-03-26 02:36:35 +08:00
bunnie
cda15a1bb3 add a routine to convert hw RTC to a seconds count. 2022-03-24 18:44:06 +08:00
bunnie
92f1552d94 Merge branch 'main' into bunnie-dev 2022-03-24 03:32:36 +08:00
bunnie
0bcc93c78e attempt to add persistent storage to hosted mode PDDB
This will create a 100MiB file in tools/ppdb-images/hosted.bin
(sorry!!) which is persistent storage for hosted mode.

Delete the file if you want to start over from scratch.

It's...pretty brittle. I expect problems, but maybe it will at
least get things moving.
2022-03-24 03:21:00 +08:00
bunnie
bfb8a17cd5 strip out legacy RTC calls in preparation for refactor 2022-03-24 02:19:26 +08:00
bunnie
b4c98528e8 add notes around names that are baked into libstd 2022-03-22 22:30:43 +08:00
bunnie
84086c6d47 quiet a warning from tts mode 2022-03-18 19:39:25 +08:00
bunnie
02ab71f195 quiet a warning from tts mode 2022-03-18 19:39:00 +08:00
bunnie
0f9ea0473a add sleep/resume indicator for the blind 2022-03-17 17:56:42 +08:00
bunnie
21ad8d9283 change en-audio to en-tts 2022-03-10 15:38:55 +08:00
bunnie
960745ca61 eliminate static mut unsafe pattern in callback function storage
since xous 0.9.5, we've had a Box and we've had threads, so now we
can put the callback in a Box and pass it to a thread, instead
of relying on an `unsafe` work-around to get the callback function
pointer into the thread's environment.
2022-02-19 01:38:20 +08:00
bunnie
e4db83e59e add a "public" RTC get command to the LLIO
This implemnetation takes advantage of the fact that the LLIO
owns the RTC device, and bypasses a layer of indirection in the
call chain.
2022-02-19 01:16:20 +08:00
bunnie
95b857feea refactor i2c interface to eliminate static mut unsafes
also remove async write callbacks: in practice, these aren't used

Downside of this refactor is that threads for handling the
callbacks are not spawned on demand, they are spawned at boot,
leading to about an extra 68k of RAM used (most of it being
consumed in the codec block, actually). Some of this is also
probably extra object code because we're using more of the stdlib
primitives, which carry some weight.
2022-02-19 00:31:25 +08:00
bunnie
0bd8a97f63 fix refcount implementation i2c block 2022-02-18 19:04:04 +08:00
bunnie
c86df3d095 fix logic bug in usb lock status update 2022-02-06 01:31:08 +08:00
bunnie
06b9f88926 improve test oqc interface with new API 2022-02-04 17:11:42 +08:00
bunnie
5c91645ede Merge branch 'i18n-jp' into bunnie-dev 2022-02-01 01:04:43 +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
Jeanie
58e8120526 ja translations added 2022-01-30 19:23:49 +09:00
bunnie
5a1139a367 move cache flush on susres to just before the suspend event
- also nail down the interrupt handlers from firing from the COM
during suspend
- ensure that connects don't happen while scanning
2022-01-27 22:05:38 +08:00
bunnie
0cafd10e28 refactor status bar to take advantage of the new fonts 2022-01-22 18:25:39 +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
b161b021fe stop pump updates while we're doing the RTC setting
The RTC set dialog box is blocking, the pump will eventually
lock up the system if we don't stop it.

nb: ~200k saved in RAM with the refactor
2022-01-11 16:19:31 +08:00
bunnie
4f638bb49a massive refactor to eliminate the RTC crate
Saves a bit on resources and the RTC crate doesn't need
to be stand-alone now that the modals crate is a thing;
we are able to split the UX routine to manage the RTC out
of the code that actually manages the hardware.

The hardware code ended up in LLIO, and the UX ended up in the status
routine.
2022-01-11 15:45:20 +08:00
bunnie
994e3d7cfb refactor llio crate (phase 1): organize files into sub-systems 2022-01-11 12:02:27 +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
c5fe1bc99b add sequencing to suspend/resume order of operations
this is necessary because we want to make sure that the SPINOR
service does not shut down before the PDDB service finishes syncing
its disks.
2022-01-10 13:45:56 +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
a4a2d12d57 refactoring the order of format events; consolidate fscb init op
try to condense ops that we anticipate calling in other places
into helper functions.

add AAD to the fscb.
2021-11-09 04:57:12 +08:00
bunnie
6f522b0844 tag Rust issue onto a wart in the LLIO API crate for better tracking 2021-11-01 04:18:53 +08:00
bunnie
65bad96f52 fix killbounce & formatting
sleep killbounce wouldn't work because we started limiting the
number of connections to the LLIO.

This change makes connections to the LLIO unlimited, but perhaps later
on we should split out the I2C bus into a separate security domain,
so that the LLIO's unlimited connection policy doesn't introduce a
risk into a rogue process being able to overwrite the RTC contents.
2021-10-30 02:14:31 +08:00
bunnie
7de925d3f1 add maintenance notes around the fix for https://github.com/rust-lang/rust/issues/90195 2021-10-23 17:50:33 +08:00
bunnie
c245e78255 Merge remote-tracking branch 'origin/main' into bunnie-dev 2021-10-23 17:45:24 +08:00
Sean Cross
adccb61e43 services: llio: work around rkyv bug in rust 1.56
A bug in the type system appeared that prevents using constants in rkyv
arrays. Hardcode the value instead.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-10-23 17:25:41 +08:00
bunnie
ec538025a8 changes to bring us up to date with rust 1.56. still not building. 2021-10-23 17:08:48 +08:00
bunnie
daebf17a5e Merge branch 'bunnie-dev' into main
Probably about time to push some of this net stuff into main, even
though it's got a ways to go. This adds UDP/ICMP/DNS to the net stack,
but the ping probably needs to be refactored a bit to be *much simpler*
and more reliable, and there's some corner cases to chase.
2021-10-22 04:10:33 +08:00