a bunch of lines are shorter or different length now which
triggers a mandatory reformat. this patch cleans that up,
so that going forward the manual rework patches are clearer and
not tied up with formatting patches.
Rust can't tell how to cast some u32_le into u32/usize automatically
due to confusion with the num_derive trait, so we have to explicitly
specify a chain of typecasts to clean up the conflict with the
new rkyv
this does mean your device is notably less secure if you're operating
with usb serial turned on, as a host can just inject arbitrary commands
into your device!
verified to address the issue at least in a simple test case
1) drop repeated keys instead of panic-unwrapping
2) reduce key repeat rate to something more sane
In general, hosted mode is assumed "by default" if the target
is not Xous. This allows packages to be built cleanly on command
lines that don't know to pass a --feature flag to specify a target.
However, an explicit "hosted" flag is still retained so that we
can confirm the build system intent. This saves us from the failure
mode that we thought we were building for target A, but accidentally
ommitted the flag, and instead we've been silently building for
"hosted" mode without any warning. The main consumer of the "hosted"
flag is now just the build.rs script inside of the utralib.
This will allow for e.g. xous on riscv32-imac but not a precursor
target, for example: by using feature selectors we get to have
a bigger range of targets that we support, such as for implementations
that haven't been upstreamed or have official target-triples.
The downsides are:
- patch override libraries don't absorb feature flags. so, for
example, the AES crate that is used to patch other crates won't
be aware of the target features without modifying the referencing
crates.
- features are normally meant to be additive, but target features
are mutually exclusive. The mutex is enforced by a check in
utralib that throws a panic on build if two targets are accidentally
selected at the same time.
Adjust the connection number back to 4. There isn't a connection
made for a keyboard backlight server anymore. This is necessary
for root key initialization to proceed.
In general, if an enum has been explicitly numbered, it means
that there are crates that depend on the actual number assigned,
and changing them will break other crates.
This is done to allow for cross-compatibility reasons, for
example, going to a C FFI or to the standard library, where
we can't simply refer to a Rust crate to import the symbolic
enums and have the compiler figure out a consistent numbering
method.
Thus even though it's a bit "ugly", please assign only unused
numbers to new enums, and when old enums are retired, do not
re-use the number.
- Opcodes are mapped to static IDs
- connection ID is now visible to someone who already owns
the keyboard object. This can then be shared with the FFI
interface to do calls to the keyboard server.
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>
remaps keys based on the assumed keymap based on the user's
preference for the keyboard layout on the device.
So far, only dvorak and QWERTY are supported.
tts is working fairly well and much more stably, menus and ui
elements are wired up for tts.
just waiting for the latest braille keyboard pcb to come in and
then we'll be able to fire off some prototypes...
Keyboard setting is "the one and only" exception to user settings
that are saved without encryption. This is because you need your
keyboard layout to be set in order for you to type your password.
Thus, this needed a bit of a special-case to handle its storage record.
We decided to lop off 1 page from the loader and have it store
the keyboard layout code.
Let's hope we can have the discipline to really just store that
one word of information and not later be like "gee wally, you have
a whoooole 4092 unused bytes of space we can cram unencrypted
user settings in, sure would be a waste to not put those use those".