From 29c325a94c0103fd7d6888125324f18e15619fb8 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Tue, 13 Jun 2023 21:32:12 +0200 Subject: [PATCH 01/27] Added first rp2040 code example --- .gitignore | 2 ++ rp2040/.cargo/config | 42 ++++++++++++++++++++++++ rp2040/Cargo.toml | 45 ++++++++++++++++++++++++++ rp2040/memory.x | 15 +++++++++ rp2040/pico-load | 12 +++++++ rp2040/src/main.rs | 76 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 192 insertions(+) create mode 100644 rp2040/.cargo/config create mode 100644 rp2040/Cargo.toml create mode 100644 rp2040/memory.x create mode 100755 rp2040/pico-load create mode 100644 rp2040/src/main.rs diff --git a/.gitignore b/.gitignore index 43f998b..30a8261 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ firmware/compile_commands.json firmware/.cache/clangd/index firmware/.ccls-cache +rp2040/target +rp2040/Cargo.lock diff --git a/rp2040/.cargo/config b/rp2040/.cargo/config new file mode 100644 index 0000000..ed10a10 --- /dev/null +++ b/rp2040/.cargo/config @@ -0,0 +1,42 @@ +# +# Cargo Configuration for the https://github.com/rp-rs/rp-hal.git repository. +# +# Copyright (c) The RP-RS Developers, 2021 +# +# You might want to make a similar file in your own repository if you are +# writing programs for Raspberry Silicon microcontrollers. +# +# This file is MIT or Apache-2.0 as per the repository README.md file +# + +[build] +# Set the default target to match the Cortex-M0+ in the RP2040 +target = "thumbv6m-none-eabi" + +# Target specific options +[target.thumbv6m-none-eabi] +# Pass some extra options to rustc, some of which get passed on to the linker. +# +# * linker argument --nmagic turns off page alignment of sections (which saves +# flash space) +# * linker argument -Tlink.x tells the linker to use link.x as the linker +# script. This is usually provided by the cortex-m-rt crate, and by default +# the version in that crate will include a file called `memory.x` which +# describes the particular memory layout for your specific chip. +# * inline-threshold=5 makes the compiler more aggressive and inlining functions +# * no-vectorize-loops turns off the loop vectorizer (seeing as the M0+ doesn't +# have SIMD) +rustflags = [ + "-C", "link-arg=--nmagic", + "-C", "link-arg=-Tlink.x", + "-C", "inline-threshold=5", + "-C", "no-vectorize-loops", +] + +# This runner will make a UF2 file and then copy it to a mounted RP2040 in USB +# Bootloader mode: +runner = "elf2uf2-rs -d" + +# This runner will find a supported SWD debug probe and flash your RP2040 over +# SWD: +# runner = "probe-run --chip RP2040" diff --git a/rp2040/Cargo.toml b/rp2040/Cargo.toml new file mode 100644 index 0000000..e4205ec --- /dev/null +++ b/rp2040/Cargo.toml @@ -0,0 +1,45 @@ +[package] +name = "rp2040" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +cortex-m = "0.7.2" +waveshare-rp2040-zero = "0.6.0" +rp2040-boot2 = { version = "0.2.0", optional = true } +rp2040-hal = { version = "0.8.0" } +cortex-m-rt = { version = "0.7", optional = true } +panic-halt= "0.2.0" +embedded-hal ="0.2.5" +fugit = "0.3.5" +nb = "1.0.0" +smart-leds = "0.3.0" +ws2812-pio = "0.6.0" + +[features] +# This is the set of features we enable by default +default = ["boot2", "rt", "critical-section-impl", "rom-func-cache"] + +# critical section that is safe for multicore use +critical-section-impl = ["rp2040-hal/critical-section-impl"] + +# 2nd stage bootloaders for rp2040 +boot2 = ["rp2040-boot2"] + +# Minimal startup / runtime for Cortex-M microcontrollers +rt = ["cortex-m-rt","rp2040-hal/rt"] + +# This enables a fix for USB errata 5: USB device fails to exit RESET state on busy USB bus. +# Only required for RP2040 B0 and RP2040 B1, but it doesn't hurt to enable it +rp2040-e5 = ["rp2040-hal/rp2040-e5"] + +# Memoize(cache) ROM function pointers on first use to improve performance +rom-func-cache = ["rp2040-hal/rom-func-cache"] + +# Disable automatic mapping of language features (like floating point math) to ROM functions +disable-intrinsics = ["rp2040-hal/disable-intrinsics"] + +# This enables ROM functions for f64 math that were not present in the earliest RP2040s +rom-v2-intrinsics = ["rp2040-hal/rom-v2-intrinsics"] diff --git a/rp2040/memory.x b/rp2040/memory.x new file mode 100644 index 0000000..4077aab --- /dev/null +++ b/rp2040/memory.x @@ -0,0 +1,15 @@ +MEMORY { + BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100 + FLASH : ORIGIN = 0x10000100, LENGTH = 2048K - 0x100 + RAM : ORIGIN = 0x20000000, LENGTH = 256K +} + +EXTERN(BOOT2_FIRMWARE) + +SECTIONS { + /* ### Boot loader */ + .boot2 ORIGIN(BOOT2) : + { + KEEP(*(.boot2)); + } > BOOT2 +} INSERT BEFORE .text; diff --git a/rp2040/pico-load b/rp2040/pico-load new file mode 100755 index 0000000..2a31890 --- /dev/null +++ b/rp2040/pico-load @@ -0,0 +1,12 @@ +#!/bin/bash +sudo umount /mnt/usb +while [ ! -f /mnt/usb/INFO_UF2.TXT ]; do + sudo mount /dev/sda1 /mnt/usb -o umask=000 + sleep 1 +done +set -e +# cargo build --release --example waveshare_rp2040_zero_neopixel_rainbow +cargo run --release +# elf2uf2-rs $1 +# cp $1.uf2 /mnt/usb +sudo umount /mnt/usb diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs new file mode 100644 index 0000000..b505f00 --- /dev/null +++ b/rp2040/src/main.rs @@ -0,0 +1,76 @@ +//! Rainbow effect color wheel using the onboard NeoPixel on an Waveshare RP2040 Zero board +//! +//! This flows smoothly through various colors on the onboard NeoPixel. +//! Uses the `ws2812_pio` driver to control the NeoPixel, which in turns uses the +//! RP2040's PIO block. +#![no_std] +#![no_main] + +use embedded_hal::timer::CountDown; +use fugit::ExtU32; +use panic_halt as _; +use smart_leds::{SmartLedsWrite, RGB8}; +use waveshare_rp2040_zero::entry; +use waveshare_rp2040_zero::{ + hal::{ + clocks::{init_clocks_and_plls, Clock}, + pac, + pio::PIOExt, + timer::Timer, + watchdog::Watchdog, + Sio, + }, + Pins, XOSC_CRYSTAL_FREQ, +}; +use ws2812_pio::Ws2812; + +#[entry] +fn main() -> ! { + let mut pac = pac::Peripherals::take().unwrap(); + + let mut watchdog = Watchdog::new(pac.WATCHDOG); + + let clocks = init_clocks_and_plls( + XOSC_CRYSTAL_FREQ, + pac.XOSC, + pac.CLOCKS, + pac.PLL_SYS, + pac.PLL_USB, + &mut pac.RESETS, + &mut watchdog, + ) + .ok() + .unwrap(); + + let sio = Sio::new(pac.SIO); + let pins = Pins::new( + pac.IO_BANK0, + pac.PADS_BANK0, + sio.gpio_bank0, + &mut pac.RESETS, + ); + + let timer = Timer::new(pac.TIMER, &mut pac.RESETS); + let mut delay = timer.count_down(); + + // Configure the addressable LED + let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); + let mut ws = Ws2812::new( + // The onboard NeoPixel is attached to GPIO pin #16 on the Feather RP2040. + pins.neopixel.into_mode(), + &mut pio, + sm0, + clocks.peripheral_clock.freq(), + timer.count_down(), + ); + + // Infinite colour wheel loop + loop { + let color_green : RGB8 = (0, 10, 10).into(); + ws.write([color_green].iter().copied()).unwrap(); + + delay.start(25.millis()); + let _ = nb::block!(delay.wait()); + } +} + From bafeb3803a44e697f27246b827535b79e236a36a Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Fri, 16 Jun 2023 00:01:15 +0200 Subject: [PATCH 02/27] Testing rust keyboard code --- rp2040/Cargo.toml | 4 ++ rp2040/src/main.rs | 173 ++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 167 insertions(+), 10 deletions(-) diff --git a/rp2040/Cargo.toml b/rp2040/Cargo.toml index e4205ec..fe65580 100644 --- a/rp2040/Cargo.toml +++ b/rp2040/Cargo.toml @@ -17,6 +17,10 @@ fugit = "0.3.5" nb = "1.0.0" smart-leds = "0.3.0" ws2812-pio = "0.6.0" +usbd-human-interface-device = "0.4.2" +usb-device = "0.2" +packed_struct = { version = "0.10", default-features = false } +keypad = "0.2.2" [features] # This is the set of features we enable by default diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index b505f00..c864a92 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -1,15 +1,16 @@ -//! Rainbow effect color wheel using the onboard NeoPixel on an Waveshare RP2040 Zero board -//! -//! This flows smoothly through various colors on the onboard NeoPixel. -//! Uses the `ws2812_pio` driver to control the NeoPixel, which in turns uses the -//! RP2040's PIO block. #![no_std] #![no_main] +use core::convert::Infallible; use embedded_hal::timer::CountDown; +use embedded_hal::digital::v2::*; use fugit::ExtU32; use panic_halt as _; use smart_leds::{SmartLedsWrite, RGB8}; +use usb_device::class_prelude::*; +use usb_device::prelude::*; +use usbd_human_interface_device::page::Keyboard; +use usbd_human_interface_device::prelude::*; use waveshare_rp2040_zero::entry; use waveshare_rp2040_zero::{ hal::{ @@ -24,6 +25,7 @@ use waveshare_rp2040_zero::{ }; use ws2812_pio::Ws2812; + #[entry] fn main() -> ! { let mut pac = pac::Peripherals::take().unwrap(); @@ -50,8 +52,27 @@ fn main() -> ! { &mut pac.RESETS, ); + let usb_bus = UsbBusAllocator::new(waveshare_rp2040_zero::hal::usb::UsbBus::new( + pac.USBCTRL_REGS, + pac.USBCTRL_DPRAM, + clocks.usb_clock, + true, + &mut pac.RESETS, + )); + + let mut keyboard = UsbHidClassBuilder::new() + .add_device( + usbd_human_interface_device::device::keyboard::NKROBootKeyboardConfig::default(), + ) + .build(&usb_bus); + + let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x1209, 0x0001)) + .manufacturer("usbd-human-interface-device") + .product("CMDR keyboard") + .serial_number("0001") + .build(); + let timer = Timer::new(pac.TIMER, &mut pac.RESETS); - let mut delay = timer.count_down(); // Configure the addressable LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); @@ -63,14 +84,146 @@ fn main() -> ! { clocks.peripheral_clock.freq(), timer.count_down(), ); + + let keys: &[&dyn InputPin] = &[ + &pins.gp0.into_pull_up_input(), + &pins.gp1.into_pull_up_input(), + &pins.gp2.into_pull_up_input(), + &pins.gp3.into_pull_up_input(), + &pins.gp4.into_readable_output(), + &pins.gp5.into_readable_output(), + &pins.gp6.into_readable_output(), + &pins.gp7.into_readable_output(), + &pins.gp8.into_readable_output(), + &pins.gp9.into_readable_output(), + &pins.gp10.into_readable_output(), + &pins.gp11.into_readable_output(), + &pins.gp12.into_readable_output(), + &pins.gp13.into_readable_output(), + &pins.gp14.into_readable_output(), + ]; + + let mut input_count_down = timer.count_down(); + input_count_down.start(10.millis()); + + let mut tick_count_down = timer.count_down(); + tick_count_down.start(1.millis()); + + let color_purple: RGB8 = (0, 10, 10).into(); + let color_red: RGB8 = (0, 10, 0).into(); + let color_green: RGB8 = (10, 0, 0).into(); + let color_blue: RGB8 = (0, 0, 10).into(); + let color_none: RGB8 = (0, 0, 0).into(); // Infinite colour wheel loop loop { - let color_green : RGB8 = (0, 10, 10).into(); - ws.write([color_green].iter().copied()).unwrap(); + // ws.write([color_purple].iter().copied()).unwrap(); - delay.start(25.millis()); - let _ = nb::block!(delay.wait()); + if input_count_down.wait().is_ok() { + let keys = get_keys(keys); + + match keyboard.device().write_report(keys) { + Err(UsbHidError::WouldBlock) => {} + Err(UsbHidError::Duplicate) => {} + Ok(_) => {} + Err(e) => { + core::panic!("Failed to write keyboard report: {:?}", e) + } + }; + } + + //Tick once per ms + if tick_count_down.wait().is_ok() { + match keyboard.tick() { + Err(UsbHidError::WouldBlock) => {} + Ok(_) => {} + Err(e) => { + core::panic!("Failed to process keyboard tick: {:?}", e) + } + }; + } + + if usb_dev.poll(&mut [&mut keyboard]) { + match keyboard.device().read_report() { + Err(UsbError::WouldBlock) => { + //do nothing + } + Err(e) => { + core::panic!("Failed to read keyboard report: {:?}", e) + } + Ok(leds) => { + if leds.caps_lock == true { + ws.write([color_red].iter().copied()).unwrap(); + } else { + ws.write([color_none].iter().copied()).unwrap(); + } + } + } + } } } +fn get_keys(keys: &[&dyn InputPin]) -> [Keyboard; 12] { + [ + if keys[0].is_low().unwrap() { + Keyboard::KeypadNumLockAndClear + } else { + Keyboard::NoEventIndicated + }, //Numlock + if keys[1].is_low().unwrap() { + Keyboard::UpArrow + } else { + Keyboard::NoEventIndicated + }, //Up + if keys[2].is_low().unwrap() { + Keyboard::F12 + } else { + Keyboard::NoEventIndicated + }, //F12 + if keys[3].is_low().unwrap() { + Keyboard::LeftArrow + } else { + Keyboard::NoEventIndicated + }, //Left + if keys[4].is_low().unwrap() { + Keyboard::DownArrow + } else { + Keyboard::NoEventIndicated + }, //Down + if keys[5].is_low().unwrap() { + Keyboard::RightArrow + } else { + Keyboard::NoEventIndicated + }, //Right + if keys[6].is_low().unwrap() { + Keyboard::A + } else { + Keyboard::NoEventIndicated + }, //A + if keys[7].is_low().unwrap() { + Keyboard::B + } else { + Keyboard::NoEventIndicated + }, //B + if keys[8].is_low().unwrap() { + Keyboard::C + } else { + Keyboard::NoEventIndicated + }, //C + if keys[9].is_low().unwrap() { + Keyboard::LeftControl + } else { + Keyboard::NoEventIndicated + }, //LCtrl + if keys[10].is_low().unwrap() { + Keyboard::LeftShift + } else { + Keyboard::NoEventIndicated + }, //LShift + if keys[11].is_low().unwrap() { + Keyboard::ReturnEnter + } else { + Keyboard::NoEventIndicated + }, //Enter + ] +} From 9d683b8850e60a5de9bca69d24adf7fa78c2c8b7 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Fri, 16 Jun 2023 16:27:51 +0200 Subject: [PATCH 03/27] Testing --- rp2040/src/main.rs | 113 ++++++++++----------------------------------- 1 file changed, 25 insertions(+), 88 deletions(-) diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index c864a92..839a31c 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -2,8 +2,8 @@ #![no_main] use core::convert::Infallible; -use embedded_hal::timer::CountDown; use embedded_hal::digital::v2::*; +use embedded_hal::timer::CountDown; use fugit::ExtU32; use panic_halt as _; use smart_leds::{SmartLedsWrite, RGB8}; @@ -25,7 +25,6 @@ use waveshare_rp2040_zero::{ }; use ws2812_pio::Ws2812; - #[entry] fn main() -> ! { let mut pac = pac::Peripherals::take().unwrap(); @@ -84,23 +83,27 @@ fn main() -> ! { clocks.peripheral_clock.freq(), timer.count_down(), ); - - let keys: &[&dyn InputPin] = &[ + + let matrix_rows: &[&dyn InputPin] = &[ &pins.gp0.into_pull_up_input(), &pins.gp1.into_pull_up_input(), &pins.gp2.into_pull_up_input(), &pins.gp3.into_pull_up_input(), - &pins.gp4.into_readable_output(), - &pins.gp5.into_readable_output(), - &pins.gp6.into_readable_output(), - &pins.gp7.into_readable_output(), - &pins.gp8.into_readable_output(), - &pins.gp9.into_readable_output(), - &pins.gp10.into_readable_output(), - &pins.gp11.into_readable_output(), - &pins.gp12.into_readable_output(), - &pins.gp13.into_readable_output(), - &pins.gp14.into_readable_output(), + ]; + + let matrix_cols: &[&dyn OutputPin] = &[ + &pins.gp4.into_push_pull_output(), + &pins.gp5.into_push_pull_output(), + &pins.gp6.into_push_pull_output(), + &pins.gp7.into_push_pull_output(), + &pins.gp8.into_push_pull_output(), + &pins.gp9.into_push_pull_output(), + &pins.gp10.into_push_pull_output(), + &pins.gp11.into_push_pull_output(), + &pins.gp12.into_push_pull_output(), + &pins.gp13.into_push_pull_output(), + &pins.gp14.into_push_pull_output(), + &pins.gp15.into_push_pull_output(), ]; let mut input_count_down = timer.count_down(); @@ -111,22 +114,19 @@ fn main() -> ! { let color_purple: RGB8 = (0, 10, 10).into(); let color_red: RGB8 = (0, 10, 0).into(); - let color_green: RGB8 = (10, 0, 0).into(); - let color_blue: RGB8 = (0, 0, 10).into(); + // let color_green: RGB8 = (10, 0, 0).into(); + // let color_blue: RGB8 = (0, 0, 10).into(); let color_none: RGB8 = (0, 0, 0).into(); // Infinite colour wheel loop loop { - // ws.write([color_purple].iter().copied()).unwrap(); - if input_count_down.wait().is_ok() { - let keys = get_keys(keys); - - match keyboard.device().write_report(keys) { + match keyboard.device().write_report([Keyboard::NoEventIndicated; 12]) { Err(UsbHidError::WouldBlock) => {} Err(UsbHidError::Duplicate) => {} Ok(_) => {} Err(e) => { + ws.write([color_red].iter().copied()).unwrap(); core::panic!("Failed to write keyboard report: {:?}", e) } }; @@ -138,6 +138,7 @@ fn main() -> ! { Err(UsbHidError::WouldBlock) => {} Ok(_) => {} Err(e) => { + ws.write([color_red].iter().copied()).unwrap(); core::panic!("Failed to process keyboard tick: {:?}", e) } }; @@ -149,11 +150,12 @@ fn main() -> ! { //do nothing } Err(e) => { + ws.write([color_red].iter().copied()).unwrap(); core::panic!("Failed to read keyboard report: {:?}", e) } Ok(leds) => { if leds.caps_lock == true { - ws.write([color_red].iter().copied()).unwrap(); + ws.write([color_purple].iter().copied()).unwrap(); } else { ws.write([color_none].iter().copied()).unwrap(); } @@ -162,68 +164,3 @@ fn main() -> ! { } } } - -fn get_keys(keys: &[&dyn InputPin]) -> [Keyboard; 12] { - [ - if keys[0].is_low().unwrap() { - Keyboard::KeypadNumLockAndClear - } else { - Keyboard::NoEventIndicated - }, //Numlock - if keys[1].is_low().unwrap() { - Keyboard::UpArrow - } else { - Keyboard::NoEventIndicated - }, //Up - if keys[2].is_low().unwrap() { - Keyboard::F12 - } else { - Keyboard::NoEventIndicated - }, //F12 - if keys[3].is_low().unwrap() { - Keyboard::LeftArrow - } else { - Keyboard::NoEventIndicated - }, //Left - if keys[4].is_low().unwrap() { - Keyboard::DownArrow - } else { - Keyboard::NoEventIndicated - }, //Down - if keys[5].is_low().unwrap() { - Keyboard::RightArrow - } else { - Keyboard::NoEventIndicated - }, //Right - if keys[6].is_low().unwrap() { - Keyboard::A - } else { - Keyboard::NoEventIndicated - }, //A - if keys[7].is_low().unwrap() { - Keyboard::B - } else { - Keyboard::NoEventIndicated - }, //B - if keys[8].is_low().unwrap() { - Keyboard::C - } else { - Keyboard::NoEventIndicated - }, //C - if keys[9].is_low().unwrap() { - Keyboard::LeftControl - } else { - Keyboard::NoEventIndicated - }, //LCtrl - if keys[10].is_low().unwrap() { - Keyboard::LeftShift - } else { - Keyboard::NoEventIndicated - }, //LShift - if keys[11].is_low().unwrap() { - Keyboard::ReturnEnter - } else { - Keyboard::NoEventIndicated - }, //Enter - ] -} From 63aefa717fd12b794acc5d87a69766a0cdf71170 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sun, 18 Jun 2023 20:21:58 +0200 Subject: [PATCH 04/27] First attemt on runnable code --- rp2040/src/main.rs | 329 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 301 insertions(+), 28 deletions(-) diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index 839a31c..1f1e7a5 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -2,6 +2,7 @@ #![no_main] use core::convert::Infallible; +use cortex_m::delay::Delay; use embedded_hal::digital::v2::*; use embedded_hal::timer::CountDown; use fugit::ExtU32; @@ -25,10 +26,29 @@ use waveshare_rp2040_zero::{ }; use ws2812_pio::Ws2812; +pub const NUMBER_OF_KEYS: usize = 42; + +#[derive(Copy, Clone)] +struct MatrixKey { + current_state: bool, + previous_state: bool, + fn_mode: u8, +} + +impl MatrixKey { + fn default() -> Self { + Self { + current_state: false, + previous_state: false, + fn_mode: 0, + } + } +} + #[entry] fn main() -> ! { let mut pac = pac::Peripherals::take().unwrap(); - + let core = pac::CorePeripherals::take().unwrap(); let mut watchdog = Watchdog::new(pac.WATCHDOG); let clocks = init_clocks_and_plls( @@ -72,11 +92,11 @@ fn main() -> ! { .build(); let timer = Timer::new(pac.TIMER, &mut pac.RESETS); + let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().to_Hz()); - // Configure the addressable LED + // Configure the status LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); - let mut ws = Ws2812::new( - // The onboard NeoPixel is attached to GPIO pin #16 on the Feather RP2040. + let mut status_led = Ws2812::new( pins.neopixel.into_mode(), &mut pio, sm0, @@ -84,26 +104,182 @@ fn main() -> ! { timer.count_down(), ); - let matrix_rows: &[&dyn InputPin] = &[ + let mut matrix_keys: [MatrixKey; NUMBER_OF_KEYS] = [MatrixKey::default(); NUMBER_OF_KEYS]; + + let matrix_rows: &[&dyn InputPin] = &[ &pins.gp0.into_pull_up_input(), &pins.gp1.into_pull_up_input(), - &pins.gp2.into_pull_up_input(), - &pins.gp3.into_pull_up_input(), + &pins.gp29.into_pull_up_input(), + &pins.gp28.into_pull_up_input(), ]; - let matrix_cols: &[&dyn OutputPin] = &[ - &pins.gp4.into_push_pull_output(), - &pins.gp5.into_push_pull_output(), - &pins.gp6.into_push_pull_output(), - &pins.gp7.into_push_pull_output(), - &pins.gp8.into_push_pull_output(), - &pins.gp9.into_push_pull_output(), - &pins.gp10.into_push_pull_output(), - &pins.gp11.into_push_pull_output(), - &pins.gp12.into_push_pull_output(), - &pins.gp13.into_push_pull_output(), - &pins.gp14.into_push_pull_output(), - &pins.gp15.into_push_pull_output(), + let matrix_cols: &mut [&mut dyn OutputPin] = &mut [ + &mut pins.gp12.into_push_pull_output(), + &mut pins.gp13.into_push_pull_output(), + &mut pins.gp14.into_push_pull_output(), + &mut pins.gp15.into_push_pull_output(), + &mut pins.gp26.into_push_pull_output(), + &mut pins.gp27.into_push_pull_output(), + &mut pins.gp7.into_push_pull_output(), + &mut pins.gp8.into_push_pull_output(), + &mut pins.gp6.into_push_pull_output(), + &mut pins.gp9.into_push_pull_output(), + &mut pins.gp10.into_push_pull_output(), + &mut pins.gp11.into_push_pull_output(), + ]; + + // ------------------------------------- ------------------------------------- + // | 0 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | 11 | + // | 12 | 13 | 14 | 15 | 16 | 17 | | 18 | 19 | 20 | 21 | 22 | 23 | + // | 24 | 25 | 26 | 27 | 28 | 29 | | 30 | 31 | 32 | 33 | 34 | 35 | + // ------------------| 36 | 37 | 38 | | 39 | 40 | 41 |------------------ + // ------------------- ------------------- + // GRAVE = § + // SEMICOLON = ö + // APOSTROPHE = ä + // LEFT_BRACE = å + // FORWARDSLASH = - + // NON_US_BACKSLASH = < + // EQUAL = ´ + // BACKSLASH = ' + // RIGHT_BRACE = ^ + // MINUS = + + // LEFT_ALT = Alt + // RIGHT_ALT = AltGr + + let layout: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ + [ // Function layer 0 + Keyboard::Tab, + Keyboard::Q, + Keyboard::W, + Keyboard::E, + Keyboard::R, + Keyboard::T, + Keyboard::Y, + Keyboard::U, + Keyboard::I, + Keyboard::O, + Keyboard::P, + Keyboard::LeftBrace, + Keyboard::LeftControl, + Keyboard::A, + Keyboard::S, + Keyboard::D, + Keyboard::F, + Keyboard::G, + Keyboard::H, + Keyboard::J, + Keyboard::K, + Keyboard::L, + Keyboard::Semicolon, + Keyboard::Apostrophe, + Keyboard::LeftShift, + Keyboard::Z, + Keyboard::X, + Keyboard::C, + Keyboard::V, + Keyboard::B, + Keyboard::N, + Keyboard::M, + Keyboard::Comma, + Keyboard::Dot, + Keyboard::ForwardSlash, + Keyboard::RightShift, + Keyboard::LeftAlt, + Keyboard::NoEventIndicated, + Keyboard::Space, + Keyboard::Space, + Keyboard::NoEventIndicated, + Keyboard::RightAlt, + ], + [ // Function layer 1 + Keyboard::Escape, + Keyboard::F1, + Keyboard::F2, + Keyboard::F3, + Keyboard::F4, + Keyboard::F5, + Keyboard::F6, + Keyboard::F7, + Keyboard::F8, + Keyboard::F9, + Keyboard::F10, + Keyboard::DeleteBackspace, + Keyboard::LeftControl, + Keyboard::Keyboard1, + Keyboard::Keyboard2, + Keyboard::Keyboard3, + Keyboard::Keyboard4, + Keyboard::Keyboard5, + Keyboard::Keyboard6, + Keyboard::Keyboard7, + Keyboard::Keyboard8, + Keyboard::Keyboard9, + Keyboard::Keyboard0, + Keyboard::ReturnEnter, + Keyboard::LeftShift, + Keyboard::Keyboard6, + Keyboard::Keyboard7, + Keyboard::Keyboard8, + Keyboard::Keyboard9, + Keyboard::Keyboard0, + Keyboard::NonUSBackslash, + Keyboard::Equal, + Keyboard::Backslash, + Keyboard::RightBrace, + Keyboard::Minus, + Keyboard::RightShift, + Keyboard::LeftAlt, + Keyboard::NoEventIndicated, + Keyboard::DeleteBackspace, + Keyboard::DeleteBackspace, + Keyboard::NoEventIndicated, + Keyboard::RightAlt, + ], + [ // Function layer 2 + Keyboard::F11, + Keyboard::F12, + Keyboard::F13, + Keyboard::F14, + Keyboard::F15, + Keyboard::F16, + Keyboard::Grave, + Keyboard::NoEventIndicated, + Keyboard::LeftGUI, + Keyboard::NoEventIndicated, + Keyboard::CapsLock, + Keyboard::DeleteBackspace, + Keyboard::LeftControl, + Keyboard::NoEventIndicated, + Keyboard::NoEventIndicated, + Keyboard::F17, + Keyboard::F18, + Keyboard::F19, + Keyboard::LeftArrow, + Keyboard::DownArrow, + Keyboard::UpArrow, + Keyboard::RightArrow, + Keyboard::DeleteForward, + Keyboard::ReturnEnter, + Keyboard::LeftShift, + Keyboard::F20, + Keyboard::F21, + Keyboard::F22, + Keyboard::F23, + Keyboard::F24, + Keyboard::Home, + Keyboard::PageDown, + Keyboard::PageUp, + Keyboard::End, + Keyboard::Insert, + Keyboard::RightShift, + Keyboard::LeftAlt, + Keyboard::NoEventIndicated, + Keyboard::LeftGUI, + Keyboard::DeleteBackspace, + Keyboard::NoEventIndicated, + Keyboard::RightAlt, + ], ]; let mut input_count_down = timer.count_down(); @@ -114,19 +290,34 @@ fn main() -> ! { let color_purple: RGB8 = (0, 10, 10).into(); let color_red: RGB8 = (0, 10, 0).into(); - // let color_green: RGB8 = (10, 0, 0).into(); - // let color_blue: RGB8 = (0, 0, 10).into(); let color_none: RGB8 = (0, 0, 0).into(); + init_keyboard_matrix_pins(matrix_cols, &mut delay); + // Infinite colour wheel loop loop { if input_count_down.wait().is_ok() { - match keyboard.device().write_report([Keyboard::NoEventIndicated; 12]) { + // Scan keyboard matrix + let pressed_keys = get_pressed_keys(matrix_rows, matrix_cols, &mut delay); + + // Get current function layer + let fn_mode = get_fn_mode(pressed_keys); + + // Copy result from scanned keys to matrix struct + for (index, key) in pressed_keys.iter().enumerate() { + matrix_keys[index].current_state = *key; + } + + // Generate keyboard report + let keyboard_report = + get_keyboard_report(matrix_keys, layout, fn_mode); + + match keyboard.device().write_report(keyboard_report) { Err(UsbHidError::WouldBlock) => {} Err(UsbHidError::Duplicate) => {} Ok(_) => {} Err(e) => { - ws.write([color_red].iter().copied()).unwrap(); + status_led.write([color_red].iter().copied()).unwrap(); core::panic!("Failed to write keyboard report: {:?}", e) } }; @@ -138,7 +329,7 @@ fn main() -> ! { Err(UsbHidError::WouldBlock) => {} Ok(_) => {} Err(e) => { - ws.write([color_red].iter().copied()).unwrap(); + status_led.write([color_red].iter().copied()).unwrap(); core::panic!("Failed to process keyboard tick: {:?}", e) } }; @@ -150,17 +341,99 @@ fn main() -> ! { //do nothing } Err(e) => { - ws.write([color_red].iter().copied()).unwrap(); + status_led.write([color_red].iter().copied()).unwrap(); core::panic!("Failed to read keyboard report: {:?}", e) } Ok(leds) => { if leds.caps_lock == true { - ws.write([color_purple].iter().copied()).unwrap(); + status_led.write([color_purple].iter().copied()).unwrap(); } else { - ws.write([color_none].iter().copied()).unwrap(); + status_led.write([color_none].iter().copied()).unwrap(); } } } } } } + +// Initialise keyboard matrix pins +fn init_keyboard_matrix_pins( + cols: &mut [&mut dyn OutputPin], + delay: &mut Delay, +) { + for col in cols.iter_mut() { + col.set_high().unwrap(); + } + delay.delay_us(10); +} + +// Scan keyboard matrix for pressed keys and return a bool array +// representing the state of each key (true = pressed) +// TODO: This is a bit of a mess, needs refactoring +fn get_pressed_keys( + rows: &[&dyn InputPin], + cols: &mut [&mut dyn OutputPin], + delay: &mut Delay, +) -> [bool; NUMBER_OF_KEYS] { + // Scan keyboard matrix for pressed keys + let mut pressed_keys: [bool; NUMBER_OF_KEYS] = [false; NUMBER_OF_KEYS]; + let mut key_index: usize = 0; + for (col_index, col) in cols.iter_mut().enumerate() { + col.set_low().unwrap(); + delay.delay_us(10); + for (row_index, row) in rows.iter().enumerate() { + if col_index == 3 + && (row_index == 0 + || row_index == 1 + || row_index == 2 + || row_index == 9 + || row_index == 10 + || row_index == 11) + { + continue; + } + if row.is_low().unwrap() { + pressed_keys[key_index] = true; + } + key_index += 1; + } + col.set_high().unwrap(); + delay.delay_us(10); + } + // Return scan result + pressed_keys +} + +// Get current Fn mode (0, 1 or 2) +fn get_fn_mode(pressed_keys: [bool; NUMBER_OF_KEYS]) -> u8 { + // Check Fn mode + let mut fn_mode: u8 = 0; + if pressed_keys[37] == true && pressed_keys[40] == true { + fn_mode = 2; + } else if pressed_keys[37] == true || pressed_keys[40] == true { + fn_mode = 1; + } + fn_mode +} + +// Generate keyboard report based on pressed keys and Fn mode (0, 1 or 2) +fn get_keyboard_report( + mut matrix_keys: [MatrixKey; NUMBER_OF_KEYS], + layout: [[Keyboard; NUMBER_OF_KEYS]; 3], + fn_mode: u8, +) -> [Keyboard; NUMBER_OF_KEYS] { + // Create default report + let mut keyboard_report: [Keyboard; NUMBER_OF_KEYS] = + [Keyboard::NoEventIndicated; NUMBER_OF_KEYS]; + // Filter report based on Fn mode and pressed keys + for (index, key) in matrix_keys.iter_mut().enumerate() { + if key.current_state != key.previous_state && key.current_state == true { + key.fn_mode = fn_mode; + } + if key.current_state == true { + keyboard_report[index] = layout[index][usize::from(key.fn_mode)]; + } + } + // Return report + keyboard_report +} From 69ce2ad75e3391311ad622d2521ac112ebfd8163 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sun, 18 Jun 2023 23:29:17 +0200 Subject: [PATCH 05/27] Fixed initial bugs. First working commit --- rp2040/src/main.rs | 71 ++++++++++++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 24 deletions(-) diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index 1f1e7a5..ea8817b 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -26,6 +26,8 @@ use waveshare_rp2040_zero::{ }; use ws2812_pio::Ws2812; +pub const KEY_ROWS: usize = 4; +pub const KEY_COLS: usize = 12; pub const NUMBER_OF_KEYS: usize = 42; #[derive(Copy, Clone)] @@ -148,7 +150,8 @@ fn main() -> ! { // RIGHT_ALT = AltGr let layout: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ - [ // Function layer 0 + [ + // Function layer 0 Keyboard::Tab, Keyboard::Q, Keyboard::W, @@ -192,7 +195,8 @@ fn main() -> ! { Keyboard::NoEventIndicated, Keyboard::RightAlt, ], - [ // Function layer 1 + [ + // Function layer 1 Keyboard::Escape, Keyboard::F1, Keyboard::F2, @@ -236,7 +240,8 @@ fn main() -> ! { Keyboard::NoEventIndicated, Keyboard::RightAlt, ], - [ // Function layer 2 + [ + // Function layer 2 Keyboard::F11, Keyboard::F12, Keyboard::F13, @@ -288,9 +293,15 @@ fn main() -> ! { let mut tick_count_down = timer.count_down(); tick_count_down.start(1.millis()); - let color_purple: RGB8 = (0, 10, 10).into(); - let color_red: RGB8 = (0, 10, 0).into(); - let color_none: RGB8 = (0, 0, 0).into(); + let status_led_color: [RGB8; 5] = [ + (0, 0, 0).into(), // Off + (10, 7, 0).into(), // Green + (10, 4, 10).into(), // Blue + (5, 10, 0).into(), // Orange + (2, 20, 0).into(), // Red + ]; + + let mut caps_lock_active = false; init_keyboard_matrix_pins(matrix_cols, &mut delay); @@ -303,21 +314,31 @@ fn main() -> ! { // Get current function layer let fn_mode = get_fn_mode(pressed_keys); + // Set status LED colour based on function layer and capslock + // 0 = green, 1 = blue, 2 = orange, capslock active = red. + if caps_lock_active == true { + status_led + .write([status_led_color[4]].iter().copied()) + .unwrap(); + } else { + status_led + .write([status_led_color[usize::from(fn_mode) + 1]].iter().copied()) + .unwrap(); + } + // Copy result from scanned keys to matrix struct for (index, key) in pressed_keys.iter().enumerate() { matrix_keys[index].current_state = *key; } // Generate keyboard report - let keyboard_report = - get_keyboard_report(matrix_keys, layout, fn_mode); + let keyboard_report = get_keyboard_report(matrix_keys, layout, fn_mode); match keyboard.device().write_report(keyboard_report) { Err(UsbHidError::WouldBlock) => {} Err(UsbHidError::Duplicate) => {} Ok(_) => {} Err(e) => { - status_led.write([color_red].iter().copied()).unwrap(); core::panic!("Failed to write keyboard report: {:?}", e) } }; @@ -329,7 +350,6 @@ fn main() -> ! { Err(UsbHidError::WouldBlock) => {} Ok(_) => {} Err(e) => { - status_led.write([color_red].iter().copied()).unwrap(); core::panic!("Failed to process keyboard tick: {:?}", e) } }; @@ -341,14 +361,13 @@ fn main() -> ! { //do nothing } Err(e) => { - status_led.write([color_red].iter().copied()).unwrap(); core::panic!("Failed to read keyboard report: {:?}", e) } Ok(leds) => { if leds.caps_lock == true { - status_led.write([color_purple].iter().copied()).unwrap(); + caps_lock_active = true; } else { - status_led.write([color_none].iter().copied()).unwrap(); + caps_lock_active = false; } } } @@ -377,25 +396,29 @@ fn get_pressed_keys( ) -> [bool; NUMBER_OF_KEYS] { // Scan keyboard matrix for pressed keys let mut pressed_keys: [bool; NUMBER_OF_KEYS] = [false; NUMBER_OF_KEYS]; - let mut key_index: usize = 0; for (col_index, col) in cols.iter_mut().enumerate() { + // Activate column col.set_low().unwrap(); delay.delay_us(10); + + // Read rows for (row_index, row) in rows.iter().enumerate() { - if col_index == 3 + // Do not check unconnected keys in the matrix + if row_index == 3 && (row_index == 0 - || row_index == 1 - || row_index == 2 - || row_index == 9 - || row_index == 10 - || row_index == 11) + || col_index == 1 + || col_index == 2 + || col_index == 9 + || col_index == 10 + || col_index == 11) { continue; } - if row.is_low().unwrap() { - pressed_keys[key_index] = true; + if row_index < 3 && row.is_low().unwrap() { + pressed_keys[col_index + (row_index * KEY_COLS)] = true; + } else if row.is_low().unwrap() { + pressed_keys[col_index + (row_index * KEY_COLS) - 3] = true; } - key_index += 1; } col.set_high().unwrap(); delay.delay_us(10); @@ -431,7 +454,7 @@ fn get_keyboard_report( key.fn_mode = fn_mode; } if key.current_state == true { - keyboard_report[index] = layout[index][usize::from(key.fn_mode)]; + keyboard_report[index] = layout[usize::from(key.fn_mode)][index]; } } // Return report From 0b96258e5de29759f4370c3734e95067268ece0e Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 19 Jun 2023 08:24:44 +0200 Subject: [PATCH 06/27] Renamed teensy folder --- .gitignore | 2 + {firmware => teensylc}/.gitignore | 0 {firmware => teensylc}/Makefile | 0 teensylc/compile_commands.json | 434 +++++++++++++++++++ {firmware => teensylc}/extra_script.py | 0 {firmware => teensylc}/include/.gitkeep | 0 {firmware => teensylc}/lib/.gitkeep | 0 {firmware => teensylc}/lib/teensy-libc | 0 {firmware => teensylc}/platformio.ini | 0 {firmware => teensylc}/src/cmdr_keyboard.cpp | 0 10 files changed, 436 insertions(+) rename {firmware => teensylc}/.gitignore (100%) rename {firmware => teensylc}/Makefile (100%) create mode 100644 teensylc/compile_commands.json rename {firmware => teensylc}/extra_script.py (100%) rename {firmware => teensylc}/include/.gitkeep (100%) rename {firmware => teensylc}/lib/.gitkeep (100%) rename {firmware => teensylc}/lib/teensy-libc (100%) rename {firmware => teensylc}/platformio.ini (100%) rename {firmware => teensylc}/src/cmdr_keyboard.cpp (100%) diff --git a/.gitignore b/.gitignore index 30a8261..6f78e37 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ firmware/.cache/clangd/index firmware/.ccls-cache rp2040/target rp2040/Cargo.lock +teensylc/.cache/clangd/index +teensylc/.ccls-cache diff --git a/firmware/.gitignore b/teensylc/.gitignore similarity index 100% rename from firmware/.gitignore rename to teensylc/.gitignore diff --git a/firmware/Makefile b/teensylc/Makefile similarity index 100% rename from firmware/Makefile rename to teensylc/Makefile diff --git a/teensylc/compile_commands.json b/teensylc/compile_commands.json new file mode 100644 index 0000000..6000d8b --- /dev/null +++ b/teensylc/compile_commands.json @@ -0,0 +1,434 @@ +[ + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/AudioStream.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/AudioStream.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/AudioStream.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/AudioStream.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/CrashReport.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/CrashReport.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/CrashReport.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/CrashReport.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/DMAChannel.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/DMAChannel.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/DMAChannel.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/DMAChannel.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/EventResponder.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/EventResponder.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/EventResponder.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/EventResponder.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/HardwareSerial.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/HardwareSerial.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/HardwareSerial1.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial1.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial1.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/HardwareSerial1.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/HardwareSerial2.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial2.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial2.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/HardwareSerial2.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/HardwareSerial3.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial3.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial3.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/HardwareSerial3.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/HardwareSerial4.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial4.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial4.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/HardwareSerial4.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/HardwareSerial5.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial5.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial5.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/HardwareSerial5.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/HardwareSerial6.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial6.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/HardwareSerial6.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/HardwareSerial6.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/IPAddress.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/IPAddress.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/IPAddress.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/IPAddress.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/IntervalTimer.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/IntervalTimer.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/IntervalTimer.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/IntervalTimer.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/Print.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/Print.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/Print.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/Print.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/Stream.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/Stream.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/Stream.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/Stream.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/Time.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/Time.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/Time.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/Time.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/Tone.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/Tone.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/Tone.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/Tone.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/WMath.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/WMath.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/WMath.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/WMath.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/WString.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/WString.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/WString.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/WString.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/analog.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/analog.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/analog.c", + "output": ".pio/build/teensylc/FrameworkArduino/analog.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/avr_emulation.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/avr_emulation.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/avr_emulation.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/avr_emulation.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/eeprom.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/eeprom.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/eeprom.c", + "output": ".pio/build/teensylc/FrameworkArduino/eeprom.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/keylayouts.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/keylayouts.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/keylayouts.c", + "output": ".pio/build/teensylc/FrameworkArduino/keylayouts.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/main.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/main.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/main.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/main.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/math_helper.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/math_helper.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/math_helper.c", + "output": ".pio/build/teensylc/FrameworkArduino/math_helper.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -mthumb -mcpu=cortex-m0plus -mno-unaligned-access -x assembler-with-cpp -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include -c -o .pio/build/teensylc/FrameworkArduino/memcpy-armv7m.S.o /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/memcpy-armv7m.S", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/memcpy-armv7m.S", + "output": ".pio/build/teensylc/FrameworkArduino/memcpy-armv7m.S.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -mthumb -mcpu=cortex-m0plus -mno-unaligned-access -x assembler-with-cpp -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include -c -o .pio/build/teensylc/FrameworkArduino/memset.S.o /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/memset.S", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/memset.S", + "output": ".pio/build/teensylc/FrameworkArduino/memset.S.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/mk20dx128.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/mk20dx128.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/mk20dx128.c", + "output": ".pio/build/teensylc/FrameworkArduino/mk20dx128.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/new.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/new.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/new.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/new.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/nonstd.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/nonstd.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/nonstd.c", + "output": ".pio/build/teensylc/FrameworkArduino/nonstd.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/pins_teensy.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/pins_teensy.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/pins_teensy.c", + "output": ".pio/build/teensylc/FrameworkArduino/pins_teensy.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/ser_print.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/ser_print.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/ser_print.c", + "output": ".pio/build/teensylc/FrameworkArduino/ser_print.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/serial1.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial1.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial1.c", + "output": ".pio/build/teensylc/FrameworkArduino/serial1.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/serial2.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial2.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial2.c", + "output": ".pio/build/teensylc/FrameworkArduino/serial2.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/serial3.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial3.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial3.c", + "output": ".pio/build/teensylc/FrameworkArduino/serial3.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/serial4.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial4.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial4.c", + "output": ".pio/build/teensylc/FrameworkArduino/serial4.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/serial5.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial5.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial5.c", + "output": ".pio/build/teensylc/FrameworkArduino/serial5.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/serial6.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial6.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial6.c", + "output": ".pio/build/teensylc/FrameworkArduino/serial6.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/serial6_lpuart.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial6_lpuart.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serial6_lpuart.c", + "output": ".pio/build/teensylc/FrameworkArduino/serial6_lpuart.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/serialEvent.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/serialEvent.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/serialEvent1.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent1.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent1.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/serialEvent1.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/serialEvent2.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent2.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent2.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/serialEvent2.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/serialEvent3.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent3.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent3.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/serialEvent3.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/serialEvent4.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent4.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent4.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/serialEvent4.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/serialEvent5.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent5.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent5.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/serialEvent5.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/serialEvent6.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent6.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEvent6.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/serialEvent6.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/serialEventUSB1.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEventUSB1.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEventUSB1.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/serialEventUSB1.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/serialEventUSB2.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEventUSB2.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/serialEventUSB2.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/serialEventUSB2.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/touch.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/touch.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/touch.c", + "output": ".pio/build/teensylc/FrameworkArduino/touch.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/usb_audio.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_audio.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_audio.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/usb_audio.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_desc.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_desc.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_desc.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_desc.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_dev.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_dev.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_dev.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_dev.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/usb_flightsim.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_flightsim.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_flightsim.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/usb_flightsim.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/usb_inst.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_inst.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_inst.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/usb_inst.cpp.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_joystick.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_joystick.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_joystick.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_joystick.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_keyboard.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_keyboard.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_keyboard.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_keyboard.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_mem.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_mem.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_mem.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_mem.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_midi.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_midi.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_midi.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_midi.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_mouse.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_mouse.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_mouse.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_mouse.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_mtp.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_mtp.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_mtp.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_mtp.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_rawhid.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_rawhid.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_rawhid.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_rawhid.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_seremu.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_seremu.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_seremu.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_seremu.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_serial.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_serial.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_serial.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_serial.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_serial2.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_serial2.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_serial2.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_serial2.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_serial3.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_serial3.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_serial3.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_serial3.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc -o .pio/build/teensylc/FrameworkArduino/usb_touch.c.o -c -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_touch.c", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/usb_touch.c", + "output": ".pio/build/teensylc/FrameworkArduino/usb_touch.c.o" + }, + { + "command": "/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++ -o .pio/build/teensylc/FrameworkArduino/yield.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include /home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/yield.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3/yield.cpp", + "output": ".pio/build/teensylc/FrameworkArduino/yield.cpp.o" + }, + { + "command": "arm-none-eabi-g++ -o .pio/build/teensylc/lib541/teensy-libc/ElrsTx.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -Ilib/teensy-libc -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 lib/teensy-libc/ElrsTx.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "lib/teensy-libc/ElrsTx.cpp", + "output": ".pio/build/teensylc/lib541/teensy-libc/ElrsTx.cpp.o" + }, + { + "command": "arm-none-eabi-g++ -o .pio/build/teensylc/lib541/teensy-libc/IndicatorLed.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -Ilib/teensy-libc -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 lib/teensy-libc/IndicatorLed.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "lib/teensy-libc/IndicatorLed.cpp", + "output": ".pio/build/teensylc/lib541/teensy-libc/IndicatorLed.cpp.o" + }, + { + "command": "arm-none-eabi-g++ -o .pio/build/teensylc/lib083/Keypad/Key.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 /home/cm/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src/Key.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src/Key.cpp", + "output": ".pio/build/teensylc/lib083/Keypad/Key.cpp.o" + }, + { + "command": "arm-none-eabi-g++ -o .pio/build/teensylc/lib083/Keypad/Keypad.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -I/home/cm/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 /home/cm/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src/Keypad.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "/home/cm/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src/Keypad.cpp", + "output": ".pio/build/teensylc/lib083/Keypad/Keypad.cpp.o" + }, + { + "command": "arm-none-eabi-g++ -o .pio/build/teensylc/src/cmdr_keyboard.cpp.o -c -fno-exceptions -felide-constructors -fno-rtti -std=gnu++14 -Wno-error=narrowing -fpermissive -w -Wall -ffunction-sections -fdata-sections -mthumb -mcpu=cortex-m0plus -nostdlib -Os --specs=nano.specs -mno-unaligned-access -fsingle-precision-constant -DPLATFORMIO=60108 -D__MKL26Z64__ -DARDUINO_TEENSYLC -DUSB_KEYBOARDONLY -DLAYOUT_SWEDISH -DARDUINO=10805 -DTEENSYDUINO=158 -DCORE_TEENSY -DF_CPU=48000000L -DLAYOUT_US_ENGLISH -Iinclude -Isrc -I/home/cm/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src -Ilib/teensy-libc -I/home/cm/.platformio/packages/framework-arduinoteensy/cores/teensy3 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1 -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed -I/home/cm/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include src/cmdr_keyboard.cpp", + "directory": "/home/cm/projects/cmdr-keyboard/firmware", + "file": "src/cmdr_keyboard.cpp", + "output": ".pio/build/teensylc/src/cmdr_keyboard.cpp.o" + } +] diff --git a/firmware/extra_script.py b/teensylc/extra_script.py similarity index 100% rename from firmware/extra_script.py rename to teensylc/extra_script.py diff --git a/firmware/include/.gitkeep b/teensylc/include/.gitkeep similarity index 100% rename from firmware/include/.gitkeep rename to teensylc/include/.gitkeep diff --git a/firmware/lib/.gitkeep b/teensylc/lib/.gitkeep similarity index 100% rename from firmware/lib/.gitkeep rename to teensylc/lib/.gitkeep diff --git a/firmware/lib/teensy-libc b/teensylc/lib/teensy-libc similarity index 100% rename from firmware/lib/teensy-libc rename to teensylc/lib/teensy-libc diff --git a/firmware/platformio.ini b/teensylc/platformio.ini similarity index 100% rename from firmware/platformio.ini rename to teensylc/platformio.ini diff --git a/firmware/src/cmdr_keyboard.cpp b/teensylc/src/cmdr_keyboard.cpp similarity index 100% rename from firmware/src/cmdr_keyboard.cpp rename to teensylc/src/cmdr_keyboard.cpp From 60e6258b2651fa7af29cd4136b6976e6844fdab0 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 19 Jun 2023 08:24:55 +0200 Subject: [PATCH 07/27] Code cleanup --- rp2040/src/main.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index ea8817b..aa4f73e 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -404,19 +404,13 @@ fn get_pressed_keys( // Read rows for (row_index, row) in rows.iter().enumerate() { // Do not check unconnected keys in the matrix - if row_index == 3 - && (row_index == 0 - || col_index == 1 - || col_index == 2 - || col_index == 9 - || col_index == 10 - || col_index == 11) - { + if row_index == 3 && (col_index < 3 || col_index > 8) { continue; } if row_index < 3 && row.is_low().unwrap() { pressed_keys[col_index + (row_index * KEY_COLS)] = true; } else if row.is_low().unwrap() { + // Correct index for unconnected keys pressed_keys[col_index + (row_index * KEY_COLS) - 3] = true; } } @@ -451,6 +445,7 @@ fn get_keyboard_report( // Filter report based on Fn mode and pressed keys for (index, key) in matrix_keys.iter_mut().enumerate() { if key.current_state != key.previous_state && key.current_state == true { + key.previous_state = key.current_state; key.fn_mode = fn_mode; } if key.current_state == true { From 5ae9e09667778fac9ded20715db406aa04dbc260 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 19 Jun 2023 22:43:42 +0200 Subject: [PATCH 08/27] Fixed no test crate error --- rp2040/Cargo.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rp2040/Cargo.toml b/rp2040/Cargo.toml index fe65580..42dc6fd 100644 --- a/rp2040/Cargo.toml +++ b/rp2040/Cargo.toml @@ -3,8 +3,6 @@ name = "rp2040" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] cortex-m = "0.7.2" waveshare-rp2040-zero = "0.6.0" @@ -47,3 +45,9 @@ disable-intrinsics = ["rp2040-hal/disable-intrinsics"] # This enables ROM functions for f64 math that were not present in the earliest RP2040s rom-v2-intrinsics = ["rp2040-hal/rom-v2-intrinsics"] + +[[bin]] +name = "rp2040" +test = false +bench = false + From 24de6a5109a656d0cf8b1a556854e126f3f7e132 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 19 Jun 2023 22:43:59 +0200 Subject: [PATCH 09/27] Splitted out layout file --- rp2040/src/layout.rs | 171 +++++++++++++++++++++++++++++ rp2040/src/main.rs | 250 ++++++++++--------------------------------- 2 files changed, 229 insertions(+), 192 deletions(-) create mode 100644 rp2040/src/layout.rs diff --git a/rp2040/src/layout.rs b/rp2040/src/layout.rs new file mode 100644 index 0000000..72db05c --- /dev/null +++ b/rp2040/src/layout.rs @@ -0,0 +1,171 @@ +// Button index map: +// ------------------------------------- ------------------------------------- +// | 0 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | 11 | +// | 12 | 13 | 14 | 15 | 16 | 17 | | 18 | 19 | 20 | 21 | 22 | 23 | +// | 24 | 25 | 26 | 27 | 28 | 29 | | 30 | 31 | 32 | 33 | 34 | 35 | +// ------------------| 36 | 37 | 38 | | 39 | 40 | 41 |------------------ +// ------------------- ------------------- +// +// Swedish keymap conversion table: +// US Swedish +// -------------------------- +// Grave § +// Semicolon ö +// Apostrophe ä +// LeftBrace å +// ForwardSlash - +// NonUSBackslash < +// Equal ´ +// Backslash ' +// RightBrace ^ +// Minus + +// LeftAlt Alt +// RightAlt AltGr + +use crate::NUMBER_OF_KEYS; +use usbd_human_interface_device::page::Keyboard; + +// Function (Fn) buttons index (need two buttons) +pub const FN_BUTTONS: [u8; 2] = [37, 40]; + +// Button map to HID key (three Function layers) +pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ + [ + // Function layer 0 + // HID Key // Button Index + Keyboard::Tab, // 0 + Keyboard::Q, // 1 + Keyboard::W, // 2 + Keyboard::E, // 3 + Keyboard::R, // 4 + Keyboard::T, // 5 + Keyboard::Y, // 6 + Keyboard::U, // 7 + Keyboard::I, // 8 + Keyboard::O, // 9 + Keyboard::P, // 10 + Keyboard::LeftBrace, // 11 // Å + Keyboard::LeftControl, // 12 + Keyboard::A, // 13 + Keyboard::S, // 14 + Keyboard::D, // 15 + Keyboard::F, // 16 + Keyboard::G, // 17 + Keyboard::H, // 18 + Keyboard::J, // 19 + Keyboard::K, // 20 + Keyboard::L, // 21 + Keyboard::Semicolon, // 22 // Ö + Keyboard::Apostrophe, // 23 // Ä + Keyboard::LeftShift, // 24 + Keyboard::Z, // 25 + Keyboard::X, // 26 + Keyboard::C, // 27 + Keyboard::V, // 28 + Keyboard::B, // 29 + Keyboard::N, // 30 + Keyboard::M, // 31 + Keyboard::Comma, // 32 + Keyboard::Dot, // 33 + Keyboard::ForwardSlash, // 34 // - + Keyboard::RightShift, // 35 + Keyboard::LeftAlt, // 36 + Keyboard::NoEventIndicated, // 37 // Fn + Keyboard::Space, // 38 + Keyboard::Space, // 39 + Keyboard::NoEventIndicated, // 40 // Fn + Keyboard::RightAlt, // 41 + ], + [ + // Function layer 1 + // HID Key // Button Index + Keyboard::Escape, // 0 + Keyboard::F1, // 1 + Keyboard::F2, // 2 + Keyboard::F3, // 3 + Keyboard::F4, // 4 + Keyboard::F5, // 5 + Keyboard::F6, // 6 + Keyboard::F7, // 7 + Keyboard::F8, // 8 + Keyboard::F9, // 9 + Keyboard::F10, // 10 + Keyboard::DeleteBackspace, // 11 + Keyboard::LeftControl, // 12 + Keyboard::Keyboard1, // 13 + Keyboard::Keyboard2, // 14 + Keyboard::Keyboard3, // 15 + Keyboard::Keyboard4, // 16 + Keyboard::Keyboard5, // 17 + Keyboard::Keyboard6, // 18 + Keyboard::Keyboard7, // 19 + Keyboard::Keyboard8, // 20 + Keyboard::Keyboard9, // 21 + Keyboard::Keyboard0, // 22 + Keyboard::ReturnEnter, // 23 + Keyboard::LeftShift, // 24 + Keyboard::Keyboard6, // 25 + Keyboard::Keyboard7, // 26 + Keyboard::Keyboard8, // 27 + Keyboard::Keyboard9, // 28 + Keyboard::Keyboard0, // 29 + Keyboard::NonUSBackslash, // 30 // < + Keyboard::Equal, // 31 // ´ + Keyboard::Backslash, // 32 // ' + Keyboard::RightBrace, // 33 // ^ + Keyboard::Minus, // 34 // + + Keyboard::RightShift, // 35 + Keyboard::LeftAlt, // 36 + Keyboard::NoEventIndicated, // 37 // Fn + Keyboard::DeleteBackspace, // 38 + Keyboard::DeleteBackspace, // 39 + Keyboard::NoEventIndicated, // 40// Fn + Keyboard::RightAlt, // 41 + ], + [ + // Function layer 2 + // HID Key // Button Index + Keyboard::F11, // 0 + Keyboard::F12, // 1 + Keyboard::F13, // 2 + Keyboard::F14, // 3 + Keyboard::F15, // 4 + Keyboard::F16, // 5 + Keyboard::Grave, // 6 // § + Keyboard::NoEventIndicated, // 7 + Keyboard::LeftGUI, // 8 + Keyboard::NoEventIndicated, // 9 + Keyboard::CapsLock, // 10 + Keyboard::DeleteBackspace, // 11 + Keyboard::LeftControl, // 12 + Keyboard::NoEventIndicated, // 13 + Keyboard::NoEventIndicated, // 14 + Keyboard::F17, // 15 + Keyboard::F18, // 16 + Keyboard::F19, // 17 + Keyboard::LeftArrow, // 18 + Keyboard::DownArrow, // 19 + Keyboard::UpArrow, // 20 + Keyboard::RightArrow, // 21 + Keyboard::DeleteForward, // 22 + Keyboard::ReturnEnter, // 23 + Keyboard::LeftShift, // 24 + Keyboard::F20, // 25 + Keyboard::F21, // 26 + Keyboard::F22, // 27 + Keyboard::F23, // 28 + Keyboard::F24, // 29 + Keyboard::Home, // 30 + Keyboard::PageDown, // 31 + Keyboard::PageUp, // 32 + Keyboard::End, // 33 + Keyboard::Insert, // 34 + Keyboard::RightShift, // 35 + Keyboard::LeftAlt, // 36 + Keyboard::NoEventIndicated, // 37 // Fn + Keyboard::LeftGUI, // 38 + Keyboard::DeleteBackspace, // 39 + Keyboard::NoEventIndicated, // 40 // Fn + Keyboard::RightAlt, // 41 + ], +]; diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index aa4f73e..77e205a 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -1,6 +1,12 @@ +// TODO: Add license header +// TODO: Add documentation header +// TODO: GUI lock button support + #![no_std] #![no_main] +mod layout; + use core::convert::Infallible; use cortex_m::delay::Delay; use embedded_hal::digital::v2::*; @@ -31,13 +37,13 @@ pub const KEY_COLS: usize = 12; pub const NUMBER_OF_KEYS: usize = 42; #[derive(Copy, Clone)] -struct MatrixKey { +struct ButtonMatrix { current_state: bool, previous_state: bool, fn_mode: u8, } -impl MatrixKey { +impl ButtonMatrix { fn default() -> Self { Self { current_state: false, @@ -106,16 +112,17 @@ fn main() -> ! { timer.count_down(), ); - let mut matrix_keys: [MatrixKey; NUMBER_OF_KEYS] = [MatrixKey::default(); NUMBER_OF_KEYS]; + let mut button_matrix: [ButtonMatrix; NUMBER_OF_KEYS] = + [ButtonMatrix::default(); NUMBER_OF_KEYS]; - let matrix_rows: &[&dyn InputPin] = &[ + let button_matrix_row_pins: &[&dyn InputPin] = &[ &pins.gp0.into_pull_up_input(), &pins.gp1.into_pull_up_input(), &pins.gp29.into_pull_up_input(), &pins.gp28.into_pull_up_input(), ]; - let matrix_cols: &mut [&mut dyn OutputPin] = &mut [ + let button_matrix_col_pins: &mut [&mut dyn OutputPin] = &mut [ &mut pins.gp12.into_push_pull_output(), &mut pins.gp13.into_push_pull_output(), &mut pins.gp14.into_push_pull_output(), @@ -130,169 +137,16 @@ fn main() -> ! { &mut pins.gp11.into_push_pull_output(), ]; - // ------------------------------------- ------------------------------------- - // | 0 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | 11 | - // | 12 | 13 | 14 | 15 | 16 | 17 | | 18 | 19 | 20 | 21 | 22 | 23 | - // | 24 | 25 | 26 | 27 | 28 | 29 | | 30 | 31 | 32 | 33 | 34 | 35 | - // ------------------| 36 | 37 | 38 | | 39 | 40 | 41 |------------------ - // ------------------- ------------------- - // GRAVE = § - // SEMICOLON = ö - // APOSTROPHE = ä - // LEFT_BRACE = å - // FORWARDSLASH = - - // NON_US_BACKSLASH = < - // EQUAL = ´ - // BACKSLASH = ' - // RIGHT_BRACE = ^ - // MINUS = + - // LEFT_ALT = Alt - // RIGHT_ALT = AltGr - - let layout: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ - [ - // Function layer 0 - Keyboard::Tab, - Keyboard::Q, - Keyboard::W, - Keyboard::E, - Keyboard::R, - Keyboard::T, - Keyboard::Y, - Keyboard::U, - Keyboard::I, - Keyboard::O, - Keyboard::P, - Keyboard::LeftBrace, - Keyboard::LeftControl, - Keyboard::A, - Keyboard::S, - Keyboard::D, - Keyboard::F, - Keyboard::G, - Keyboard::H, - Keyboard::J, - Keyboard::K, - Keyboard::L, - Keyboard::Semicolon, - Keyboard::Apostrophe, - Keyboard::LeftShift, - Keyboard::Z, - Keyboard::X, - Keyboard::C, - Keyboard::V, - Keyboard::B, - Keyboard::N, - Keyboard::M, - Keyboard::Comma, - Keyboard::Dot, - Keyboard::ForwardSlash, - Keyboard::RightShift, - Keyboard::LeftAlt, - Keyboard::NoEventIndicated, - Keyboard::Space, - Keyboard::Space, - Keyboard::NoEventIndicated, - Keyboard::RightAlt, - ], - [ - // Function layer 1 - Keyboard::Escape, - Keyboard::F1, - Keyboard::F2, - Keyboard::F3, - Keyboard::F4, - Keyboard::F5, - Keyboard::F6, - Keyboard::F7, - Keyboard::F8, - Keyboard::F9, - Keyboard::F10, - Keyboard::DeleteBackspace, - Keyboard::LeftControl, - Keyboard::Keyboard1, - Keyboard::Keyboard2, - Keyboard::Keyboard3, - Keyboard::Keyboard4, - Keyboard::Keyboard5, - Keyboard::Keyboard6, - Keyboard::Keyboard7, - Keyboard::Keyboard8, - Keyboard::Keyboard9, - Keyboard::Keyboard0, - Keyboard::ReturnEnter, - Keyboard::LeftShift, - Keyboard::Keyboard6, - Keyboard::Keyboard7, - Keyboard::Keyboard8, - Keyboard::Keyboard9, - Keyboard::Keyboard0, - Keyboard::NonUSBackslash, - Keyboard::Equal, - Keyboard::Backslash, - Keyboard::RightBrace, - Keyboard::Minus, - Keyboard::RightShift, - Keyboard::LeftAlt, - Keyboard::NoEventIndicated, - Keyboard::DeleteBackspace, - Keyboard::DeleteBackspace, - Keyboard::NoEventIndicated, - Keyboard::RightAlt, - ], - [ - // Function layer 2 - Keyboard::F11, - Keyboard::F12, - Keyboard::F13, - Keyboard::F14, - Keyboard::F15, - Keyboard::F16, - Keyboard::Grave, - Keyboard::NoEventIndicated, - Keyboard::LeftGUI, - Keyboard::NoEventIndicated, - Keyboard::CapsLock, - Keyboard::DeleteBackspace, - Keyboard::LeftControl, - Keyboard::NoEventIndicated, - Keyboard::NoEventIndicated, - Keyboard::F17, - Keyboard::F18, - Keyboard::F19, - Keyboard::LeftArrow, - Keyboard::DownArrow, - Keyboard::UpArrow, - Keyboard::RightArrow, - Keyboard::DeleteForward, - Keyboard::ReturnEnter, - Keyboard::LeftShift, - Keyboard::F20, - Keyboard::F21, - Keyboard::F22, - Keyboard::F23, - Keyboard::F24, - Keyboard::Home, - Keyboard::PageDown, - Keyboard::PageUp, - Keyboard::End, - Keyboard::Insert, - Keyboard::RightShift, - Keyboard::LeftAlt, - Keyboard::NoEventIndicated, - Keyboard::LeftGUI, - Keyboard::DeleteBackspace, - Keyboard::NoEventIndicated, - Keyboard::RightAlt, - ], - ]; - - let mut input_count_down = timer.count_down(); - input_count_down.start(10.millis()); + let mut report_count_down = timer.count_down(); + report_count_down.start(10.millis()); let mut tick_count_down = timer.count_down(); tick_count_down.start(1.millis()); + let mut indicator_count_down = timer.count_down(); + indicator_count_down.start(250.millis()); + + let mut status_led_onoff: bool = false; let status_led_color: [RGB8; 5] = [ (0, 0, 0).into(), // Off (10, 7, 0).into(), // Green @@ -301,38 +155,52 @@ fn main() -> ! { (2, 20, 0).into(), // Red ]; - let mut caps_lock_active = false; + let mut caps_lock_active: bool = false; + let mut fn_mode: u8 = 0; - init_keyboard_matrix_pins(matrix_cols, &mut delay); + // Set all column pins to output and high + init_button_matrix_pins(button_matrix_col_pins, &mut delay); - // Infinite colour wheel loop loop { - if input_count_down.wait().is_ok() { - // Scan keyboard matrix - let pressed_keys = get_pressed_keys(matrix_rows, matrix_cols, &mut delay); - - // Get current function layer - let fn_mode = get_fn_mode(pressed_keys); - + if indicator_count_down.wait().is_ok() { // Set status LED colour based on function layer and capslock - // 0 = green, 1 = blue, 2 = orange, capslock active = red. - if caps_lock_active == true { + // 0 = green, 1 = blue, 2 = orange, capslock active = flashing. + if caps_lock_active == true && status_led_onoff == true { status_led - .write([status_led_color[4]].iter().copied()) + .write([status_led_color[0]].iter().copied()) .unwrap(); + status_led_onoff = false; } else { status_led .write([status_led_color[usize::from(fn_mode) + 1]].iter().copied()) .unwrap(); + status_led_onoff = true; } + } + if report_count_down.wait().is_ok() { + // Scan keyboard matrix + let pressed_keys = + get_pressed_buttons(button_matrix_row_pins, button_matrix_col_pins, &mut delay); + + // Get current function layer + fn_mode = get_fn_mode(pressed_keys); + + // Set status LED colour based on function layer and capslock + // 0 = green, 1 = blue, 2 = orange, capslock active = flashing. + if caps_lock_active == false { + status_led + .write([status_led_color[usize::from(fn_mode) + 1]].iter().copied()) + .unwrap(); + status_led_onoff = true; + } // Copy result from scanned keys to matrix struct for (index, key) in pressed_keys.iter().enumerate() { - matrix_keys[index].current_state = *key; + button_matrix[index].current_state = *key; } // Generate keyboard report - let keyboard_report = get_keyboard_report(matrix_keys, layout, fn_mode); + let keyboard_report = get_keyboard_report(&mut button_matrix, layout::MAP, fn_mode); match keyboard.device().write_report(keyboard_report) { Err(UsbHidError::WouldBlock) => {} @@ -376,10 +244,7 @@ fn main() -> ! { } // Initialise keyboard matrix pins -fn init_keyboard_matrix_pins( - cols: &mut [&mut dyn OutputPin], - delay: &mut Delay, -) { +fn init_button_matrix_pins(cols: &mut [&mut dyn OutputPin], delay: &mut Delay) { for col in cols.iter_mut() { col.set_high().unwrap(); } @@ -389,7 +254,7 @@ fn init_keyboard_matrix_pins( // Scan keyboard matrix for pressed keys and return a bool array // representing the state of each key (true = pressed) // TODO: This is a bit of a mess, needs refactoring -fn get_pressed_keys( +fn get_pressed_buttons( rows: &[&dyn InputPin], cols: &mut [&mut dyn OutputPin], delay: &mut Delay, @@ -425,18 +290,18 @@ fn get_pressed_keys( fn get_fn_mode(pressed_keys: [bool; NUMBER_OF_KEYS]) -> u8 { // Check Fn mode let mut fn_mode: u8 = 0; - if pressed_keys[37] == true && pressed_keys[40] == true { - fn_mode = 2; - } else if pressed_keys[37] == true || pressed_keys[40] == true { - fn_mode = 1; + for button_id in layout::FN_BUTTONS.iter() { + if pressed_keys[usize::from(*button_id)] == true { + fn_mode += 1; + } } fn_mode } // Generate keyboard report based on pressed keys and Fn mode (0, 1 or 2) fn get_keyboard_report( - mut matrix_keys: [MatrixKey; NUMBER_OF_KEYS], - layout: [[Keyboard; NUMBER_OF_KEYS]; 3], + matrix_keys: &mut [ButtonMatrix; NUMBER_OF_KEYS], + layout_map: [[Keyboard; NUMBER_OF_KEYS]; 3], fn_mode: u8, ) -> [Keyboard; NUMBER_OF_KEYS] { // Create default report @@ -445,11 +310,12 @@ fn get_keyboard_report( // Filter report based on Fn mode and pressed keys for (index, key) in matrix_keys.iter_mut().enumerate() { if key.current_state != key.previous_state && key.current_state == true { - key.previous_state = key.current_state; key.fn_mode = fn_mode; } + key.previous_state = key.current_state; + if key.current_state == true { - keyboard_report[index] = layout[usize::from(key.fn_mode)][index]; + keyboard_report[index] = layout_map[usize::from(key.fn_mode)][index]; } } // Return report From a016db353f39cca6f71d225cd9592341c97720be Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Tue, 20 Jun 2023 09:40:49 +0000 Subject: [PATCH 10/27] Upload New File --- mCAD/cmdr-keyboard-42-v1_photo_2.jpg | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 mCAD/cmdr-keyboard-42-v1_photo_2.jpg diff --git a/mCAD/cmdr-keyboard-42-v1_photo_2.jpg b/mCAD/cmdr-keyboard-42-v1_photo_2.jpg new file mode 100644 index 0000000..375e007 --- /dev/null +++ b/mCAD/cmdr-keyboard-42-v1_photo_2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a6b406ff0de62c564660b9591643a20e6ce375fd52ac5322cb76f804b3051bc +size 1403386 From a69ae259a2bd1af5bf9c1fef1700f7c9c65d6a13 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Tue, 20 Jun 2023 09:41:20 +0000 Subject: [PATCH 11/27] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0bee819..a2eaa27 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CMDR keyboard 42 -![image](mCAD/cmdr-keyboard-42-v1_photo.png) +![image](mCAD/cmdr-keyboard-42-v1_photo_2.jpg) Keyboard based on standard teensy "Keypad" library for button scanning, standard teensy "usb_keyboard" library for HID keyboard usb data communication. From edc908fe9b6d599e7073eccdf43da81e54d51269 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Tue, 20 Jun 2023 09:49:48 +0000 Subject: [PATCH 12/27] Update README.md --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a2eaa27..e764f68 100644 --- a/README.md +++ b/README.md @@ -42,22 +42,27 @@ Keyboard based on standard teensy "Keypad" library for button scanning, standard - LED flashing = Caps Lock activated - LED on = Gui key lock activated -## Build environment +## Build environment TeensyLC +C/C++, Teensy arduino framework -- Platformio - - env: teensylc - - platform: teensy - - board: teensylc - - framework: arduino +- Platformio (platformio.ini) - Flashing via Teensy USB bootloader - Pressing boot button on teensy - Pressing all four corners on the keyboard +## Build environment rp2040 Zero +Rust embedded, rp2040 HAL + +- Cargo (cargo.toml) +- Flashing via rp2040 USB bootloader + - Pressing reset/boot button on rp2040 Zero board + - Pressing all four corners on the keyboard + ## Hardware [Schematics](build/cmdr_mainboard_v1.pdf) -- 1x TeensyLC MCU +- 1x TeensyLC alt 1x rp2040 Zero - 36x Cherry MX compatible switches - 6x Kailh Choc low profile switches - 42x 1N4148 diodes From a70cc23906a57768f41d97b756dcd21947866ec7 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Wed, 21 Jun 2023 00:36:03 +0200 Subject: [PATCH 13/27] Changed enter key position --- rp2040/src/layout.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rp2040/src/layout.rs b/rp2040/src/layout.rs index 72db05c..7fcab37 100644 --- a/rp2040/src/layout.rs +++ b/rp2040/src/layout.rs @@ -26,7 +26,7 @@ use crate::NUMBER_OF_KEYS; use usbd_human_interface_device::page::Keyboard; // Function (Fn) buttons index (need two buttons) -pub const FN_BUTTONS: [u8; 2] = [37, 40]; +pub const FN_BUTTONS: [u8; 3] = [37, 40, 41]; // Button map to HID key (three Function layers) pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ @@ -72,7 +72,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::LeftAlt, // 36 Keyboard::NoEventIndicated, // 37 // Fn Keyboard::Space, // 38 - Keyboard::Space, // 39 + Keyboard::ReturnEnter, // 39 Keyboard::NoEventIndicated, // 40 // Fn Keyboard::RightAlt, // 41 ], @@ -90,7 +90,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::F8, // 8 Keyboard::F9, // 9 Keyboard::F10, // 10 - Keyboard::DeleteBackspace, // 11 + Keyboard::NoEventIndicated, // 11 Keyboard::LeftControl, // 12 Keyboard::Keyboard1, // 13 Keyboard::Keyboard2, // 14 @@ -102,7 +102,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::Keyboard8, // 20 Keyboard::Keyboard9, // 21 Keyboard::Keyboard0, // 22 - Keyboard::ReturnEnter, // 23 + Keyboard::NoEventIndicated, // 23 Keyboard::LeftShift, // 24 Keyboard::Keyboard6, // 25 Keyboard::Keyboard7, // 26 @@ -118,7 +118,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::LeftAlt, // 36 Keyboard::NoEventIndicated, // 37 // Fn Keyboard::DeleteBackspace, // 38 - Keyboard::DeleteBackspace, // 39 + Keyboard::ReturnEnter, // 39 Keyboard::NoEventIndicated, // 40// Fn Keyboard::RightAlt, // 41 ], @@ -136,7 +136,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::LeftGUI, // 8 Keyboard::NoEventIndicated, // 9 Keyboard::CapsLock, // 10 - Keyboard::DeleteBackspace, // 11 + Keyboard::NoEventIndicated, // 11 Keyboard::LeftControl, // 12 Keyboard::NoEventIndicated, // 13 Keyboard::NoEventIndicated, // 14 @@ -148,7 +148,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::UpArrow, // 20 Keyboard::RightArrow, // 21 Keyboard::DeleteForward, // 22 - Keyboard::ReturnEnter, // 23 + Keyboard::NoEventIndicated, // 23 Keyboard::LeftShift, // 24 Keyboard::F20, // 25 Keyboard::F21, // 26 @@ -164,7 +164,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::LeftAlt, // 36 Keyboard::NoEventIndicated, // 37 // Fn Keyboard::LeftGUI, // 38 - Keyboard::DeleteBackspace, // 39 + Keyboard::ReturnEnter, // 39 Keyboard::NoEventIndicated, // 40 // Fn Keyboard::RightAlt, // 41 ], From 9759aeba5ed5a63140f070a9c3fd2a792a15e448 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Wed, 21 Jun 2023 00:37:05 +0200 Subject: [PATCH 14/27] Code cleanup. Added bootloader mode --- rp2040/src/main.rs | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index 77e205a..ffaf97d 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -5,8 +5,6 @@ #![no_std] #![no_main] -mod layout; - use core::convert::Infallible; use cortex_m::delay::Delay; use embedded_hal::digital::v2::*; @@ -32,6 +30,8 @@ use waveshare_rp2040_zero::{ }; use ws2812_pio::Ws2812; +mod layout; + pub const KEY_ROWS: usize = 4; pub const KEY_COLS: usize = 12; pub const NUMBER_OF_KEYS: usize = 42; @@ -115,14 +115,14 @@ fn main() -> ! { let mut button_matrix: [ButtonMatrix; NUMBER_OF_KEYS] = [ButtonMatrix::default(); NUMBER_OF_KEYS]; - let button_matrix_row_pins: &[&dyn InputPin] = &[ + let button_matrix_row_pins: &[&dyn InputPin; KEY_ROWS] = &[ &pins.gp0.into_pull_up_input(), &pins.gp1.into_pull_up_input(), &pins.gp29.into_pull_up_input(), &pins.gp28.into_pull_up_input(), ]; - let button_matrix_col_pins: &mut [&mut dyn OutputPin] = &mut [ + let button_matrix_col_pins: &mut [&mut dyn OutputPin; KEY_COLS] = &mut [ &mut pins.gp12.into_push_pull_output(), &mut pins.gp13.into_push_pull_output(), &mut pins.gp14.into_push_pull_output(), @@ -147,17 +147,18 @@ fn main() -> ! { indicator_count_down.start(250.millis()); let mut status_led_onoff: bool = false; - let status_led_color: [RGB8; 5] = [ + let mut caps_lock_active: bool = false; + let mut fn_mode: u8 = 0; + + let status_led_colors: [RGB8; 6] = [ (0, 0, 0).into(), // Off (10, 7, 0).into(), // Green (10, 4, 10).into(), // Blue (5, 10, 0).into(), // Orange (2, 20, 0).into(), // Red + (0, 10, 10).into(), // Purple ]; - let mut caps_lock_active: bool = false; - let mut fn_mode: u8 = 0; - // Set all column pins to output and high init_button_matrix_pins(button_matrix_col_pins, &mut delay); @@ -167,12 +168,12 @@ fn main() -> ! { // 0 = green, 1 = blue, 2 = orange, capslock active = flashing. if caps_lock_active == true && status_led_onoff == true { status_led - .write([status_led_color[0]].iter().copied()) + .write([status_led_colors[0]].iter().copied()) .unwrap(); status_led_onoff = false; } else { status_led - .write([status_led_color[usize::from(fn_mode) + 1]].iter().copied()) + .write([status_led_colors[usize::from(fn_mode) + 1]].iter().copied()) .unwrap(); status_led_onoff = true; } @@ -183,6 +184,23 @@ fn main() -> ! { let pressed_keys = get_pressed_buttons(button_matrix_row_pins, button_matrix_col_pins, &mut delay); + // Check if all four corners are pressed, if so, reset to USB boot mode + if pressed_keys[0] == true + && pressed_keys[11] == true + && pressed_keys[24] == true + && pressed_keys[35] == true + { + status_led + .write([status_led_colors[5]].iter().copied()) + .unwrap(); + delay.delay_us(100); + let gpio_activity_pin_mask = 0; + let disable_interface_mask = 0; + rp2040_hal::rom_data::reset_to_usb_boot( + gpio_activity_pin_mask, + disable_interface_mask, + ); + } // Get current function layer fn_mode = get_fn_mode(pressed_keys); @@ -190,7 +208,7 @@ fn main() -> ! { // 0 = green, 1 = blue, 2 = orange, capslock active = flashing. if caps_lock_active == false { status_led - .write([status_led_color[usize::from(fn_mode) + 1]].iter().copied()) + .write([status_led_colors[usize::from(fn_mode) + 1]].iter().copied()) .unwrap(); status_led_onoff = true; } @@ -253,7 +271,6 @@ fn init_button_matrix_pins(cols: &mut [&mut dyn OutputPin], // Scan keyboard matrix for pressed keys and return a bool array // representing the state of each key (true = pressed) -// TODO: This is a bit of a mess, needs refactoring fn get_pressed_buttons( rows: &[&dyn InputPin], cols: &mut [&mut dyn OutputPin], @@ -295,6 +312,9 @@ fn get_fn_mode(pressed_keys: [bool; NUMBER_OF_KEYS]) -> u8 { fn_mode += 1; } } + if fn_mode > 2 { + fn_mode = 2; + } fn_mode } From e6f599cfd21c91fe472fa5bc5e93cb3ecb3307fb Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Wed, 21 Jun 2023 00:48:21 +0200 Subject: [PATCH 15/27] Updated readme --- README.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e764f68..6d8c81f 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,6 @@ ![image](mCAD/cmdr-keyboard-42-v1_photo_2.jpg) -Keyboard based on standard teensy "Keypad" library for button scanning, standard teensy -"usb_keyboard" library for HID keyboard usb data communication. - ## Layout ```cpp @@ -13,21 +10,21 @@ Keyboard based on standard teensy "Keypad" library for button scanning, standard | Tab | Q | W | E | R | T | | Y | U | I | O | P | Å | | LCtrl | A | S | D | F | G | | H | J | K | L | Ö | Ä | | Shift | Z | X | C | V | B | | N | M | , | . | - | Shift | - --------------------| Alt | Fn | Spc | | Spc | Fn | |-------------------- + --------------------| Alt | Fn | Spc | |Enter| Fn |AG+Fn|-------------------- ------------------- ------------------- Layer 1 (Fn) --------------------------------------- --------------------------------------- - | Esc | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | BSpc | - | LCtrl | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Enter | + | Esc | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | + | LCtrl | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | | Shift | 6 | 7 | 8 | 9 | 0 | | < | ´ | ' | ¨ | + | Shift | - --------------------| Alt | Fn | BSpc| | BSpc| Fn |AlrGr|-------------------- + --------------------| Alt | Fn | BSpc| |Enter| Fn |AG+Fn|-------------------- ------------------- ------------------- Layer 2 (Fn + Fn) --------------------------------------- --------------------------------------- - | F11 | F12 | F13 | F14 | F15 | F16 | | § |GuiLK| Gui | | CpLk| BSpc | - | LCtrl | Play| Next| F17 | F18 | F19 | | Left| Down| Up |Right| Del | Enter | + | F11 | F12 | F13 | F14 | F15 | F16 | | § |GuiLK| Gui | | CpLk| | + | LCtrl | | | F17 | F18 | F19 | | Left| Down| Up |Right| Del | | | Shift | F20 | F21 | F22 | F23 | F24 | | Home| PgD | PgU | End | Ins | Shift | - --------------------| Alt | Fn | Gui | | BSpc| Fn | |-------------------- + --------------------| Alt | Fn | Gui | |Enter| Fn |AG+Fn|-------------------- ------------------- ------------------- ``` From 7967ceb623c1c265eb4a0990d0bfd45e231541c8 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Wed, 21 Jun 2023 00:49:14 +0200 Subject: [PATCH 16/27] Changed keymap --- teensylc/src/cmdr_keyboard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/teensylc/src/cmdr_keyboard.cpp b/teensylc/src/cmdr_keyboard.cpp index 3eaa7f3..53c9dab 100755 --- a/teensylc/src/cmdr_keyboard.cpp +++ b/teensylc/src/cmdr_keyboard.cpp @@ -98,7 +98,7 @@ Button buttons[NBR_OF_BUTTONS] = /* 9 */ {KEY_I, KEY_F8, KEY_LEFT_GUI, IDLE, NO_KEY, false}, /* 10 */ {KEY_O, KEY_F9, NO_KEY, IDLE, NO_KEY, false}, /* 11 */ {KEY_P, KEY_F10, KEY_CAPS_LOCK, IDLE, NO_KEY, false}, -/* 12 */ {KEY_LEFT_BRACE, KEY_BACKSPACE, KEY_BACKSPACE, IDLE, NO_KEY, false}, +/* 12 */ {KEY_LEFT_BRACE, NO_KEY, NO_KEY, IDLE, NO_KEY, false}, /* 13 */ {KEY_LEFT_CTRL, KEY_LEFT_CTRL, KEY_LEFT_CTRL, IDLE, NO_KEY, false}, /* 14 */ {KEY_A, KEY_1, KEY_MEDIA_PLAY_PAUSE, IDLE, NO_KEY, false}, /* 15 */ {KEY_S, KEY_2, KEY_MEDIA_NEXT_TRACK, IDLE, NO_KEY, false}, @@ -110,7 +110,7 @@ Button buttons[NBR_OF_BUTTONS] = /* 21 */ {KEY_K, KEY_8, KEY_UP_ARROW, IDLE, NO_KEY, false}, /* 22 */ {KEY_L, KEY_9, KEY_RIGHT_ARROW, IDLE, NO_KEY, false}, /* 23 */ {KEY_SEMICOLON, KEY_0, KEY_DELETE, IDLE, NO_KEY, false}, -/* 24 */ {KEY_QUOTE, KEY_ENTER, KEY_ENTER, IDLE, NO_KEY, false}, +/* 24 */ {KEY_QUOTE, NO_KEY, NO_KEY, IDLE, NO_KEY, false}, /* 25 */ {KEY_LEFT_SHIFT, KEY_LEFT_SHIFT, KEY_LEFT_SHIFT, IDLE, NO_KEY, false}, /* 26 */ {KEY_Z, KEY_6, KEY_F20, IDLE, NO_KEY, false}, /* 27 */ {KEY_X, KEY_7, KEY_F21, IDLE, NO_KEY, false}, @@ -126,7 +126,7 @@ Button buttons[NBR_OF_BUTTONS] = /* 37 */ {KEY_LEFT_ALT, KEY_LEFT_ALT, KEY_LEFT_ALT, IDLE, NO_KEY, false}, /* 38 */ {KEY_FN, NO_KEY, NO_KEY, IDLE, NO_KEY, false}, /* 39 */ {KEY_SPACE, KEY_BACKSPACE, KEY_LEFT_GUI, IDLE, NO_KEY, false}, -/* 40 */ {KEY_SPACE, KEY_BACKSPACE, KEY_BACKSPACE, IDLE, NO_KEY, false}, +/* 40 */ {KEY_ENTER, KEY_ENTER, KEY_ENTER, IDLE, NO_KEY, false}, /* 41 */ {KEY_FN, NO_KEY, NO_KEY, IDLE, NO_KEY, false}, /* 42 */ {KEY_FN, KEY_RIGHT_ALT, NO_KEY, IDLE, NO_KEY, false}}; From 308b6d708cb3296c83f33cb3f7bdac90f553023f Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Thu, 29 Jun 2023 17:28:38 +0200 Subject: [PATCH 17/27] Code --- rp2040/Cargo.toml | 3 +- rp2040/src/button_matrix.rs | 98 ++++++++++++++++++++ rp2040/src/layout.rs | 86 +++++++++++------- rp2040/src/main.rs | 175 ++++++++++++++---------------------- rp2040/src/status_led.rs | 81 +++++++++++++++++ 5 files changed, 300 insertions(+), 143 deletions(-) create mode 100644 rp2040/src/button_matrix.rs create mode 100644 rp2040/src/status_led.rs diff --git a/rp2040/Cargo.toml b/rp2040/Cargo.toml index 42dc6fd..22abcb5 100644 --- a/rp2040/Cargo.toml +++ b/rp2040/Cargo.toml @@ -14,11 +14,12 @@ embedded-hal ="0.2.5" fugit = "0.3.5" nb = "1.0.0" smart-leds = "0.3.0" +smart-leds-trait = "0.2.1" ws2812-pio = "0.6.0" usbd-human-interface-device = "0.4.2" usb-device = "0.2" packed_struct = { version = "0.10", default-features = false } -keypad = "0.2.2" +pio = "0.2.0" [features] # This is the set of features we enable by default diff --git a/rp2040/src/button_matrix.rs b/rp2040/src/button_matrix.rs new file mode 100644 index 0000000..ff1f021 --- /dev/null +++ b/rp2040/src/button_matrix.rs @@ -0,0 +1,98 @@ +use core::convert::Infallible; +use cortex_m::delay::Delay; +use embedded_hal::digital::v2::*; + +pub const DEBOUNCE_COUNT: u8 = 5; + +pub struct ButtonMatrix<'a, const R: usize, const C: usize, const N: usize> { + rows: &'a [&'a dyn InputPin; R], + cols: &'a mut [&'a mut dyn OutputPin; C], + delay: &'a mut Delay, + state: [bool; N], + state_raw: [bool; N], + debounce_counter: [u8; N], +} + +impl<'a, const R: usize, const C: usize, const N: usize> ButtonMatrix<'a, R, C, N> { + pub fn new( + rows: &'a [&'a dyn InputPin; R], + cols: &'a mut [&'a mut dyn OutputPin; C], + delay: &'a mut Delay, + ) -> Self { + Self { + rows, + cols, + delay, + state: [false; N], + state_raw: [false; N], + debounce_counter: [0; N], + } + } + + pub fn init_pins(&mut self) { + for col in self.cols.iter_mut() { + col.set_high().unwrap(); + } + self.delay.delay_us(10); + } + + pub fn scan_matrix(&mut self) { + for col_index in 0..self.cols.len() { + self.cols[col_index].set_low().unwrap(); + self.delay.delay_us(10); + self.process_column(col_index); + self.cols[col_index].set_high().unwrap(); + self.delay.delay_us(10); + } + } + + fn process_column(&mut self, col_index: usize) { + for row_index in 0..self.rows.len() { + let button_index: usize = col_index + (row_index * C); + let current_state = self.rows[row_index].is_low().unwrap(); + self.state_raw[button_index] = current_state; + + if current_state == self.state[button_index] { + self.debounce_counter[button_index] = 0; + continue; + } + + self.debounce_counter[button_index] += 1; + if self.debounce_counter[button_index] >= DEBOUNCE_COUNT { + self.state[button_index] = current_state; + } + } + } + + // pub fn scan_matrix(&mut self) { + // for (col_index, col) in self.cols.iter_mut().enumerate() { + // col.set_low().unwrap(); + // self.delay.delay_us(10); + // + // for (row_index, row) in self.rows.iter().enumerate() { + // let button_index: usize = col_index + (row_index * C); + // let current_state = row.is_low().unwrap(); + // self.state_raw[button_index] = current_state; + // + // if current_state == self.state[button_index] { + // self.debounce_counter[button_index] = 0; + // } else { + // self.debounce_counter[button_index] += 1; + // if self.debounce_counter[button_index] >= DEBOUNCE_COUNT { + // self.state[button_index] = current_state; + // } + // } + // } + // col.set_high().unwrap(); + // self.delay.delay_us(10); + // } + // } + + pub fn get_button_state(&mut self) -> [bool; N] { + self.state + } + + pub fn get_button_state_raw(&mut self) -> [bool; N] { + self.state_raw + } +} diff --git a/rp2040/src/layout.rs b/rp2040/src/layout.rs index 7fcab37..b8de35c 100644 --- a/rp2040/src/layout.rs +++ b/rp2040/src/layout.rs @@ -3,8 +3,8 @@ // | 0 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | 11 | // | 12 | 13 | 14 | 15 | 16 | 17 | | 18 | 19 | 20 | 21 | 22 | 23 | // | 24 | 25 | 26 | 27 | 28 | 29 | | 30 | 31 | 32 | 33 | 34 | 35 | -// ------------------| 36 | 37 | 38 | | 39 | 40 | 41 |------------------ -// ------------------- ------------------- +// ------------------| 39 | 40 | 41 | | 42 | 43 | 44 |------------------ +// 36 37 38 ------------------- ------------------- 45 46 47 // // Swedish keymap conversion table: // US Swedish @@ -26,13 +26,15 @@ use crate::NUMBER_OF_KEYS; use usbd_human_interface_device::page::Keyboard; // Function (Fn) buttons index (need two buttons) -pub const FN_BUTTONS: [u8; 3] = [37, 40, 41]; - +// Button 41 are used both as Fn and RightAlt (AltGr) for better ergonomics. +// This means that RightAlt is only available on layer 1 keys. +pub const FN_BUTTONS: [u8; 3] = [40, 43, 44]; // Button map to HID key (three Function layers) pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ [ // Function layer 0 // HID Key // Button Index + // ----------------------------------------- Keyboard::Tab, // 0 Keyboard::Q, // 1 Keyboard::W, // 2 @@ -44,7 +46,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::I, // 8 Keyboard::O, // 9 Keyboard::P, // 10 - Keyboard::LeftBrace, // 11 // Å + Keyboard::LeftBrace, // 11 å Keyboard::LeftControl, // 12 Keyboard::A, // 13 Keyboard::S, // 14 @@ -55,8 +57,8 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::J, // 19 Keyboard::K, // 20 Keyboard::L, // 21 - Keyboard::Semicolon, // 22 // Ö - Keyboard::Apostrophe, // 23 // Ä + Keyboard::Semicolon, // 22 ö + Keyboard::Apostrophe, // 23 ä Keyboard::LeftShift, // 24 Keyboard::Z, // 25 Keyboard::X, // 26 @@ -67,18 +69,25 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::M, // 31 Keyboard::Comma, // 32 Keyboard::Dot, // 33 - Keyboard::ForwardSlash, // 34 // - + Keyboard::ForwardSlash, // 34 - Keyboard::RightShift, // 35 - Keyboard::LeftAlt, // 36 - Keyboard::NoEventIndicated, // 37 // Fn - Keyboard::Space, // 38 - Keyboard::ReturnEnter, // 39 - Keyboard::NoEventIndicated, // 40 // Fn - Keyboard::RightAlt, // 41 + Keyboard::NoEventIndicated, // 36 no button connected + Keyboard::NoEventIndicated, // 37 no button connected + Keyboard::NoEventIndicated, // 38 no button connected + Keyboard::LeftAlt, // 39 + Keyboard::NoEventIndicated, // 40 Fn (= will never trigg this layer) + Keyboard::Space, // 41 + Keyboard::ReturnEnter, // 42 + Keyboard::NoEventIndicated, // 43 Fn (= will never trigg this layer) + Keyboard::NoEventIndicated, // 44 Fn (= will never trigg this layer) + Keyboard::NoEventIndicated, // 45 no button connected + Keyboard::NoEventIndicated, // 46 no button connected + Keyboard::NoEventIndicated, // 47 no button connected ], [ // Function layer 1 // HID Key // Button Index + // ----------------------------------------- Keyboard::Escape, // 0 Keyboard::F1, // 1 Keyboard::F2, // 2 @@ -109,29 +118,36 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::Keyboard8, // 27 Keyboard::Keyboard9, // 28 Keyboard::Keyboard0, // 29 - Keyboard::NonUSBackslash, // 30 // < - Keyboard::Equal, // 31 // ´ - Keyboard::Backslash, // 32 // ' - Keyboard::RightBrace, // 33 // ^ - Keyboard::Minus, // 34 // + + Keyboard::NonUSBackslash, // 30 < + Keyboard::Equal, // 31 ´ + Keyboard::Backslash, // 32 ' + Keyboard::RightBrace, // 33 ^ + Keyboard::Minus, // 34 + Keyboard::RightShift, // 35 - Keyboard::LeftAlt, // 36 - Keyboard::NoEventIndicated, // 37 // Fn - Keyboard::DeleteBackspace, // 38 - Keyboard::ReturnEnter, // 39 - Keyboard::NoEventIndicated, // 40// Fn - Keyboard::RightAlt, // 41 + Keyboard::NoEventIndicated, // 36 no button connected + Keyboard::NoEventIndicated, // 37 no button connected + Keyboard::NoEventIndicated, // 38 no button connected + Keyboard::LeftAlt, // 39 + Keyboard::NoEventIndicated, // 40 Fn + Keyboard::DeleteBackspace, // 41 + Keyboard::ReturnEnter, // 42 + Keyboard::NoEventIndicated, // 43 Fn + Keyboard::RightAlt, // 44 Fn + Keyboard::NoEventIndicated, // 45 no button connected + Keyboard::NoEventIndicated, // 46 no button connected + Keyboard::NoEventIndicated, // 47 no button connected ], [ // Function layer 2 // HID Key // Button Index + // ----------------------------------------- Keyboard::F11, // 0 Keyboard::F12, // 1 Keyboard::F13, // 2 Keyboard::F14, // 3 Keyboard::F15, // 4 Keyboard::F16, // 5 - Keyboard::Grave, // 6 // § + Keyboard::Grave, // 6 § Keyboard::NoEventIndicated, // 7 Keyboard::LeftGUI, // 8 Keyboard::NoEventIndicated, // 9 @@ -161,11 +177,17 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::End, // 33 Keyboard::Insert, // 34 Keyboard::RightShift, // 35 - Keyboard::LeftAlt, // 36 - Keyboard::NoEventIndicated, // 37 // Fn - Keyboard::LeftGUI, // 38 - Keyboard::ReturnEnter, // 39 - Keyboard::NoEventIndicated, // 40 // Fn - Keyboard::RightAlt, // 41 + Keyboard::NoEventIndicated, // 36 no button connected + Keyboard::NoEventIndicated, // 37 no button connected + Keyboard::NoEventIndicated, // 38 no button connected + Keyboard::LeftAlt, // 39 + Keyboard::NoEventIndicated, // 40 Fn + Keyboard::LeftGUI, // 41 + Keyboard::ReturnEnter, // 42 + Keyboard::NoEventIndicated, // 43 Fn + Keyboard::NoEventIndicated, // 44 Fn + Keyboard::NoEventIndicated, // 45 no button connected + Keyboard::NoEventIndicated, // 46 no button connected + Keyboard::NoEventIndicated, // 47 no button connected ], ]; diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index ffaf97d..7d8c829 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -5,13 +5,21 @@ #![no_std] #![no_main] +mod button_matrix; +mod layout; +mod status_led; + +use crate::status_led::{StatusMode, Ws2812StatusLed}; +use button_matrix::ButtonMatrix; use core::convert::Infallible; -use cortex_m::delay::Delay; use embedded_hal::digital::v2::*; use embedded_hal::timer::CountDown; use fugit::ExtU32; use panic_halt as _; -use smart_leds::{SmartLedsWrite, RGB8}; +use rp2040_hal::{ + gpio::{Function, FunctionConfig, PinId, ValidPinMode}, + pio::StateMachineIndex, +}; use usb_device::class_prelude::*; use usb_device::prelude::*; use usbd_human_interface_device::page::Keyboard; @@ -28,23 +36,20 @@ use waveshare_rp2040_zero::{ }, Pins, XOSC_CRYSTAL_FREQ, }; -use ws2812_pio::Ws2812; - -mod layout; pub const KEY_ROWS: usize = 4; pub const KEY_COLS: usize = 12; -pub const NUMBER_OF_KEYS: usize = 42; +pub const NUMBER_OF_KEYS: usize = KEY_ROWS * KEY_COLS; #[derive(Copy, Clone)] -struct ButtonMatrix { - current_state: bool, - previous_state: bool, - fn_mode: u8, +pub struct KeyboardButton { + pub current_state: bool, + pub previous_state: bool, + pub fn_mode: u8, } -impl ButtonMatrix { - fn default() -> Self { +impl KeyboardButton { + pub fn default() -> Self { Self { current_state: false, previous_state: false, @@ -104,17 +109,13 @@ fn main() -> ! { // Configure the status LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); - let mut status_led = Ws2812::new( + let mut status_led = Ws2812StatusLed::new( pins.neopixel.into_mode(), &mut pio, sm0, clocks.peripheral_clock.freq(), - timer.count_down(), ); - let mut button_matrix: [ButtonMatrix; NUMBER_OF_KEYS] = - [ButtonMatrix::default(); NUMBER_OF_KEYS]; - let button_matrix_row_pins: &[&dyn InputPin; KEY_ROWS] = &[ &pins.gp0.into_pull_up_input(), &pins.gp1.into_pull_up_input(), @@ -137,6 +138,11 @@ fn main() -> ! { &mut pins.gp11.into_push_pull_output(), ]; + let mut button_matrix: ButtonMatrix = + ButtonMatrix::new(button_matrix_row_pins, button_matrix_col_pins, &mut delay); + + let mut buttons: [KeyboardButton; NUMBER_OF_KEYS] = [KeyboardButton::default(); NUMBER_OF_KEYS]; + let mut report_count_down = timer.count_down(); report_count_down.start(10.millis()); @@ -146,79 +152,44 @@ fn main() -> ! { let mut indicator_count_down = timer.count_down(); indicator_count_down.start(250.millis()); - let mut status_led_onoff: bool = false; let mut caps_lock_active: bool = false; let mut fn_mode: u8 = 0; - let status_led_colors: [RGB8; 6] = [ - (0, 0, 0).into(), // Off - (10, 7, 0).into(), // Green - (10, 4, 10).into(), // Blue - (5, 10, 0).into(), // Orange - (2, 20, 0).into(), // Red - (0, 10, 10).into(), // Purple - ]; - // Set all column pins to output and high - init_button_matrix_pins(button_matrix_col_pins, &mut delay); + button_matrix.init_pins(); + + // Check if esc pressed while power on. If yes then enter bootloader + button_matrix.scan_matrix(); + if button_matrix.get_button_state_raw()[0] == true { + status_led.update(StatusMode::BOOTLOADER); + let gpio_activity_pin_mask = 0; + let disable_interface_mask = 0; + rp2040_hal::rom_data::reset_to_usb_boot(gpio_activity_pin_mask, disable_interface_mask); + } loop { if indicator_count_down.wait().is_ok() { - // Set status LED colour based on function layer and capslock - // 0 = green, 1 = blue, 2 = orange, capslock active = flashing. - if caps_lock_active == true && status_led_onoff == true { - status_led - .write([status_led_colors[0]].iter().copied()) - .unwrap(); - status_led_onoff = false; - } else { - status_led - .write([status_led_colors[usize::from(fn_mode) + 1]].iter().copied()) - .unwrap(); - status_led_onoff = true; - } + update_status_led(&mut status_led, fn_mode, caps_lock_active); } if report_count_down.wait().is_ok() { // Scan keyboard matrix - let pressed_keys = - get_pressed_buttons(button_matrix_row_pins, button_matrix_col_pins, &mut delay); + let pressed_keys = button_matrix.get_button_state(); - // Check if all four corners are pressed, if so, reset to USB boot mode - if pressed_keys[0] == true - && pressed_keys[11] == true - && pressed_keys[24] == true - && pressed_keys[35] == true - { - status_led - .write([status_led_colors[5]].iter().copied()) - .unwrap(); - delay.delay_us(100); - let gpio_activity_pin_mask = 0; - let disable_interface_mask = 0; - rp2040_hal::rom_data::reset_to_usb_boot( - gpio_activity_pin_mask, - disable_interface_mask, - ); - } // Get current function layer fn_mode = get_fn_mode(pressed_keys); - // Set status LED colour based on function layer and capslock - // 0 = green, 1 = blue, 2 = orange, capslock active = flashing. if caps_lock_active == false { - status_led - .write([status_led_colors[usize::from(fn_mode) + 1]].iter().copied()) - .unwrap(); - status_led_onoff = true; + update_status_led(&mut status_led, fn_mode, caps_lock_active); } + // Copy result from scanned keys to matrix struct for (index, key) in pressed_keys.iter().enumerate() { - button_matrix[index].current_state = *key; + buttons[index].current_state = *key; } // Generate keyboard report - let keyboard_report = get_keyboard_report(&mut button_matrix, layout::MAP, fn_mode); + let keyboard_report = get_keyboard_report(&mut buttons, layout::MAP, fn_mode); match keyboard.device().write_report(keyboard_report) { Err(UsbHidError::WouldBlock) => {} @@ -232,6 +203,8 @@ fn main() -> ! { //Tick once per ms if tick_count_down.wait().is_ok() { + button_matrix.scan_matrix(); + match keyboard.tick() { Err(UsbHidError::WouldBlock) => {} Ok(_) => {} @@ -261,54 +234,36 @@ fn main() -> ! { } } -// Initialise keyboard matrix pins -fn init_button_matrix_pins(cols: &mut [&mut dyn OutputPin], delay: &mut Delay) { - for col in cols.iter_mut() { - col.set_high().unwrap(); - } - delay.delay_us(10); -} - -// Scan keyboard matrix for pressed keys and return a bool array -// representing the state of each key (true = pressed) -fn get_pressed_buttons( - rows: &[&dyn InputPin], - cols: &mut [&mut dyn OutputPin], - delay: &mut Delay, -) -> [bool; NUMBER_OF_KEYS] { - // Scan keyboard matrix for pressed keys - let mut pressed_keys: [bool; NUMBER_OF_KEYS] = [false; NUMBER_OF_KEYS]; - for (col_index, col) in cols.iter_mut().enumerate() { - // Activate column - col.set_low().unwrap(); - delay.delay_us(10); - - // Read rows - for (row_index, row) in rows.iter().enumerate() { - // Do not check unconnected keys in the matrix - if row_index == 3 && (col_index < 3 || col_index > 8) { - continue; - } - if row_index < 3 && row.is_low().unwrap() { - pressed_keys[col_index + (row_index * KEY_COLS)] = true; - } else if row.is_low().unwrap() { - // Correct index for unconnected keys - pressed_keys[col_index + (row_index * KEY_COLS) - 3] = true; - } +// Set status LED colour based on function layer and capslock +// 0 = green, 1 = blue, 2 = orange, capslock active = flashing red. +fn update_status_led( + status_led: &mut Ws2812StatusLed, + fn_mode: u8, + caps_lock_active: bool, +) where + P: PIOExt + FunctionConfig, + I: PinId, + Function

: ValidPinMode, + SM: StateMachineIndex, +{ + if caps_lock_active == true { + status_led.update(StatusMode::WARNING); + } else { + match fn_mode { + 0 => status_led.update(StatusMode::OK), + 1 => status_led.update(StatusMode::ACTIVE1), + 2 => status_led.update(StatusMode::ACTIVE2), + _ => status_led.update(StatusMode::ERROR), } - col.set_high().unwrap(); - delay.delay_us(10); } - // Return scan result - pressed_keys } // Get current Fn mode (0, 1 or 2) fn get_fn_mode(pressed_keys: [bool; NUMBER_OF_KEYS]) -> u8 { // Check Fn mode let mut fn_mode: u8 = 0; - for button_id in layout::FN_BUTTONS.iter() { - if pressed_keys[usize::from(*button_id)] == true { + for button_id in crate::layout::FN_BUTTONS.iter() { + if pressed_keys[*button_id as usize] == true { fn_mode += 1; } } @@ -320,7 +275,7 @@ fn get_fn_mode(pressed_keys: [bool; NUMBER_OF_KEYS]) -> u8 { // Generate keyboard report based on pressed keys and Fn mode (0, 1 or 2) fn get_keyboard_report( - matrix_keys: &mut [ButtonMatrix; NUMBER_OF_KEYS], + matrix_keys: &mut [KeyboardButton; NUMBER_OF_KEYS], layout_map: [[Keyboard; NUMBER_OF_KEYS]; 3], fn_mode: u8, ) -> [Keyboard; NUMBER_OF_KEYS] { @@ -335,7 +290,7 @@ fn get_keyboard_report( key.previous_state = key.current_state; if key.current_state == true { - keyboard_report[index] = layout_map[usize::from(key.fn_mode)][index]; + keyboard_report[index] = layout_map[key.fn_mode as usize][index]; } } // Return report diff --git a/rp2040/src/status_led.rs b/rp2040/src/status_led.rs new file mode 100644 index 0000000..4fff509 --- /dev/null +++ b/rp2040/src/status_led.rs @@ -0,0 +1,81 @@ +use rp2040_hal::{ + gpio::{Function, FunctionConfig, Pin, PinId, ValidPinMode}, + pio::{PIOExt, StateMachineIndex, UninitStateMachine, PIO}, +}; +use smart_leds::{SmartLedsWrite, RGB8}; +use ws2812_pio::Ws2812Direct; + +#[derive(PartialEq, Eq, Copy, Clone)] +pub enum StatusMode { + OFF = 0, + OK = 1, + ACTIVE1 = 2, + ACTIVE2 = 3, + WARNING = 4, + ERROR = 5, + BOOTLOADER = 6, +} + +pub struct Ws2812StatusLed +where + I: PinId, + P: PIOExt + FunctionConfig, + Function

: ValidPinMode, + SM: StateMachineIndex, +{ + ws2812_direct: Ws2812Direct, + state: bool, +} + +impl Ws2812StatusLed +where + I: PinId, + P: PIOExt + FunctionConfig, + Function

: ValidPinMode, + SM: StateMachineIndex, +{ + /// Creates a new instance of this driver. + pub fn new( + pin: Pin>, + pio: &mut PIO

, + sm: UninitStateMachine<(P, SM)>, + clock_freq: fugit::HertzU32, + ) -> Self { + // prepare the PIO program + let ws2812_direct = Ws2812Direct::new(pin, pio, sm, clock_freq); + let state = false; + Self { + ws2812_direct, + state, + } + } + + pub fn update(&mut self, mode: StatusMode) { + let colors: [RGB8; 7] = [ + (0, 0, 0).into(), // Off + (10, 7, 0).into(), // Green + (10, 4, 10).into(), // Blue + (5, 10, 0).into(), // Orange + (2, 20, 0).into(), // Red + (2, 20, 0).into(), // Red + (0, 10, 10).into(), // Purple + ]; + + if mode == StatusMode::WARNING && self.state == false { + self.ws2812_direct + .write([colors[mode as usize]].iter().copied()) + .unwrap(); + self.state = true; + } else if mode == StatusMode::WARNING || mode == StatusMode::OFF { + self.ws2812_direct + .write([colors[0]].iter().copied()) + .unwrap(); + self.state = false; + } else { + self.ws2812_direct + .write([colors[mode as usize]].iter().copied()) + .unwrap(); + self.state = true; + } + } +} From 967d544bbc3143bd69727edee4ed5bea1a854e70 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sat, 1 Jul 2023 16:28:56 +0200 Subject: [PATCH 18/27] Code cleanup --- rp2040/src/button_matrix.rs | 82 ++++++------- rp2040/src/main.rs | 223 ++++++++++++++++++++---------------- rp2040/src/status_led.rs | 20 ++++ 3 files changed, 179 insertions(+), 146 deletions(-) diff --git a/rp2040/src/button_matrix.rs b/rp2040/src/button_matrix.rs index ff1f021..715911d 100644 --- a/rp2040/src/button_matrix.rs +++ b/rp2040/src/button_matrix.rs @@ -2,47 +2,63 @@ use core::convert::Infallible; use cortex_m::delay::Delay; use embedded_hal::digital::v2::*; -pub const DEBOUNCE_COUNT: u8 = 5; - +/// Button matrix driver +/// +/// # Example +/// ``` +/// let button_matrix: ButtonMatrix<4, 6, 48> = ButtonMatrix::new(row_pins, col_pins, 5); pub struct ButtonMatrix<'a, const R: usize, const C: usize, const N: usize> { rows: &'a [&'a dyn InputPin; R], cols: &'a mut [&'a mut dyn OutputPin; C], - delay: &'a mut Delay, - state: [bool; N], - state_raw: [bool; N], + pressed: [bool; N], + debounce: u8, debounce_counter: [u8; N], } impl<'a, const R: usize, const C: usize, const N: usize> ButtonMatrix<'a, R, C, N> { + /// Creates a new button matrix. + /// + /// # Arguments + /// + /// * `rows` - An array of references to the row pins. + /// * `cols` - An array of references to the column pins. + /// * `debounce` - The debounce time in number of scans. pub fn new( rows: &'a [&'a dyn InputPin; R], cols: &'a mut [&'a mut dyn OutputPin; C], - delay: &'a mut Delay, + debounce: u8, ) -> Self { Self { rows, cols, - delay, - state: [false; N], - state_raw: [false; N], + pressed: [false; N], + debounce, debounce_counter: [0; N], } } + /// Initializes the button matrix. + /// This should be called once before scanning the matrix. pub fn init_pins(&mut self) { for col in self.cols.iter_mut() { col.set_high().unwrap(); } - self.delay.delay_us(10); } - pub fn scan_matrix(&mut self) { + /// Scans the button matrix and updates the pressed state of each button. + /// This should be called at regular intervals. + /// Allow at least 5 times the delay compared to the needed button latency. + /// + /// # Arguments + /// + /// * `delay` - A mutable reference to a delay object. + pub fn scan_matrix(&mut self, delay: &mut Delay) { for col_index in 0..self.cols.len() { self.cols[col_index].set_low().unwrap(); - self.delay.delay_us(10); + delay.delay_us(10); self.process_column(col_index); self.cols[col_index].set_high().unwrap(); - self.delay.delay_us(10); + delay.delay_us(10); } } @@ -50,49 +66,21 @@ impl<'a, const R: usize, const C: usize, const N: usize> ButtonMatrix<'a, R, C, for row_index in 0..self.rows.len() { let button_index: usize = col_index + (row_index * C); let current_state = self.rows[row_index].is_low().unwrap(); - self.state_raw[button_index] = current_state; - if current_state == self.state[button_index] { + if current_state == self.pressed[button_index] { self.debounce_counter[button_index] = 0; continue; } self.debounce_counter[button_index] += 1; - if self.debounce_counter[button_index] >= DEBOUNCE_COUNT { - self.state[button_index] = current_state; + if self.debounce_counter[button_index] >= self.debounce { + self.pressed[button_index] = current_state; } } } - // pub fn scan_matrix(&mut self) { - // for (col_index, col) in self.cols.iter_mut().enumerate() { - // col.set_low().unwrap(); - // self.delay.delay_us(10); - // - // for (row_index, row) in self.rows.iter().enumerate() { - // let button_index: usize = col_index + (row_index * C); - // let current_state = row.is_low().unwrap(); - // self.state_raw[button_index] = current_state; - // - // if current_state == self.state[button_index] { - // self.debounce_counter[button_index] = 0; - // } else { - // self.debounce_counter[button_index] += 1; - // if self.debounce_counter[button_index] >= DEBOUNCE_COUNT { - // self.state[button_index] = current_state; - // } - // } - // } - // col.set_high().unwrap(); - // self.delay.delay_us(10); - // } - // } - - pub fn get_button_state(&mut self) -> [bool; N] { - self.state - } - - pub fn get_button_state_raw(&mut self) -> [bool; N] { - self.state_raw + /// Returns an array of booleans indicating whether each button is pressed. + pub fn buttons_pressed(&mut self) -> [bool; N] { + self.pressed } } diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index 7d8c829..a2d2cca 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -12,6 +12,7 @@ mod status_led; use crate::status_led::{StatusMode, Ws2812StatusLed}; use button_matrix::ButtonMatrix; use core::convert::Infallible; +use cortex_m::delay::Delay; use embedded_hal::digital::v2::*; use embedded_hal::timer::CountDown; use fugit::ExtU32; @@ -37,33 +38,26 @@ use waveshare_rp2040_zero::{ Pins, XOSC_CRYSTAL_FREQ, }; +// Public constants pub const KEY_ROWS: usize = 4; pub const KEY_COLS: usize = 12; pub const NUMBER_OF_KEYS: usize = KEY_ROWS * KEY_COLS; -#[derive(Copy, Clone)] +// Public types +#[derive(Copy, Clone, Default)] pub struct KeyboardButton { - pub current_state: bool, - pub previous_state: bool, + pub pressed: bool, + pub previous_pressed: bool, pub fn_mode: u8, } -impl KeyboardButton { - pub fn default() -> Self { - Self { - current_state: false, - previous_state: false, - fn_mode: 0, - } - } -} - #[entry] fn main() -> ! { let mut pac = pac::Peripherals::take().unwrap(); let core = pac::CorePeripherals::take().unwrap(); let mut watchdog = Watchdog::new(pac.WATCHDOG); + // Configure clocks and PLLs let clocks = init_clocks_and_plls( XOSC_CRYSTAL_FREQ, pac.XOSC, @@ -76,6 +70,7 @@ fn main() -> ! { .ok() .unwrap(); + // Configure GPIOs let sio = Sio::new(pac.SIO); let pins = Pins::new( pac.IO_BANK0, @@ -84,38 +79,7 @@ fn main() -> ! { &mut pac.RESETS, ); - let usb_bus = UsbBusAllocator::new(waveshare_rp2040_zero::hal::usb::UsbBus::new( - pac.USBCTRL_REGS, - pac.USBCTRL_DPRAM, - clocks.usb_clock, - true, - &mut pac.RESETS, - )); - - let mut keyboard = UsbHidClassBuilder::new() - .add_device( - usbd_human_interface_device::device::keyboard::NKROBootKeyboardConfig::default(), - ) - .build(&usb_bus); - - let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x1209, 0x0001)) - .manufacturer("usbd-human-interface-device") - .product("CMDR keyboard") - .serial_number("0001") - .build(); - - let timer = Timer::new(pac.TIMER, &mut pac.RESETS); - let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().to_Hz()); - - // Configure the status LED - let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); - let mut status_led = Ws2812StatusLed::new( - pins.neopixel.into_mode(), - &mut pio, - sm0, - clocks.peripheral_clock.freq(), - ); - + // Create button matrix let button_matrix_row_pins: &[&dyn InputPin; KEY_ROWS] = &[ &pins.gp0.into_pull_up_input(), &pins.gp1.into_pull_up_input(), @@ -139,28 +103,68 @@ fn main() -> ! { ]; let mut button_matrix: ButtonMatrix = - ButtonMatrix::new(button_matrix_row_pins, button_matrix_col_pins, &mut delay); + ButtonMatrix::new(button_matrix_row_pins, button_matrix_col_pins, 5); + // Configure USB + let usb_bus = UsbBusAllocator::new(waveshare_rp2040_zero::hal::usb::UsbBus::new( + pac.USBCTRL_REGS, + pac.USBCTRL_DPRAM, + clocks.usb_clock, + true, + &mut pac.RESETS, + )); + + let mut keyboard = UsbHidClassBuilder::new() + .add_device( + usbd_human_interface_device::device::keyboard::NKROBootKeyboardConfig::default(), + ) + .build(&usb_bus); + + let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x1209, 0x0001)) + .manufacturer("CMtec") + .product("CMDR keyboard") + .serial_number("0001") + .build(); + + // Create status LED + let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); + let mut status_led = Ws2812StatusLed::new( + pins.neopixel.into_mode(), + &mut pio, + sm0, + clocks.peripheral_clock.freq(), + ); + + // Create keyboard button array let mut buttons: [KeyboardButton; NUMBER_OF_KEYS] = [KeyboardButton::default(); NUMBER_OF_KEYS]; - let mut report_count_down = timer.count_down(); - report_count_down.start(10.millis()); + // Create timers/delays + let timer = Timer::new(pac.TIMER, &mut pac.RESETS); + let mut delay = Delay::new(core.SYST, clocks.system_clock.freq().to_Hz()); - let mut tick_count_down = timer.count_down(); - tick_count_down.start(1.millis()); + let mut usb_hid_report_count_down = timer.count_down(); + usb_hid_report_count_down.start(10.millis()); - let mut indicator_count_down = timer.count_down(); - indicator_count_down.start(250.millis()); + let mut usb_tick_count_down = timer.count_down(); + usb_tick_count_down.start(1.millis()); + let mut status_led_count_down = timer.count_down(); + status_led_count_down.start(250.millis()); + + // Create variables to track caps lock and fn mode let mut caps_lock_active: bool = false; let mut fn_mode: u8 = 0; - // Set all column pins to output and high + // Initialize button matrix button_matrix.init_pins(); - // Check if esc pressed while power on. If yes then enter bootloader - button_matrix.scan_matrix(); - if button_matrix.get_button_state_raw()[0] == true { + // Scan matrix to get initial state + for _ in 0..10 { + button_matrix.scan_matrix(&mut delay); + } + + // Check if esc key is pressed while power on. If yes then enter bootloader + if button_matrix.buttons_pressed()[0] { status_led.update(StatusMode::BOOTLOADER); let gpio_activity_pin_mask = 0; let disable_interface_mask = 0; @@ -168,47 +172,43 @@ fn main() -> ! { } loop { - if indicator_count_down.wait().is_ok() { + if status_led_count_down.wait().is_ok() { update_status_led(&mut status_led, fn_mode, caps_lock_active); } - if report_count_down.wait().is_ok() { - // Scan keyboard matrix - let pressed_keys = button_matrix.get_button_state(); + if usb_hid_report_count_down.wait().is_ok() { + let pressed_keys = button_matrix.buttons_pressed(); - // Get current function layer fn_mode = get_fn_mode(pressed_keys); if caps_lock_active == false { update_status_led(&mut status_led, fn_mode, caps_lock_active); } - - // Copy result from scanned keys to matrix struct for (index, key) in pressed_keys.iter().enumerate() { - buttons[index].current_state = *key; + buttons[index].pressed = *key; } - // Generate keyboard report - let keyboard_report = get_keyboard_report(&mut buttons, layout::MAP, fn_mode); + let keyboard_report = get_keyboard_report(&mut buttons, fn_mode); match keyboard.device().write_report(keyboard_report) { Err(UsbHidError::WouldBlock) => {} Err(UsbHidError::Duplicate) => {} Ok(_) => {} Err(e) => { + status_led.update(StatusMode::ERROR); core::panic!("Failed to write keyboard report: {:?}", e) } }; } - //Tick once per ms - if tick_count_down.wait().is_ok() { - button_matrix.scan_matrix(); + if usb_tick_count_down.wait().is_ok() { + button_matrix.scan_matrix(&mut delay); match keyboard.tick() { Err(UsbHidError::WouldBlock) => {} Ok(_) => {} Err(e) => { + status_led.update(StatusMode::ERROR); core::panic!("Failed to process keyboard tick: {:?}", e) } }; @@ -216,26 +216,33 @@ fn main() -> ! { if usb_dev.poll(&mut [&mut keyboard]) { match keyboard.device().read_report() { - Err(UsbError::WouldBlock) => { - //do nothing - } + Err(UsbError::WouldBlock) => {} Err(e) => { + status_led.update(StatusMode::ERROR); core::panic!("Failed to read keyboard report: {:?}", e) } Ok(leds) => { - if leds.caps_lock == true { - caps_lock_active = true; - } else { - caps_lock_active = false; - } + caps_lock_active = leds.caps_lock; } } } } } -// Set status LED colour based on function layer and capslock -// 0 = green, 1 = blue, 2 = orange, capslock active = flashing red. +/// Update status LED colour based on function layer and capslock +/// +/// # Arguments +/// * `status_led` - Reference to status LED +/// * `fn_mode` - Current function layer +/// * `caps_lock_active` - Is capslock active +/// +/// # Results +/// +/// Fn0 = green (OK) +/// Fn1 = blue (ACTIVE1) +/// Fn2 = orange (ACTIVE2) +/// Capslock active = flashing red (WARNING) +/// Error = steady red (ERROR) fn update_status_led( status_led: &mut Ws2812StatusLed, fn_mode: u8, @@ -246,7 +253,7 @@ fn update_status_led( Function

: ValidPinMode, SM: StateMachineIndex, { - if caps_lock_active == true { + if caps_lock_active { status_led.update(StatusMode::WARNING); } else { match fn_mode { @@ -258,41 +265,59 @@ fn update_status_led( } } -// Get current Fn mode (0, 1 or 2) +/// Get current Fn mode (0, 1 or 2) +/// layout::FN_BUTTONS contains the keycodes for each Fn key +/// +/// # Arguments +/// +/// * `pressed_keys` - Array of pressed keys +/// +/// # Results +/// +/// * Fn mode (0, 1 or 2) fn get_fn_mode(pressed_keys: [bool; NUMBER_OF_KEYS]) -> u8 { - // Check Fn mode - let mut fn_mode: u8 = 0; - for button_id in crate::layout::FN_BUTTONS.iter() { - if pressed_keys[*button_id as usize] == true { - fn_mode += 1; - } + // Check how many Fn keys are pressed + let mut active_fn_keys = layout::FN_BUTTONS + .iter() + .filter(|button_id| pressed_keys[**button_id as usize]) + .count() as u8; + + // Limit Fn mode to 2 + if active_fn_keys > 2 { + active_fn_keys = 2; } - if fn_mode > 2 { - fn_mode = 2; - } - fn_mode + active_fn_keys } -// Generate keyboard report based on pressed keys and Fn mode (0, 1 or 2) +/// Generate keyboard report based on pressed keys and Fn mode (0, 1 or 2) +/// layout::MAP contains the keycodes for each key in each Fn mode +/// +/// # Arguments +/// +/// * `matrix_keys` - Array of pressed keys +/// * `fn_mode` - Current function layer +/// +/// # Results +/// +/// * Keyboard report fn get_keyboard_report( matrix_keys: &mut [KeyboardButton; NUMBER_OF_KEYS], - layout_map: [[Keyboard; NUMBER_OF_KEYS]; 3], fn_mode: u8, ) -> [Keyboard; NUMBER_OF_KEYS] { - // Create default report let mut keyboard_report: [Keyboard; NUMBER_OF_KEYS] = [Keyboard::NoEventIndicated; NUMBER_OF_KEYS]; + // Filter report based on Fn mode and pressed keys for (index, key) in matrix_keys.iter_mut().enumerate() { - if key.current_state != key.previous_state && key.current_state == true { + if key.pressed != key.previous_pressed && key.pressed { key.fn_mode = fn_mode; } - key.previous_state = key.current_state; - if key.current_state == true { - keyboard_report[index] = layout_map[key.fn_mode as usize][index]; + key.previous_pressed = key.pressed; + + if key.pressed { + keyboard_report[index] = layout::MAP[key.fn_mode as usize][index]; } } - // Return report keyboard_report } diff --git a/rp2040/src/status_led.rs b/rp2040/src/status_led.rs index 4fff509..cf41da5 100644 --- a/rp2040/src/status_led.rs +++ b/rp2040/src/status_led.rs @@ -5,6 +5,7 @@ use rp2040_hal::{ use smart_leds::{SmartLedsWrite, RGB8}; use ws2812_pio::Ws2812Direct; +/// Status LED modes #[derive(PartialEq, Eq, Copy, Clone)] pub enum StatusMode { OFF = 0, @@ -35,6 +36,13 @@ where SM: StateMachineIndex, { /// Creates a new instance of this driver. + /// + /// # Arguments + /// + /// * `pin` - PIO pin + /// * `pio` - PIO instance + /// * `sm` - PIO state machine + /// * `clock_freq` - PIO clock frequency pub fn new( pin: Pin>, pio: &mut PIO

, @@ -50,6 +58,18 @@ where } } + /// Update status LED + /// Depending on the mode, the LED will be set to a different colour + /// + /// * OFF = off + /// * OK = green + /// * ACTIVE1 = blue + /// * ACTIVE2 = orange + /// * WARNING = red (flashing) + /// * ERROR = red + /// * BOOTLOADER = purple + /// + /// Make sure to call this function regularly to keep the LED flashing pub fn update(&mut self, mode: StatusMode) { let colors: [RGB8; 7] = [ (0, 0, 0).into(), // Off From 8d2d31fa429881e6319983ad6711bb2c0288a5de Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sun, 2 Jul 2023 11:22:59 +0200 Subject: [PATCH 19/27] Code cleanup --- rp2040/src/main.rs | 8 +++++--- rp2040/src/status_led.rs | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index a2d2cca..94776c0 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -1,6 +1,8 @@ -// TODO: Add license header -// TODO: Add documentation header -// TODO: GUI lock button support +// Project: CMtec CMDR Keyboard 42 +// Date: 2023-07-01 +// Author: Christoffer Martinsson +// Email: cm@cmtec.se +// License: Please refer to LICENSE in root directory #![no_std] #![no_main] diff --git a/rp2040/src/status_led.rs b/rp2040/src/status_led.rs index cf41da5..d5eddc6 100644 --- a/rp2040/src/status_led.rs +++ b/rp2040/src/status_led.rs @@ -6,6 +6,14 @@ use smart_leds::{SmartLedsWrite, RGB8}; use ws2812_pio::Ws2812Direct; /// Status LED modes +/// +/// * OFF = Syatem offline +/// * OK = All system Ok +/// * ACTIVE1 = System active 1 +/// * ACTIVE2 = System active 2 +/// * WARNING = Warning +/// * ERROR = Error +/// * BOOTLOADER = Bootloader active #[derive(PartialEq, Eq, Copy, Clone)] pub enum StatusMode { OFF = 0, @@ -17,6 +25,19 @@ pub enum StatusMode { BOOTLOADER = 6, } +/// Status LED driver +/// This driver uses the PIO state machine to drive a WS2812 LED +/// +/// # Example +/// +/// ``` +/// let mut status_led = Ws2812StatusLed::new( +/// pins.neopixel.into_mode(), +/// &mut pio, +/// sm0, +/// clocks.peripheral_clock.freq(), +/// ); +/// ``` pub struct Ws2812StatusLed where I: PinId, From be65b842fbcdd832f8d6082de9bc1c8c72c6301a Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 3 Jul 2023 21:27:56 +0200 Subject: [PATCH 20/27] Code cleanup --- rp2040/src/button_matrix.rs | 14 ++++- rp2040/src/layout.rs | 20 +++++-- rp2040/src/main.rs | 108 +++++++++++++++++++++++------------- rp2040/src/status_led.rs | 26 ++++++--- 4 files changed, 115 insertions(+), 53 deletions(-) diff --git a/rp2040/src/button_matrix.rs b/rp2040/src/button_matrix.rs index 715911d..2c7e0da 100644 --- a/rp2040/src/button_matrix.rs +++ b/rp2040/src/button_matrix.rs @@ -1,3 +1,9 @@ +//! Project: CMtec CMDR Keyboard 42 +//! Date: 2023-07-01 +//! Author: Christoffer Martinsson +//! Email: cm@cmtec.se +//! License: Please refer to LICENSE in root directory + use core::convert::Infallible; use cortex_m::delay::Delay; use embedded_hal::digital::v2::*; @@ -7,6 +13,7 @@ use embedded_hal::digital::v2::*; /// # Example /// ``` /// let button_matrix: ButtonMatrix<4, 6, 48> = ButtonMatrix::new(row_pins, col_pins, 5); +/// ``` pub struct ButtonMatrix<'a, const R: usize, const C: usize, const N: usize> { rows: &'a [&'a dyn InputPin; R], cols: &'a mut [&'a mut dyn OutputPin; C], @@ -17,7 +24,7 @@ pub struct ButtonMatrix<'a, const R: usize, const C: usize, const N: usize> { impl<'a, const R: usize, const C: usize, const N: usize> ButtonMatrix<'a, R, C, N> { /// Creates a new button matrix. - /// + /// /// # Arguments /// /// * `rows` - An array of references to the row pins. @@ -62,6 +69,11 @@ impl<'a, const R: usize, const C: usize, const N: usize> ButtonMatrix<'a, R, C, } } + /// Processes a column of the button matrix. + /// + /// # Arguments + /// + /// * `col_index` - The index of the column to process. fn process_column(&mut self, col_index: usize) { for row_index in 0..self.rows.len() { let button_index: usize = col_index + (row_index * C); diff --git a/rp2040/src/layout.rs b/rp2040/src/layout.rs index b8de35c..4cd4cfe 100644 --- a/rp2040/src/layout.rs +++ b/rp2040/src/layout.rs @@ -1,3 +1,9 @@ +//! Project: CMtec CMDR Keyboard 42 +//! Date: 2023-07-01 +//! Author: Christoffer Martinsson +//! Email: cm@cmtec.se +//! License: Please refer to LICENSE in root directory + // Button index map: // ------------------------------------- ------------------------------------- // | 0 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | 11 | @@ -25,11 +31,15 @@ use crate::NUMBER_OF_KEYS; use usbd_human_interface_device::page::Keyboard; -// Function (Fn) buttons index (need two buttons) -// Button 41 are used both as Fn and RightAlt (AltGr) for better ergonomics. -// This means that RightAlt is only available on layer 1 keys. +/// Function (Fn) buttons index (need two buttons) +/// Button 41 are used both as Fn and RightAlt (AltGr) for better ergonomics. +/// This means that RightAlt is only available on layer 1 keys. pub const FN_BUTTONS: [u8; 3] = [40, 43, 44]; -// Button map to HID key (three Function layers) + +/// GUI (Windows) buttons [index, layer] +pub const GUI_LOCK_BUTTON: [u8; 2] = [7, 2]; + +/// Button map to HID key (three Function layers) pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ [ // Function layer 0 @@ -148,7 +158,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::F15, // 4 Keyboard::F16, // 5 Keyboard::Grave, // 6 § - Keyboard::NoEventIndicated, // 7 + Keyboard::NoEventIndicated, // 7 GUI lock Keyboard::LeftGUI, // 8 Keyboard::NoEventIndicated, // 9 Keyboard::CapsLock, // 10 diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index 94776c0..b3e5a19 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -1,8 +1,8 @@ -// Project: CMtec CMDR Keyboard 42 -// Date: 2023-07-01 -// Author: Christoffer Martinsson -// Email: cm@cmtec.se -// License: Please refer to LICENSE in root directory +//! Project: CMtec CMDR Keyboard 42 +//! Date: 2023-07-01 +//! Author: Christoffer Martinsson +//! Email: cm@cmtec.se +//! License: Please refer to LICENSE in root directory #![no_std] #![no_main] @@ -11,7 +11,6 @@ mod button_matrix; mod layout; mod status_led; -use crate::status_led::{StatusMode, Ws2812StatusLed}; use button_matrix::ButtonMatrix; use core::convert::Infallible; use cortex_m::delay::Delay; @@ -23,6 +22,7 @@ use rp2040_hal::{ gpio::{Function, FunctionConfig, PinId, ValidPinMode}, pio::StateMachineIndex, }; +use status_led::{StatusMode, Ws2812StatusLed}; use usb_device::class_prelude::*; use usb_device::prelude::*; use usbd_human_interface_device::page::Keyboard; @@ -55,8 +55,10 @@ pub struct KeyboardButton { #[entry] fn main() -> ! { + // Grab our singleton objects let mut pac = pac::Peripherals::take().unwrap(); - let core = pac::CorePeripherals::take().unwrap(); + + // Set up the watchdog driver - needed by the clock setup code let mut watchdog = Watchdog::new(pac.WATCHDOG); // Configure clocks and PLLs @@ -72,8 +74,12 @@ fn main() -> ! { .ok() .unwrap(); - // Configure GPIOs + let core = pac::CorePeripherals::take().unwrap(); + + // The single-cycle I/O block controls our GPIO pins let sio = Sio::new(pac.SIO); + + // Set the pins to their default state let pins = Pins::new( pac.IO_BANK0, pac.PADS_BANK0, @@ -81,7 +87,7 @@ fn main() -> ! { &mut pac.RESETS, ); - // Create button matrix + // Setting up array with pins connected to button rows let button_matrix_row_pins: &[&dyn InputPin; KEY_ROWS] = &[ &pins.gp0.into_pull_up_input(), &pins.gp1.into_pull_up_input(), @@ -89,6 +95,7 @@ fn main() -> ! { &pins.gp28.into_pull_up_input(), ]; + // Setting up array with pins connected to button columns let button_matrix_col_pins: &mut [&mut dyn OutputPin; KEY_COLS] = &mut [ &mut pins.gp12.into_push_pull_output(), &mut pins.gp13.into_push_pull_output(), @@ -104,6 +111,7 @@ fn main() -> ! { &mut pins.gp11.into_push_pull_output(), ]; + // Create button matrix object that scans all the PCB buttons let mut button_matrix: ButtonMatrix = ButtonMatrix::new(button_matrix_row_pins, button_matrix_col_pins, 5); @@ -155,7 +163,9 @@ fn main() -> ! { // Create variables to track caps lock and fn mode let mut caps_lock_active: bool = false; - let mut fn_mode: u8 = 0; + let mut fn_mode: u8; + let mut gui_lock_active: bool = false; + let mut gui_lock_trigger_index: u8 = 0; // Initialize button matrix button_matrix.init_pins(); @@ -175,7 +185,7 @@ fn main() -> ! { loop { if status_led_count_down.wait().is_ok() { - update_status_led(&mut status_led, fn_mode, caps_lock_active); + update_status_led(&mut status_led, caps_lock_active, gui_lock_active); } if usb_hid_report_count_down.wait().is_ok() { @@ -184,13 +194,18 @@ fn main() -> ! { fn_mode = get_fn_mode(pressed_keys); if caps_lock_active == false { - update_status_led(&mut status_led, fn_mode, caps_lock_active); + update_status_led(&mut status_led, caps_lock_active, gui_lock_active); } for (index, key) in pressed_keys.iter().enumerate() { buttons[index].pressed = *key; } - let keyboard_report = get_keyboard_report(&mut buttons, fn_mode); + let keyboard_report = get_keyboard_report( + &mut buttons, + fn_mode, + &mut gui_lock_active, + &mut gui_lock_trigger_index, + ); match keyboard.device().write_report(keyboard_report) { Err(UsbHidError::WouldBlock) => {} @@ -233,22 +248,18 @@ fn main() -> ! { /// Update status LED colour based on function layer and capslock /// -/// # Arguments -/// * `status_led` - Reference to status LED -/// * `fn_mode` - Current function layer -/// * `caps_lock_active` - Is capslock active -/// -/// # Results -/// -/// Fn0 = green (OK) -/// Fn1 = blue (ACTIVE1) -/// Fn2 = orange (ACTIVE2) +/// Normal = green (NORMAL) +/// GUI lock = blue (GUI LOCK) /// Capslock active = flashing red (WARNING) /// Error = steady red (ERROR) +/// +/// # Arguments +/// * `status_led` - Reference to status LED +/// * `caps_lock_active` - Is capslock active fn update_status_led( status_led: &mut Ws2812StatusLed, - fn_mode: u8, caps_lock_active: bool, + gui_lock_active: bool, ) where P: PIOExt + FunctionConfig, I: PinId, @@ -257,13 +268,10 @@ fn update_status_led( { if caps_lock_active { status_led.update(StatusMode::WARNING); + } else if gui_lock_active { + status_led.update(StatusMode::ACTIVITY); } else { - match fn_mode { - 0 => status_led.update(StatusMode::OK), - 1 => status_led.update(StatusMode::ACTIVE1), - 2 => status_led.update(StatusMode::ACTIVE2), - _ => status_led.update(StatusMode::ERROR), - } + status_led.update(StatusMode::NORMAL); } } @@ -273,10 +281,6 @@ fn update_status_led( /// # Arguments /// /// * `pressed_keys` - Array of pressed keys -/// -/// # Results -/// -/// * Fn mode (0, 1 or 2) fn get_fn_mode(pressed_keys: [bool; NUMBER_OF_KEYS]) -> u8 { // Check how many Fn keys are pressed let mut active_fn_keys = layout::FN_BUTTONS @@ -298,13 +302,13 @@ fn get_fn_mode(pressed_keys: [bool; NUMBER_OF_KEYS]) -> u8 { /// /// * `matrix_keys` - Array of pressed keys /// * `fn_mode` - Current function layer -/// -/// # Results -/// -/// * Keyboard report +/// * `gui_lock` - Is GUI lock active +/// * `gui_lock_index` - Index of the key pressed after GUI lock was activated fn get_keyboard_report( matrix_keys: &mut [KeyboardButton; NUMBER_OF_KEYS], fn_mode: u8, + gui_lock_active: &mut bool, + gui_lock_trigger_index: &mut u8, ) -> [Keyboard; NUMBER_OF_KEYS] { let mut keyboard_report: [Keyboard; NUMBER_OF_KEYS] = [Keyboard::NoEventIndicated; NUMBER_OF_KEYS]; @@ -315,8 +319,36 @@ fn get_keyboard_report( key.fn_mode = fn_mode; } + // Check if GUI lock button is pressed + if key.pressed != key.previous_pressed + && key.pressed + && index == layout::GUI_LOCK_BUTTON[0] as usize + && *gui_lock_active == false + && fn_mode == layout::GUI_LOCK_BUTTON[1] + { + *gui_lock_active = true; + key.previous_pressed = key.pressed; + continue; + } + key.previous_pressed = key.pressed; + /// Index of GUI key in keyboard report + /// Index 36, 37, 38, 45, 46, 47 are not used by any other keys + const GUI_REPORT_INDEX: usize = 47; + + // If GUI lock is active, set LeftGUI key to pressed + // when next button is pressed. Keep LeftGUI pressed + // until next button is released + if *gui_lock_active && key.pressed { + *gui_lock_trigger_index = index as u8; + keyboard_report[GUI_REPORT_INDEX] = Keyboard::LeftGUI; + } else if *gui_lock_trigger_index as usize == index && key.pressed { + keyboard_report[GUI_REPORT_INDEX] = Keyboard::LeftGUI; + } else if *gui_lock_trigger_index as usize == index && key.pressed == false { + *gui_lock_active = false; + } + if key.pressed { keyboard_report[index] = layout::MAP[key.fn_mode as usize][index]; } diff --git a/rp2040/src/status_led.rs b/rp2040/src/status_led.rs index d5eddc6..e03e534 100644 --- a/rp2040/src/status_led.rs +++ b/rp2040/src/status_led.rs @@ -1,3 +1,9 @@ +//! Project: CMtec CMDR Keyboard 42 +//! Date: 2023-07-01 +//! Author: Christoffer Martinsson +//! Email: cm@cmtec.se +//! License: Please refer to LICENSE in root directory + use rp2040_hal::{ gpio::{Function, FunctionConfig, Pin, PinId, ValidPinMode}, pio::{PIOExt, StateMachineIndex, UninitStateMachine, PIO}, @@ -8,22 +14,24 @@ use ws2812_pio::Ws2812Direct; /// Status LED modes /// /// * OFF = Syatem offline -/// * OK = All system Ok -/// * ACTIVE1 = System active 1 -/// * ACTIVE2 = System active 2 +/// * NORMAL = All system Ok +/// * ACTIVITY = System activity +/// * OTHER = Other activity /// * WARNING = Warning /// * ERROR = Error /// * BOOTLOADER = Bootloader active +#[allow(dead_code)] #[derive(PartialEq, Eq, Copy, Clone)] pub enum StatusMode { OFF = 0, - OK = 1, - ACTIVE1 = 2, - ACTIVE2 = 3, + NORMAL = 1, + ACTIVITY = 2, + OTHER = 3, WARNING = 4, ERROR = 5, BOOTLOADER = 6, } +#[warn(dead_code)] /// Status LED driver /// This driver uses the PIO state machine to drive a WS2812 LED @@ -83,9 +91,9 @@ where /// Depending on the mode, the LED will be set to a different colour /// /// * OFF = off - /// * OK = green - /// * ACTIVE1 = blue - /// * ACTIVE2 = orange + /// * NORMAL = green + /// * ACTIVITY = blue + /// * OTHER = orange /// * WARNING = red (flashing) /// * ERROR = red /// * BOOTLOADER = purple From 79650dcc2b5d4d9a8c81a1fc8267d5e0eb27a802 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Wed, 5 Jul 2023 19:25:47 +0200 Subject: [PATCH 21/27] Code cleanup --- rp2040/src/main.rs | 24 ++++++++++++------------ rp2040/src/status_led.rs | 18 +++++++++--------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index b3e5a19..b6f9277 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -177,9 +177,9 @@ fn main() -> ! { // Check if esc key is pressed while power on. If yes then enter bootloader if button_matrix.buttons_pressed()[0] { - status_led.update(StatusMode::BOOTLOADER); - let gpio_activity_pin_mask = 0; - let disable_interface_mask = 0; + status_led.update(StatusMode::Bootloader); + let gpio_activity_pin_mask: u32 = 0; + let disable_interface_mask: u32 = 0; rp2040_hal::rom_data::reset_to_usb_boot(gpio_activity_pin_mask, disable_interface_mask); } @@ -193,7 +193,7 @@ fn main() -> ! { fn_mode = get_fn_mode(pressed_keys); - if caps_lock_active == false { + if !caps_lock_active { update_status_led(&mut status_led, caps_lock_active, gui_lock_active); } for (index, key) in pressed_keys.iter().enumerate() { @@ -212,7 +212,7 @@ fn main() -> ! { Err(UsbHidError::Duplicate) => {} Ok(_) => {} Err(e) => { - status_led.update(StatusMode::ERROR); + status_led.update(StatusMode::Error); core::panic!("Failed to write keyboard report: {:?}", e) } }; @@ -225,7 +225,7 @@ fn main() -> ! { Err(UsbHidError::WouldBlock) => {} Ok(_) => {} Err(e) => { - status_led.update(StatusMode::ERROR); + status_led.update(StatusMode::Error); core::panic!("Failed to process keyboard tick: {:?}", e) } }; @@ -235,7 +235,7 @@ fn main() -> ! { match keyboard.device().read_report() { Err(UsbError::WouldBlock) => {} Err(e) => { - status_led.update(StatusMode::ERROR); + status_led.update(StatusMode::Error); core::panic!("Failed to read keyboard report: {:?}", e) } Ok(leds) => { @@ -267,11 +267,11 @@ fn update_status_led( SM: StateMachineIndex, { if caps_lock_active { - status_led.update(StatusMode::WARNING); + status_led.update(StatusMode::Warning); } else if gui_lock_active { - status_led.update(StatusMode::ACTIVITY); + status_led.update(StatusMode::Activity); } else { - status_led.update(StatusMode::NORMAL); + status_led.update(StatusMode::Normal); } } @@ -323,7 +323,7 @@ fn get_keyboard_report( if key.pressed != key.previous_pressed && key.pressed && index == layout::GUI_LOCK_BUTTON[0] as usize - && *gui_lock_active == false + && !(*gui_lock_active) && fn_mode == layout::GUI_LOCK_BUTTON[1] { *gui_lock_active = true; @@ -345,7 +345,7 @@ fn get_keyboard_report( keyboard_report[GUI_REPORT_INDEX] = Keyboard::LeftGUI; } else if *gui_lock_trigger_index as usize == index && key.pressed { keyboard_report[GUI_REPORT_INDEX] = Keyboard::LeftGUI; - } else if *gui_lock_trigger_index as usize == index && key.pressed == false { + } else if *gui_lock_trigger_index as usize == index && !key.pressed { *gui_lock_active = false; } diff --git a/rp2040/src/status_led.rs b/rp2040/src/status_led.rs index e03e534..d56af7b 100644 --- a/rp2040/src/status_led.rs +++ b/rp2040/src/status_led.rs @@ -23,13 +23,13 @@ use ws2812_pio::Ws2812Direct; #[allow(dead_code)] #[derive(PartialEq, Eq, Copy, Clone)] pub enum StatusMode { - OFF = 0, - NORMAL = 1, - ACTIVITY = 2, - OTHER = 3, - WARNING = 4, - ERROR = 5, - BOOTLOADER = 6, + Off = 0, + Normal = 1, + Activity = 2, + Other = 3, + Warning = 4, + Error = 5, + Bootloader = 6, } #[warn(dead_code)] @@ -110,12 +110,12 @@ where (0, 10, 10).into(), // Purple ]; - if mode == StatusMode::WARNING && self.state == false { + if mode == StatusMode::Warning && !self.state { self.ws2812_direct .write([colors[mode as usize]].iter().copied()) .unwrap(); self.state = true; - } else if mode == StatusMode::WARNING || mode == StatusMode::OFF { + } else if mode == StatusMode::Warning || mode == StatusMode::Off { self.ws2812_direct .write([colors[0]].iter().copied()) .unwrap(); From abff78ad98d7679e5a82387af20b986690d5355d Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sun, 16 Jul 2023 15:10:15 +0200 Subject: [PATCH 22/27] Updated layout --- rp2040/src/layout.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rp2040/src/layout.rs b/rp2040/src/layout.rs index 4cd4cfe..27e8680 100644 --- a/rp2040/src/layout.rs +++ b/rp2040/src/layout.rs @@ -36,7 +36,7 @@ use usbd_human_interface_device::page::Keyboard; /// This means that RightAlt is only available on layer 1 keys. pub const FN_BUTTONS: [u8; 3] = [40, 43, 44]; -/// GUI (Windows) buttons [index, layer] +/// GUI (Windows) buttons [index, layer] pub const GUI_LOCK_BUTTON: [u8; 2] = [7, 2]; /// Button map to HID key (three Function layers) @@ -87,7 +87,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::LeftAlt, // 39 Keyboard::NoEventIndicated, // 40 Fn (= will never trigg this layer) Keyboard::Space, // 41 - Keyboard::ReturnEnter, // 42 + Keyboard::Space, // 42 Keyboard::NoEventIndicated, // 43 Fn (= will never trigg this layer) Keyboard::NoEventIndicated, // 44 Fn (= will never trigg this layer) Keyboard::NoEventIndicated, // 45 no button connected @@ -109,7 +109,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::F8, // 8 Keyboard::F9, // 9 Keyboard::F10, // 10 - Keyboard::NoEventIndicated, // 11 + Keyboard::DeleteBackspace, // 11 Keyboard::LeftControl, // 12 Keyboard::Keyboard1, // 13 Keyboard::Keyboard2, // 14 @@ -121,7 +121,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::Keyboard8, // 20 Keyboard::Keyboard9, // 21 Keyboard::Keyboard0, // 22 - Keyboard::NoEventIndicated, // 23 + Keyboard::ReturnEnter, // 23 Keyboard::LeftShift, // 24 Keyboard::Keyboard6, // 25 Keyboard::Keyboard7, // 26 @@ -140,7 +140,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::LeftAlt, // 39 Keyboard::NoEventIndicated, // 40 Fn Keyboard::DeleteBackspace, // 41 - Keyboard::ReturnEnter, // 42 + Keyboard::DeleteBackspace, // 42 Keyboard::NoEventIndicated, // 43 Fn Keyboard::RightAlt, // 44 Fn Keyboard::NoEventIndicated, // 45 no button connected @@ -162,7 +162,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::LeftGUI, // 8 Keyboard::NoEventIndicated, // 9 Keyboard::CapsLock, // 10 - Keyboard::NoEventIndicated, // 11 + Keyboard::DeleteBackspace, // 11 Keyboard::LeftControl, // 12 Keyboard::NoEventIndicated, // 13 Keyboard::NoEventIndicated, // 14 @@ -174,7 +174,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::UpArrow, // 20 Keyboard::RightArrow, // 21 Keyboard::DeleteForward, // 22 - Keyboard::NoEventIndicated, // 23 + Keyboard::ReturnEnter, // 23 Keyboard::LeftShift, // 24 Keyboard::F20, // 25 Keyboard::F21, // 26 @@ -193,7 +193,7 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ Keyboard::LeftAlt, // 39 Keyboard::NoEventIndicated, // 40 Fn Keyboard::LeftGUI, // 41 - Keyboard::ReturnEnter, // 42 + Keyboard::DeleteBackspace, // 42 Keyboard::NoEventIndicated, // 43 Fn Keyboard::NoEventIndicated, // 44 Fn Keyboard::NoEventIndicated, // 45 no button connected From 60309e3c7a867baf395e0780f98ab2cf4aec2a81 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 17 Jul 2023 16:32:47 +0200 Subject: [PATCH 23/27] Fixed GUI lock feature --- rp2040/src/main.rs | 50 ++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index b6f9277..1df1cac 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -164,7 +164,7 @@ fn main() -> ! { // Create variables to track caps lock and fn mode let mut caps_lock_active: bool = false; let mut fn_mode: u8; - let mut gui_lock_active: bool = false; + let mut gui_lock_state: u8 = 0; let mut gui_lock_trigger_index: u8 = 0; // Initialize button matrix @@ -185,7 +185,7 @@ fn main() -> ! { loop { if status_led_count_down.wait().is_ok() { - update_status_led(&mut status_led, caps_lock_active, gui_lock_active); + update_status_led(&mut status_led, &caps_lock_active, &gui_lock_state); } if usb_hid_report_count_down.wait().is_ok() { @@ -194,7 +194,7 @@ fn main() -> ! { fn_mode = get_fn_mode(pressed_keys); if !caps_lock_active { - update_status_led(&mut status_led, caps_lock_active, gui_lock_active); + update_status_led(&mut status_led, &caps_lock_active, &gui_lock_state); } for (index, key) in pressed_keys.iter().enumerate() { buttons[index].pressed = *key; @@ -203,7 +203,7 @@ fn main() -> ! { let keyboard_report = get_keyboard_report( &mut buttons, fn_mode, - &mut gui_lock_active, + &mut gui_lock_state, &mut gui_lock_trigger_index, ); @@ -258,17 +258,17 @@ fn main() -> ! { /// * `caps_lock_active` - Is capslock active fn update_status_led( status_led: &mut Ws2812StatusLed, - caps_lock_active: bool, - gui_lock_active: bool, + caps_lock_active: &bool, + gui_lock_state: &u8, ) where P: PIOExt + FunctionConfig, I: PinId, Function

: ValidPinMode, SM: StateMachineIndex, { - if caps_lock_active { + if *caps_lock_active { status_led.update(StatusMode::Warning); - } else if gui_lock_active { + } else if *gui_lock_state != 0 { status_led.update(StatusMode::Activity); } else { status_led.update(StatusMode::Normal); @@ -307,7 +307,7 @@ fn get_fn_mode(pressed_keys: [bool; NUMBER_OF_KEYS]) -> u8 { fn get_keyboard_report( matrix_keys: &mut [KeyboardButton; NUMBER_OF_KEYS], fn_mode: u8, - gui_lock_active: &mut bool, + gui_lock_state: &mut u8, gui_lock_trigger_index: &mut u8, ) -> [Keyboard; NUMBER_OF_KEYS] { let mut keyboard_report: [Keyboard; NUMBER_OF_KEYS] = @@ -315,24 +315,27 @@ fn get_keyboard_report( // Filter report based on Fn mode and pressed keys for (index, key) in matrix_keys.iter_mut().enumerate() { - if key.pressed != key.previous_pressed && key.pressed { - key.fn_mode = fn_mode; - } - // Check if GUI lock button is pressed if key.pressed != key.previous_pressed && key.pressed - && index == layout::GUI_LOCK_BUTTON[0] as usize - && !(*gui_lock_active) + && index as u8 == layout::GUI_LOCK_BUTTON[0] && fn_mode == layout::GUI_LOCK_BUTTON[1] + && *gui_lock_state == 0 { - *gui_lock_active = true; - key.previous_pressed = key.pressed; - continue; + *gui_lock_state = 1; } + // Set fn mode for the pressed button + if key.pressed != key.previous_pressed && key.pressed { + key.fn_mode = fn_mode; + } key.previous_pressed = key.pressed; + // Skip key if defined as NoEventIndicated + if layout::MAP[key.fn_mode as usize][index] == Keyboard::NoEventIndicated { + continue; + } + /// Index of GUI key in keyboard report /// Index 36, 37, 38, 45, 46, 47 are not used by any other keys const GUI_REPORT_INDEX: usize = 47; @@ -340,15 +343,18 @@ fn get_keyboard_report( // If GUI lock is active, set LeftGUI key to pressed // when next button is pressed. Keep LeftGUI pressed // until next button is released - if *gui_lock_active && key.pressed { + if *gui_lock_state == 1 && key.pressed { *gui_lock_trigger_index = index as u8; + *gui_lock_state = 2; keyboard_report[GUI_REPORT_INDEX] = Keyboard::LeftGUI; - } else if *gui_lock_trigger_index as usize == index && key.pressed { + } else if *gui_lock_state == 2 && *gui_lock_trigger_index == index as u8 && key.pressed { keyboard_report[GUI_REPORT_INDEX] = Keyboard::LeftGUI; - } else if *gui_lock_trigger_index as usize == index && !key.pressed { - *gui_lock_active = false; + *gui_lock_state = 3; + } else if *gui_lock_state == 3 && *gui_lock_trigger_index == index as u8 && !key.pressed { + *gui_lock_state = 0; } + // Add defined HID key to the report if key.pressed { keyboard_report[index] = layout::MAP[key.fn_mode as usize][index]; } From e332b0dc5e47e53b6259960f4744a98b742cbc70 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 19 Feb 2024 22:16:56 +0100 Subject: [PATCH 24/27] Added sticky key support --- rp2040/src/main.rs | 98 +++++++++++++++++++++++----------------- rp2040/src/status_led.rs | 28 ++++++++---- 2 files changed, 77 insertions(+), 49 deletions(-) diff --git a/rp2040/src/main.rs b/rp2040/src/main.rs index 1df1cac..ee3854f 100644 --- a/rp2040/src/main.rs +++ b/rp2040/src/main.rs @@ -161,11 +161,15 @@ fn main() -> ! { let mut status_led_count_down = timer.count_down(); status_led_count_down.start(250.millis()); + let mut start_count_down = timer.count_down(); + start_count_down.start(5000.millis()); + // Create variables to track caps lock and fn mode let mut caps_lock_active: bool = false; let mut fn_mode: u8; - let mut gui_lock_state: u8 = 0; - let mut gui_lock_trigger_index: u8 = 0; + let mut sticky_state: u8 = 0; + let mut sticky_key: Keyboard = Keyboard::NoEventIndicated; + let mut started: bool = false; // Initialize button matrix button_matrix.init_pins(); @@ -185,7 +189,11 @@ fn main() -> ! { loop { if status_led_count_down.wait().is_ok() { - update_status_led(&mut status_led, &caps_lock_active, &gui_lock_state); + update_status_led(&mut status_led, &caps_lock_active, &sticky_state, &started); + } + + if start_count_down.wait().is_ok() && !started { + started = true; } if usb_hid_report_count_down.wait().is_ok() { @@ -193,19 +201,16 @@ fn main() -> ! { fn_mode = get_fn_mode(pressed_keys); - if !caps_lock_active { - update_status_led(&mut status_led, &caps_lock_active, &gui_lock_state); + if !caps_lock_active && sticky_state != 2 { + update_status_led(&mut status_led, &caps_lock_active, &sticky_state, &started); } + for (index, key) in pressed_keys.iter().enumerate() { buttons[index].pressed = *key; } - let keyboard_report = get_keyboard_report( - &mut buttons, - fn_mode, - &mut gui_lock_state, - &mut gui_lock_trigger_index, - ); + let keyboard_report = + get_keyboard_report(&mut buttons, fn_mode, &mut sticky_state, &mut sticky_key); match keyboard.device().write_report(keyboard_report) { Err(UsbHidError::WouldBlock) => {} @@ -248,8 +253,8 @@ fn main() -> ! { /// Update status LED colour based on function layer and capslock /// -/// Normal = green (NORMAL) -/// GUI lock = blue (GUI LOCK) +/// Normal = Off (OFF) +/// STICKY lock = blue/falshing blue (ACTIVITY) /// Capslock active = flashing red (WARNING) /// Error = steady red (ERROR) /// @@ -259,7 +264,8 @@ fn main() -> ! { fn update_status_led( status_led: &mut Ws2812StatusLed, caps_lock_active: &bool, - gui_lock_state: &u8, + sticky_state: &u8, + started: &bool, ) where P: PIOExt + FunctionConfig, I: PinId, @@ -268,10 +274,14 @@ fn update_status_led( { if *caps_lock_active { status_led.update(StatusMode::Warning); - } else if *gui_lock_state != 0 { + } else if *sticky_state == 1 { status_led.update(StatusMode::Activity); - } else { + } else if *sticky_state == 2 { + status_led.update(StatusMode::ActivityFlash); + } else if !(*started) { status_led.update(StatusMode::Normal); + } else { + status_led.update(StatusMode::Off); } } @@ -302,27 +312,37 @@ fn get_fn_mode(pressed_keys: [bool; NUMBER_OF_KEYS]) -> u8 { /// /// * `matrix_keys` - Array of pressed keys /// * `fn_mode` - Current function layer -/// * `gui_lock` - Is GUI lock active -/// * `gui_lock_index` - Index of the key pressed after GUI lock was activated +/// * `sticky_state` - Is STICKY lock active +/// * `sticky_key` - the key pressed after STICKY lock was activated fn get_keyboard_report( matrix_keys: &mut [KeyboardButton; NUMBER_OF_KEYS], fn_mode: u8, - gui_lock_state: &mut u8, - gui_lock_trigger_index: &mut u8, + sticky_state: &mut u8, + sticky_key: &mut Keyboard, ) -> [Keyboard; NUMBER_OF_KEYS] { let mut keyboard_report: [Keyboard; NUMBER_OF_KEYS] = [Keyboard::NoEventIndicated; NUMBER_OF_KEYS]; // Filter report based on Fn mode and pressed keys for (index, key) in matrix_keys.iter_mut().enumerate() { - // Check if GUI lock button is pressed + // Check if STICKY button is pressed (SET STICKY) if key.pressed != key.previous_pressed && key.pressed - && index as u8 == layout::GUI_LOCK_BUTTON[0] - && fn_mode == layout::GUI_LOCK_BUTTON[1] - && *gui_lock_state == 0 + && index as u8 == layout::STICKY_BUTTON[0] + && fn_mode == layout::STICKY_BUTTON[1] + && *sticky_state == 0 { - *gui_lock_state = 1; + *sticky_state = 1; + } + // Check if STICKY button is pressed (CLEAR STICKY) + else if key.pressed != key.previous_pressed + && key.pressed + && index as u8 == layout::STICKY_BUTTON[0] + && fn_mode == layout::STICKY_BUTTON[1] + && *sticky_state != 0 + { + *sticky_state = 0; + *sticky_key = Keyboard::NoEventIndicated; } // Set fn mode for the pressed button @@ -336,22 +356,11 @@ fn get_keyboard_report( continue; } - /// Index of GUI key in keyboard report - /// Index 36, 37, 38, 45, 46, 47 are not used by any other keys - const GUI_REPORT_INDEX: usize = 47; - - // If GUI lock is active, set LeftGUI key to pressed - // when next button is pressed. Keep LeftGUI pressed - // until next button is released - if *gui_lock_state == 1 && key.pressed { - *gui_lock_trigger_index = index as u8; - *gui_lock_state = 2; - keyboard_report[GUI_REPORT_INDEX] = Keyboard::LeftGUI; - } else if *gui_lock_state == 2 && *gui_lock_trigger_index == index as u8 && key.pressed { - keyboard_report[GUI_REPORT_INDEX] = Keyboard::LeftGUI; - *gui_lock_state = 3; - } else if *gui_lock_state == 3 && *gui_lock_trigger_index == index as u8 && !key.pressed { - *gui_lock_state = 0; + // If STICKY lock is active, hold index key pressed until STICKY lock key is pressed + // again + if *sticky_state == 1 && key.pressed { + *sticky_key = layout::MAP[key.fn_mode as usize][index]; + *sticky_state = 2; } // Add defined HID key to the report @@ -359,5 +368,12 @@ fn get_keyboard_report( keyboard_report[index] = layout::MAP[key.fn_mode as usize][index]; } } + + /// Index of STICKY key in keyboard report + /// Index 36, 37, 38, 45, 46, 47 are not used by any other keys + const STICKY_REPORT_INDEX: usize = 46; + // Add sticky key to the report + keyboard_report[STICKY_REPORT_INDEX] = *sticky_key; + keyboard_report } diff --git a/rp2040/src/status_led.rs b/rp2040/src/status_led.rs index d56af7b..8d95e59 100644 --- a/rp2040/src/status_led.rs +++ b/rp2040/src/status_led.rs @@ -16,7 +16,7 @@ use ws2812_pio::Ws2812Direct; /// * OFF = Syatem offline /// * NORMAL = All system Ok /// * ACTIVITY = System activity -/// * OTHER = Other activity +/// * OTHER = Other activity /// * WARNING = Warning /// * ERROR = Error /// * BOOTLOADER = Bootloader active @@ -26,10 +26,12 @@ pub enum StatusMode { Off = 0, Normal = 1, Activity = 2, - Other = 3, - Warning = 4, - Error = 5, - Bootloader = 6, + ActivityFlash = 3, + Other = 4, + OtherFlash = 5, + Warning = 6, + Error = 7, + Bootloader = 8, } #[warn(dead_code)] @@ -100,22 +102,32 @@ where /// /// Make sure to call this function regularly to keep the LED flashing pub fn update(&mut self, mode: StatusMode) { - let colors: [RGB8; 7] = [ + let colors: [RGB8; 9] = [ (0, 0, 0).into(), // Off (10, 7, 0).into(), // Green (10, 4, 10).into(), // Blue + (10, 4, 10).into(), // Blue + (5, 10, 0).into(), // Orange (5, 10, 0).into(), // Orange (2, 20, 0).into(), // Red (2, 20, 0).into(), // Red (0, 10, 10).into(), // Purple ]; - if mode == StatusMode::Warning && !self.state { + if (mode == StatusMode::ActivityFlash + || mode == StatusMode::OtherFlash + || mode == StatusMode::Warning) + && !self.state + { self.ws2812_direct .write([colors[mode as usize]].iter().copied()) .unwrap(); self.state = true; - } else if mode == StatusMode::Warning || mode == StatusMode::Off { + } else if mode == StatusMode::ActivityFlash + || mode == StatusMode::OtherFlash + || mode == StatusMode::Warning + || mode == StatusMode::Off + { self.ws2812_direct .write([colors[0]].iter().copied()) .unwrap(); From 376f2547b643868e81af2abb5c3237165a3aea5e Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Mon, 19 Feb 2024 22:17:14 +0100 Subject: [PATCH 25/27] Changed key layout --- rp2040/src/layout.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rp2040/src/layout.rs b/rp2040/src/layout.rs index 27e8680..c3f72f8 100644 --- a/rp2040/src/layout.rs +++ b/rp2040/src/layout.rs @@ -36,8 +36,8 @@ use usbd_human_interface_device::page::Keyboard; /// This means that RightAlt is only available on layer 1 keys. pub const FN_BUTTONS: [u8; 3] = [40, 43, 44]; -/// GUI (Windows) buttons [index, layer] -pub const GUI_LOCK_BUTTON: [u8; 2] = [7, 2]; +/// Sticky button [index, layer] +pub const STICKY_BUTTON: [u8; 2] = [7, 2]; /// Button map to HID key (three Function layers) pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ @@ -151,21 +151,21 @@ pub const MAP: [[Keyboard; NUMBER_OF_KEYS]; 3] = [ // Function layer 2 // HID Key // Button Index // ----------------------------------------- - Keyboard::F11, // 0 - Keyboard::F12, // 1 - Keyboard::F13, // 2 - Keyboard::F14, // 3 - Keyboard::F15, // 4 - Keyboard::F16, // 5 + Keyboard::NoEventIndicated, // 0 + Keyboard::F11, // 1 + Keyboard::F12, // 2 + Keyboard::F13, // 3 + Keyboard::F14, // 4 + Keyboard::NoEventIndicated, // 5 Keyboard::Grave, // 6 § - Keyboard::NoEventIndicated, // 7 GUI lock + Keyboard::NoEventIndicated, // 7 STICKY lock Keyboard::LeftGUI, // 8 Keyboard::NoEventIndicated, // 9 Keyboard::CapsLock, // 10 Keyboard::DeleteBackspace, // 11 Keyboard::LeftControl, // 12 - Keyboard::NoEventIndicated, // 13 - Keyboard::NoEventIndicated, // 14 + Keyboard::F15, // 13 + Keyboard::F16, // 14 Keyboard::F17, // 15 Keyboard::F18, // 16 Keyboard::F19, // 17 From d2a87bd4be5a688afaad1aa1c8dc84382db36b9e Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Wed, 10 Jul 2024 21:04:04 +0200 Subject: [PATCH 26/27] Updated gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6f78e37..0aa410e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ rp2040/target rp2040/Cargo.lock teensylc/.cache/clangd/index teensylc/.ccls-cache +teensylc/.pio/build From ad992de8cc6d8ff6f501ceb026e41755e2e55979 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Wed, 10 Jul 2024 21:24:53 +0200 Subject: [PATCH 27/27] Updated layout --- teensylc/src/cmdr_keyboard.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teensylc/src/cmdr_keyboard.cpp b/teensylc/src/cmdr_keyboard.cpp index 53c9dab..6059633 100755 --- a/teensylc/src/cmdr_keyboard.cpp +++ b/teensylc/src/cmdr_keyboard.cpp @@ -110,7 +110,7 @@ Button buttons[NBR_OF_BUTTONS] = /* 21 */ {KEY_K, KEY_8, KEY_UP_ARROW, IDLE, NO_KEY, false}, /* 22 */ {KEY_L, KEY_9, KEY_RIGHT_ARROW, IDLE, NO_KEY, false}, /* 23 */ {KEY_SEMICOLON, KEY_0, KEY_DELETE, IDLE, NO_KEY, false}, -/* 24 */ {KEY_QUOTE, NO_KEY, NO_KEY, IDLE, NO_KEY, false}, +/* 24 */ {KEY_QUOTE, KEY_ENTER, KEY_ENTER, IDLE, NO_KEY, false}, /* 25 */ {KEY_LEFT_SHIFT, KEY_LEFT_SHIFT, KEY_LEFT_SHIFT, IDLE, NO_KEY, false}, /* 26 */ {KEY_Z, KEY_6, KEY_F20, IDLE, NO_KEY, false}, /* 27 */ {KEY_X, KEY_7, KEY_F21, IDLE, NO_KEY, false}, @@ -126,7 +126,7 @@ Button buttons[NBR_OF_BUTTONS] = /* 37 */ {KEY_LEFT_ALT, KEY_LEFT_ALT, KEY_LEFT_ALT, IDLE, NO_KEY, false}, /* 38 */ {KEY_FN, NO_KEY, NO_KEY, IDLE, NO_KEY, false}, /* 39 */ {KEY_SPACE, KEY_BACKSPACE, KEY_LEFT_GUI, IDLE, NO_KEY, false}, -/* 40 */ {KEY_ENTER, KEY_ENTER, KEY_ENTER, IDLE, NO_KEY, false}, +/* 40 */ {KEY_SPACE, KEY_BACKSPACE, KEY_BACKSPACE, IDLE, NO_KEY, false}, /* 41 */ {KEY_FN, NO_KEY, NO_KEY, IDLE, NO_KEY, false}, /* 42 */ {KEY_FN, KEY_RIGHT_ALT, NO_KEY, IDLE, NO_KEY, false}};