Skip to content

Commit

Permalink
Revert "added ble_keyboard"
Browse files Browse the repository at this point in the history
This reverts commit 0aaa839.
  • Loading branch information
65787978 committed Aug 24, 2024
1 parent 0aaa839 commit 0051951
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 323 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ log = { version = "0.4", default-features = false }
esp-idf-svc = { version = "0.49", default-features = false }
esp-idf-hal = "0.44.1"
chrono = "0.4.38"
esp32-nimble = "0.7.0"

[build-dependencies]
embuild = "0.32.0"
306 changes: 0 additions & 306 deletions src/ble_keyboard.rs

This file was deleted.

21 changes: 5 additions & 16 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
to flash:
espflash flash ../target/riscv32imc-esp-espidf/debug/esp32-rust-split-keyboard --monitor
*/
use crate::ble_keyboard::*;
use chrono::Utc;
use esp32_rust_split_keyboard::{ColPins, KeyboardLeftSide, RowPins};
use esp_idf_hal::delay::FreeRtos;
Expand All @@ -11,8 +10,6 @@ use esp_idf_hal::delay::FreeRtos;
use esp_idf_svc::sys::link_patches;
use std::vec;

mod ble_keyboard;

// enum Rows<'a> {
// Row0(PinDriver<'a, Gpio2, Input>),
// Row1(PinDriver<'a, Gpio3, Input>),
Expand Down Expand Up @@ -56,16 +53,8 @@ fn main() {
ColPins::Col5,
];

/* initialize keyboard */
let mut keyboard = Keyboard::new()?;

if keyboard.connected() {
::log::info!("Sending 'Hello world'...");
keyboard.write("Hello world\n");
}

let mut keyboard_left_side = KeyboardLeftSide::new();
keyboard_left_side.initialize_hashmap();
let mut keyboard = KeyboardLeftSide::new();
keyboard.initialize_hashmap();

let mut key_1_pressed: Option<(i32, i32)> = None;
let mut key_2_pressed: Option<(i32, i32)> = None;
Expand Down Expand Up @@ -110,16 +99,16 @@ fn main() {
}
}

if let Some(key_1_valid) = keyboard_left_side.key.get(&key_1_pressed.unwrap()) {
if let Some(key_1_valid) = keyboard.key.get(&key_1_pressed.unwrap()) {
let mut keys_pressed: (&str, &str, &str) =
("not_pressed", "not_pressed", "not_pressed");

keys_pressed.0 = *key_1_valid;

if let Some(key_2_valid) = keyboard_left_side.key.get(&key_2_pressed.unwrap()) {
if let Some(key_2_valid) = keyboard.key.get(&key_2_pressed.unwrap()) {
keys_pressed.1 = *key_2_valid;

if let Some(key_3_valid) = keyboard_left_side.key.get(&key_3_pressed.unwrap()) {
if let Some(key_3_valid) = keyboard.key.get(&key_3_pressed.unwrap()) {
keys_pressed.2 = *key_3_valid;
}
}
Expand Down

0 comments on commit 0051951

Please sign in to comment.