mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
fix minor bugs in rtc set routine
This commit is contained in:
parent
e60478d8d3
commit
f5a9cce4ac
2 changed files with 20 additions and 14 deletions
|
|
@ -590,7 +590,7 @@ fn imef_cb(s: String::<4000>) {
|
||||||
#[xous::xous_main]
|
#[xous::xous_main]
|
||||||
fn xmain() -> ! {
|
fn xmain() -> ! {
|
||||||
log_server::init_wait().unwrap();
|
log_server::init_wait().unwrap();
|
||||||
log::set_max_level(log::LevelFilter::Debug);
|
log::set_max_level(log::LevelFilter::Info);
|
||||||
info!("my PID is {}", xous::process::id());
|
info!("my PID is {}", xous::process::id());
|
||||||
|
|
||||||
let xns = xous_names::XousNames::new().unwrap();
|
let xns = xous_names::XousNames::new().unwrap();
|
||||||
|
|
@ -785,7 +785,7 @@ fn xmain() -> ! {
|
||||||
canvas.do_drawn().expect("couldn't set canvas to drawn");
|
canvas.do_drawn().expect("couldn't set canvas to drawn");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
info!("attempt to draw TextView on non-drawable canvas. Not fatal, but request ignored. {:?}", tv);
|
log::debug!("attempt to draw TextView on non-drawable canvas. Not fatal, but request ignored. {:?}", tv);
|
||||||
let ret = api::Return::NotCurrentlyDrawable;
|
let ret = api::Return::NotCurrentlyDrawable;
|
||||||
buffer.replace(ret).unwrap();
|
buffer.replace(ret).unwrap();
|
||||||
}
|
}
|
||||||
|
|
@ -868,7 +868,7 @@ fn xmain() -> ! {
|
||||||
}
|
}
|
||||||
canvas.do_drawn().expect("couldn't set canvas to drawn");
|
canvas.do_drawn().expect("couldn't set canvas to drawn");
|
||||||
} else {
|
} else {
|
||||||
info!("attempt to draw Object on non-drawable canvas. Not fatal, but request ignored: {:?}", obj);
|
log::debug!("attempt to draw Object on non-drawable canvas. Not fatal, but request ignored: {:?}", obj);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
info!("bogus GID in Object, not doing anything in response to draw request.");
|
info!("bogus GID in Object, not doing anything in response to draw request.");
|
||||||
|
|
|
||||||
|
|
@ -573,7 +573,7 @@ fn xmain() -> ! {
|
||||||
use crate::implementation::Rtc;
|
use crate::implementation::Rtc;
|
||||||
|
|
||||||
log_server::init_wait().unwrap();
|
log_server::init_wait().unwrap();
|
||||||
log::set_max_level(log::LevelFilter::Debug);
|
log::set_max_level(log::LevelFilter::Info);
|
||||||
log::info!("my PID is {}", xous::process::id());
|
log::info!("my PID is {}", xous::process::id());
|
||||||
|
|
||||||
let xns = xous_names::XousNames::new().unwrap();
|
let xns = xous_names::XousNames::new().unwrap();
|
||||||
|
|
@ -790,16 +790,22 @@ fn xmain() -> ! {
|
||||||
Some(Opcode::UxDayOfWeek) => {
|
Some(Opcode::UxDayOfWeek) => {
|
||||||
let buffer = unsafe { Buffer::from_memory_message(msg.body.memory_message().unwrap()) };
|
let buffer = unsafe { Buffer::from_memory_message(msg.body.memory_message().unwrap()) };
|
||||||
let payload = buffer.to_original::<RadioButtonPayload, _>().unwrap();
|
let payload = buffer.to_original::<RadioButtonPayload, _>().unwrap();
|
||||||
weekday = match payload.as_str() {
|
weekday =
|
||||||
"monday" => Weekday::Monday,
|
if payload.as_str() == t!("rtc.monday", xous::LANG) {
|
||||||
"tuesday" => Weekday::Tuesday,
|
Weekday::Monday
|
||||||
"wednesday" => Weekday::Wednesday,
|
} else if payload.as_str() == t!("rtc.tuesday", xous::LANG) {
|
||||||
"thursday" => Weekday::Thursday,
|
Weekday::Tuesday
|
||||||
"friday" => Weekday::Friday,
|
} else if payload.as_str() == t!("rtc.wednesday", xous::LANG) {
|
||||||
"saturday" => Weekday::Saturday,
|
Weekday::Wednesday
|
||||||
"sunday" => Weekday::Sunday,
|
} else if payload.as_str() == t!("rtc.thursday", xous::LANG) {
|
||||||
_ => Weekday::Monday, // coz mondays suck
|
Weekday::Thursday
|
||||||
};
|
} else if payload.as_str() == t!("rtc.friday", xous::LANG) {
|
||||||
|
Weekday::Friday
|
||||||
|
} else if payload.as_str() == t!("rtc.saturday", xous::LANG) {
|
||||||
|
Weekday::Saturday
|
||||||
|
} else {
|
||||||
|
Weekday::Sunday
|
||||||
|
};
|
||||||
|
|
||||||
rtc_textentry.action_opcode = Opcode::UxHour.to_u32().unwrap();
|
rtc_textentry.action_opcode = Opcode::UxHour.to_u32().unwrap();
|
||||||
modal.modify(Some(TextEntry(rtc_textentry)),
|
modal.modify(Some(TextEntry(rtc_textentry)),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue