Clean up main

This commit is contained in:
Sofia 2026-05-28 21:21:36 +03:00
parent e215987288
commit ea70f50e4a

View File

@ -149,24 +149,6 @@ fn main() -> ! {
curr_state: Box::new(InitATState::default()),
};
let pull_down_cfg = InputConfig::default().with_pull(esp_hal::gpio::Pull::None);
let pull_up_cfg = InputConfig::default().with_pull(esp_hal::gpio::Pull::None);
// let mut input_1 = Output::new(peripherals.GPIO4, Level::High, OutputConfig::default());
// let mut input_2 = Output::new(peripherals.GPIO36, Level::High, OutputConfig::default());
// let mut input_3 = Output::new(peripherals.GPIO22, Level::High, OutputConfig::default());
// let mut input_4 = Output::new(peripherals.GPIO12, Level::High, OutputConfig::default());
// let mut input_5 = Output::new(peripherals.GPIO13, Level::High, OutputConfig::default());
// let mut input_6 = Output::new(peripherals.GPIO26, Level::High, OutputConfig::default());
// let mut input_7 = Output::new(peripherals.GPIO27, Level::High, OutputConfig::default());
// let input_1 = Input::new(peripherals.GPIO4, pull_up_cfg);
// let input_2 = Input::new(peripherals.GPIO36, pull_up_cfg);
// let input_3 = Input::new(peripherals.GPIO22, pull_up_cfg);
// let input_4 = Input::new(peripherals.GPIO12, pull_up_cfg);
// let input_5 = Input::new(peripherals.GPIO13, pull_up_cfg);
// let input_6 = Input::new(peripherals.GPIO26, pull_up_cfg);
// let input_7 = Input::new(peripherals.GPIO27, pull_up_cfg);
static mut THREAD_2_STACK: Stack<{ 30 * 1024 }> = esp_hal::system::Stack {
mem: MaybeUninit::new([0u8; 30 * 1024]),
};
@ -187,69 +169,6 @@ fn main() -> ! {
},
);
// let mut pin_1 = Output::new(peripherals.GPIO13, Level::Low, OutputConfig::default());
// let mut pin_2 = Output::new(peripherals.GPIO33, Level::High, OutputConfig::default());
// let mut pin_3 = Output::new(peripherals.GPIO15, Level::Low, OutputConfig::default());
// let mut pin_4 = Output::new(peripherals.GPIO22, Level::Low, OutputConfig::default());
// let mut pin_5 = Output::new(peripherals.GPIO26, Level::Low, OutputConfig::default());
// let mut pin_6 = Output::new(peripherals.GPIO23, Level::Low, OutputConfig::default());
// let mut pin_7 = Output::new(peripherals.GPIO25, Level::Low, OutputConfig::default());
// // let mut pins = [pin_1, pin_2, pin_3, pin_4, pin_5, pin_6, pin_7];
// let delay = Delay::new();
// loop {
// pin_3.set_low();
// delay.delay_millis(300);
// pin_3.set_high();
// delay.delay_millis(300);
// }
// let pin_1 = Input::new(
// peripherals.GPIO13,
// InputConfig::default().with_pull(esp_hal::gpio::Pull::Up),
// );
// let mut pin_2 = Output::new(peripherals.GPIO33, Level::High, OutputConfig::default());
// let pin_3 = Input::new(
// peripherals.GPIO15,
// InputConfig::default().with_pull(esp_hal::gpio::Pull::Up),
// );
// let mut pin_4 = Output::new(peripherals.GPIO22, Level::High, OutputConfig::default());
// let pin_5 = Input::new(
// peripherals.GPIO26,
// InputConfig::default().with_pull(esp_hal::gpio::Pull::Up),
// );
// let mut pin_6 = Output::new(peripherals.GPIO23, Level::High, OutputConfig::default());
// let mut pin_7 = Output::new(peripherals.GPIO25, Level::High, OutputConfig::default());
// let col_pins = [pin_3, pin_1, pin_5];
// let mut row_pins = [pin_2, pin_7, pin_6, pin_4];
// let keypad = [
// ['1', '2', '3'],
// ['4', '5', '6'],
// ['7', '8', '9'],
// ['*', '0', '#'],
// ];
// let delay = Delay::new();
// loop {
// delay.delay_millis(100);
// for row in 0..4usize {
// row_pins[row].set_low();
// delay.delay_millis(10);
// for col in 0..3usize {
// if col_pins[col].is_low() {
// log::info!("Key: {}", keypad[row][col]);
// }
// }
// row_pins[row].set_high();
// delay.delay_millis(10);
// }
// state_mgr.update();
// state_mgr.draw();
// }
loop {
state_mgr.update();
state_mgr.draw();