mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +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]
|
||||
fn xmain() -> ! {
|
||||
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());
|
||||
|
||||
let xns = xous_names::XousNames::new().unwrap();
|
||||
|
|
@ -785,7 +785,7 @@ fn xmain() -> ! {
|
|||
canvas.do_drawn().expect("couldn't set canvas to drawn");
|
||||
}
|
||||
} 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;
|
||||
buffer.replace(ret).unwrap();
|
||||
}
|
||||
|
|
@ -868,7 +868,7 @@ fn xmain() -> ! {
|
|||
}
|
||||
canvas.do_drawn().expect("couldn't set canvas to drawn");
|
||||
} 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 {
|
||||
info!("bogus GID in Object, not doing anything in response to draw request.");
|
||||
|
|
|
|||
|
|
@ -573,7 +573,7 @@ fn xmain() -> ! {
|
|||
use crate::implementation::Rtc;
|
||||
|
||||
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());
|
||||
|
||||
let xns = xous_names::XousNames::new().unwrap();
|
||||
|
|
@ -790,16 +790,22 @@ fn xmain() -> ! {
|
|||
Some(Opcode::UxDayOfWeek) => {
|
||||
let buffer = unsafe { Buffer::from_memory_message(msg.body.memory_message().unwrap()) };
|
||||
let payload = buffer.to_original::<RadioButtonPayload, _>().unwrap();
|
||||
weekday = match payload.as_str() {
|
||||
"monday" => Weekday::Monday,
|
||||
"tuesday" => Weekday::Tuesday,
|
||||
"wednesday" => Weekday::Wednesday,
|
||||
"thursday" => Weekday::Thursday,
|
||||
"friday" => Weekday::Friday,
|
||||
"saturday" => Weekday::Saturday,
|
||||
"sunday" => Weekday::Sunday,
|
||||
_ => Weekday::Monday, // coz mondays suck
|
||||
};
|
||||
weekday =
|
||||
if payload.as_str() == t!("rtc.monday", xous::LANG) {
|
||||
Weekday::Monday
|
||||
} else if payload.as_str() == t!("rtc.tuesday", xous::LANG) {
|
||||
Weekday::Tuesday
|
||||
} else if payload.as_str() == t!("rtc.wednesday", xous::LANG) {
|
||||
Weekday::Wednesday
|
||||
} else if payload.as_str() == t!("rtc.thursday", xous::LANG) {
|
||||
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();
|
||||
modal.modify(Some(TextEntry(rtc_textentry)),
|
||||
|
|
|
|||
Loading…
Reference in a new issue