Commit graph

2790 commits

Author SHA1 Message Date
Sean Cross
c1237ae023
Merge pull request #126 from qbit/bash
Switch to using env to find the path to bash.
2022-03-29 08:57:47 +08:00
Aaron Bieber
6f98940189 Switch to using env to find the path to bash.
Systems like OpenBSD and NixOS have bash in different locations. This
allows the various scripts to be run on those systems.
2022-03-28 16:43:47 -06:00
bunnie
aaa68def7d
Merge pull request #124 from alextibbles/buildfix
build fix for 5452fae33c
2022-03-29 05:29:53 +08:00
Alex Tibbles
f6030fe213
build fix for 5452fae33c 2022-03-28 17:01:25 -04:00
bunnie
5452fae33c harmonize blitstr2 and graphics-server to an i16 pixel representation
previously blitstr2 is using usize for x/y coords, which means that
for layout purposes points could not go to the top or left boundary
without causing arithmetic overflow. Of course, you want to render
everything on-screen, but, as we have multi-line text with overflow
possibility, it's reasonable to be able to use negative coordinates
to locate text boxes that flow into the visible region.

This of course means that occassionally you can come out with
things like "negative widths", but even then, there can be reasonable
uses for this as an intermediate in calculations that ultimately
arrive at a positive result.
2022-03-28 23:17:18 +08:00
bunnie
287aea90b6 bump to latest version of minifb 2022-03-28 17:49:03 +08:00
bunnie
290188f36b try to fix the gh automation 2022-03-28 15:49:22 +08:00
bunnie
6a7ac73034 Merge branch 'bunnie-dev' into main 2022-03-28 15:40:10 +08:00
bunnie
2da52a1d5c fix millis vs seconds bug in hosted mode 2022-03-28 15:39:42 +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
1130bda4a8 add a UX delay to help ensure redraw order when switching apps 2022-03-28 15:25:08 +08:00
bunnie
64ad28cb18 quiet down hosted mode debug messages 2022-03-28 14:44:05 +08:00
bunnie
83da511dc5 fix double redraw issue on menu close 2022-03-28 14:38:26 +08:00
bunnie
cbd36b269b Merge branch 'bunnie-dev' into main 2022-03-28 04:36:50 +08:00
bunnie
6fefd6cdf5 small tweak that makes hosted mode run a little more smoothly 2022-03-28 04:31:37 +08:00
bunnie
c79afd4220 make sure the directory is not deleted 2022-03-28 04:09:57 +08:00
bunnie
6cbc93f8de make sure the directory is not deleted 2022-03-28 04:09:19 +08:00
bunnie
aeef6f26f6 Merge branch 'bunnie-dev' into main 2022-03-28 04:04:55 +08:00
bunnie
c69b9e451d unbreak hosted mode 2022-03-28 04:04:38 +08:00
bunnie
ea6da8becd Merge branch 'bunnie-dev' into main 2022-03-28 03:41:25 +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
91ed8193a7 fix delete commands to sync and also make keyword ordering parallel 2022-03-28 03:37:04 +08:00
bunnie
ae0b1f1288 fix bug in dict delete.
also soften a journal fault message to help with debugging.
that it no longer panics does not mean it is right...
2022-03-28 03:36:27 +08:00
bunnie
18b7cf78df add some pddb delete routines 2022-03-28 01:55:39 +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
a7912b6296 fix a swap on pub/priv server to susres 2022-03-27 17:08:04 +08:00
bunnie
9555287273 remove a debug print 2022-03-27 17:07:48 +08:00
bunnie
ee4511c35d rework menu items and ordering
init for RTC shouldn't appear until keys are initialized and
PDDB has been mounted.
2022-03-27 16:45:22 +08:00
bunnie
2340686e80 rate limit error messages 2022-03-27 16:45:00 +08:00
bunnie
727135b347 throttle debug messages 2022-03-27 16:44:26 +08:00
bunnie
fc4a598a9b add a command to reset RTC after a PDDB format 2022-03-27 16:44:13 +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
340cd89661 update status to use the new RTC functions for time
Time is replaced with error messages that indicate either time has not
been set ("Set Time"), or the PDDB has not been mounted (it says
"Login?"), if there is an error. otherwise it displays time
in the local timezone.

Time setting is kind of awful in that you have to enter the time
as UTC. And then a timezone as an offset in hours from UTC. It's
very bare-iron.
2022-03-27 04:06:42 +08:00
bunnie
107c63f7c2 update RTC functions to use libstd 2022-03-27 04:06:26 +08:00
bunnie
4b25be75d5 fix bcd/binary conversion problems 2022-03-27 03:00:50 +08:00
bunnie
1617200cb6 remove the RTC "reach-around" cheat inside shellchat's test routine
The test routine for shellchat "cheats" and accesses the I2C block
to test the RTC during factory operations. This is not aesthetic
and is also potentially a security hole since we don't want less
trusted stuff willy-nilly playing with i2c.

Rewrite to

1) remove i2c references from shellchat
2) replace RTC calls with the newer non-dangerous llio calls that are
limited to read out the initialized time variables.
2022-03-27 02:56:41 +08:00
bunnie
515d49db08 add a sync operation after every write
I did observe some PDDB corruption that happened today that looks
ostensibly linked to a record that didn't sync up with the disk,
so, let's be safer and sync everything. We can work on optimizing
performance after correctness is guaranteed.
2022-03-27 02:55:19 +08:00
bunnie
a103536b58 add a non-blocking mount poller to the PDDB
The problem with the current is_mounted() call is that it blocks
while the PDDB is requesting a password or actively formatting
(otherwise it doesn't block). It's actually just...partially blocking.

That doesn't cut it for libstd-linked system services that need to run but
before the PDDB comes up. In particular, we need to be able to respond
to time queries *somehow*, even before our timezone and offsets are
loaded from the PDDB.

I considered doing a callback mechanism for mounting, but this
is kind of complex and probably not worth it. Instead, a separate
thread that can return the value of a single boolean revealing
the mount state of the PDDB is created, and you can create an
object that's capable of inspecting that boolean.
2022-03-27 02:52:29 +08:00
bunnie
a6af300157 don't repeat the menu key if it is press-held 2022-03-27 00:19:55 +08:00
bunnie
96f0a0d2ea add the actual thread to the code base and clean up some warnings.
Next up:
 - code up libstd glue
 - code up test cases
2022-03-26 02:42:42 +08:00
bunnie
b59e2ae2bf add reference to the time server.
We still need to *start* the thread, ya know...
2022-03-26 02:37:30 +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
df96ca1429 test for libstd Instant 2022-03-26 02:35:59 +08:00
bunnie
319e0e0641 add a comment about not modifying ticktimer APIs due to libstd dependency 2022-03-26 02:35:38 +08:00
bunnie
91d0511fa4 add Seek trait to the PDDB 2022-03-26 02:34:57 +08:00
bunnie
86ab8c392d add libstd time handler glue stubs 2022-03-26 02:34:38 +08:00
bunnie
2bf0b685cd add a response code for dictionary not found 2022-03-26 00:06:01 +08:00
bunnie
0abd4a1db6 add a response code for dictionary not found 2022-03-25 23:50:26 +08:00
bunnie
cda15a1bb3 add a routine to convert hw RTC to a seconds count. 2022-03-24 18:44:06 +08:00