cleanup some comments, tweak the stress test

the battery switchover behavior is guaranteed by the time management
servers, so we don't redundantly set it in the alarms.
This commit is contained in:
bunnie 2023-02-01 03:51:09 +08:00
parent a4c97a410c
commit 981abbf503
2 changed files with 1 additions and 4 deletions

View file

@ -425,8 +425,6 @@ fn main() -> ! {
}
let seconds = delay as u8;
i2c.i2c_mutex_acquire();
// make sure battery switchover is enabled, otherwise we won't keep time when power goes off
// i2c.i2c_write(ABRTCMC_I2C_ADR, ABRTCMC_CONTROL3, &[RTC_PWR_MODE]).expect("RTC access error");
// set clock units to 1 second, output pulse length to ~218ms
i2c.i2c_write(ABRTCMC_I2C_ADR, ABRTCMC_TIMERB_CLK, &[(TimerClk::CLK_1_S | TimerClk::PULSE_218_MS).bits()]).expect("RTC access error");
// program elapsed time
@ -449,8 +447,6 @@ fn main() -> ! {
}),
Some(Opcode::ClearWakeupAlarm) => msg_blocking_scalar_unpack!(msg, _, _, _, _, {
i2c.i2c_mutex_acquire();
// make sure battery switchover is enabled, otherwise we won't keep time when power goes off
// i2c.i2c_write(ABRTCMC_I2C_ADR, ABRTCMC_CONTROL3, &[RTC_PWR_MODE]).expect("RTC access error");
let config = Config::CLKOUT_DISABLE.bits();
// turn off RTC wakeup timer, in case previously set
i2c.i2c_write(ABRTCMC_I2C_ADR, ABRTCMC_CONFIG, &[config]).expect("RTC access error");

View file

@ -93,6 +93,7 @@ impl<'a> ShellCmdApi<'a> for Sleep {
loop {
log::info!("suspend/resume cycle: {}", iters);
llio.set_wakeup_alarm(4).unwrap();
ticktimer.sleep_ms(1000).ok();
match susres.initiate_suspend() {
Err(xous::Error::Timeout) => {
log::warn!("Couldn't suspend, a server was blocking suspend.\n");