use rom linked functions for pin keeping
This commit is contained in:
@@ -500,12 +500,12 @@ async fn safe_main(spawner: Spawner) -> FatResult<()> {
|
||||
.await
|
||||
.unwrap_or(BatteryState::Unknown);
|
||||
|
||||
|
||||
info!("Battery state is {:?}", battery_state);
|
||||
let mut light_state = LightState {
|
||||
enabled: board.board_hal.get_config().night_lamp.enabled,
|
||||
..Default::default()
|
||||
};
|
||||
info!("Light state is {:?}", light_state);
|
||||
if light_state.enabled {
|
||||
light_state.is_day = is_day;
|
||||
light_state.out_of_work_hour = !in_time_range(
|
||||
@@ -527,6 +527,7 @@ async fn safe_main(spawner: Spawner) -> FatResult<()> {
|
||||
.into()
|
||||
{
|
||||
board.board_hal.get_esp().set_low_voltage_in_cycle();
|
||||
info!("Set low voltage in cycle");
|
||||
} else if state_of_charge
|
||||
> board
|
||||
.board_hal
|
||||
@@ -536,6 +537,7 @@ async fn safe_main(spawner: Spawner) -> FatResult<()> {
|
||||
.into()
|
||||
{
|
||||
board.board_hal.get_esp().clear_low_voltage_in_cycle();
|
||||
info!("Clear low voltage in cycle");
|
||||
}
|
||||
light_state.battery_low = board.board_hal.get_esp().low_voltage_in_cycle();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user