fix up warnings and latest cargo.toml

This commit is contained in:
bunnie 2022-03-10 15:33:14 +08:00
parent 71d9cc38af
commit 80a835ba83
3 changed files with 26 additions and 10 deletions

14
Cargo.lock generated
View file

@ -637,13 +637,13 @@ dependencies = [
[[package]]
name = "curve25519-dalek"
version = "3.1.0"
source = "git+https://github.com/betrusted-io/curve25519-dalek.git?branch=main#c0ee5bf18c606b51bbffb02fde5801ac129b4e7d"
version = "3.2.1"
source = "git+https://github.com/betrusted-io/curve25519-dalek.git?branch=main#ec0fe92578bba6dd47457a9bb8287deb48432ce1"
dependencies = [
"byteorder",
"digest",
"engine-25519",
"engine25519-as 0.1.0 (git+https://github.com/betrusted-io/engine25519-as.git?rev=6681e73c1fdc4a460b5ef9f9c7c91aef546d00f3)",
"engine25519-as",
"log",
"rand_core 0.5.1",
"subtle",
@ -764,7 +764,7 @@ dependencies = [
name = "engine-25519"
version = "0.1.0"
dependencies = [
"engine25519-as 0.1.0 (git+https://github.com/betrusted-io/engine25519-as.git?rev=274b82899d28535ac6d4b7869e26eef2039578d5)",
"engine25519-as",
"llio",
"log",
"log-server",
@ -784,11 +784,6 @@ name = "engine25519-as"
version = "0.1.0"
source = "git+https://github.com/betrusted-io/engine25519-as.git?rev=274b82899d28535ac6d4b7869e26eef2039578d5#274b82899d28535ac6d4b7869e26eef2039578d5"
[[package]]
name = "engine25519-as"
version = "0.1.0"
source = "git+https://github.com/betrusted-io/engine25519-as.git?rev=6681e73c1fdc4a460b5ef9f9c7c91aef546d00f3#6681e73c1fdc4a460b5ef9f9c7c91aef546d00f3"
[[package]]
name = "enum_dispatch"
version = "0.3.7"
@ -1423,6 +1418,7 @@ dependencies = [
"rkyv",
"ticktimer-server",
"trng",
"tts-frontend",
"utralib",
"xous",
"xous-ipc 0.9.7",

View file

@ -18,10 +18,12 @@ xous-ipc = { path = "../../xous-ipc" }
rkyv = {version = "0.4.3", features = ["const_generics"], default-features = false}
gam = {path="../gam"}
trng = {path="../trng"}
tts-frontend = {path="../tts"}
[target.'cfg(not(any(windows,unix)))'.dependencies]
utralib = { path = "../../utralib"}
[features]
ux_tests = []
tts = []
default = []

View file

@ -14,6 +14,8 @@ use std::sync::{Arc, Mutex};
use std::thread;
use gam::modal::*;
#[cfg(feature="tts")]
use tts_frontend::TtsFrontend;
use num_traits::*;
@ -72,6 +74,9 @@ fn xmain() -> ! {
let renderer_sid = xous::create_server().expect("couldn't create a server for the modal UX renderer");
let renderer_cid = xous::connect(renderer_sid).expect("couldn't connect to the modal UX renderer");
#[cfg(feature="tts")]
let tts = TtsFrontend::new(&xns).unwrap();
let op = Arc::new(Mutex::new(RendererState::None));
// create a thread that just handles the redrawing requests
let _redraw_handle = thread::spawn({
@ -127,6 +132,8 @@ fn xmain() -> ! {
match *mutex_op {
RendererState::RunText(config) => {
log::debug!("initiating text entry modal");
#[cfg(feature="tts")]
tts.tts_simple(config.prompt.as_str().unwrap()).unwrap();
renderer_modal.modify(
Some(ActionType::TextEntry(text_action)),
Some(config.prompt.as_str().unwrap()), false,
@ -136,6 +143,8 @@ fn xmain() -> ! {
log::debug!("should be active!");
},
RendererState::RunNotification(config) => {
#[cfg(feature="tts")]
tts.tts_simple(config.message.as_str().unwrap()).unwrap();
renderer_modal.modify(
Some(ActionType::Notification(notification)),
Some(config.message.as_str().unwrap()), false,
@ -150,7 +159,8 @@ fn xmain() -> ! {
config.current_work, start_work, end_work);
log::debug!("init percentage: {}, current: {}, start: {}, end: {}", last_percentage, config.current_work, start_work, end_work);
progress_action.set_state(last_percentage);
#[cfg(feature="tts")]
tts.tts_simple(config.title.as_str().unwrap()).unwrap();
renderer_modal.modify(
Some(ActionType::Slider(progress_action)),
Some(config.title.as_str().unwrap()), false,
@ -167,6 +177,8 @@ fn xmain() -> ! {
radiobuttons.add_item(*item);
}
fixed_items.clear();
#[cfg(feature="tts")]
tts.tts_simple(config.prompt.as_str().unwrap()).unwrap();
renderer_modal.modify(
Some(ActionType::RadioButtons(radiobuttons)),
Some(config.prompt.as_str().unwrap()), false,
@ -183,6 +195,8 @@ fn xmain() -> ! {
checkbox.add_item(*item);
}
fixed_items.clear();
#[cfg(feature="tts")]
tts.tts_simple(config.prompt.as_str().unwrap()).unwrap();
renderer_modal.modify(
Some(ActionType::CheckBoxes(checkbox)),
Some(config.prompt.as_str().unwrap()), false,
@ -193,10 +207,14 @@ fn xmain() -> ! {
RendererState::RunDynamicNotification(config) => {
let mut top_text = String::new();
if let Some(title) = config.title {
#[cfg(feature="tts")]
tts.tts_simple(title.as_str().unwrap()).unwrap();
top_text.push_str(title.as_str().unwrap());
}
let mut bot_text = String::new();
if let Some(text) = config.text {
#[cfg(feature="tts")]
tts.tts_simple(text.as_str().unwrap()).unwrap();
bot_text.push_str(text.as_str().unwrap());
}
renderer_modal.modify(