Skip to content

Instantly share code, notes, and snippets.

View petejohanson's full-sized avatar

Pete Johanson petejohanson

View GitHub Profile
@petejohanson
petejohanson / gist:902588a7255d4e0a3bd87f6cc9e090ae
Created April 8, 2022 16:20
ZMK rom_report for Technikable
-- west build: running target rom_report
[0/1] cd /home/peter/git/zmk/app/build/technikable30 && /usr/bin/python3.10 /home/peter/git/zmk/zephyr/scripts/footprint/size_report -k /home/peter/git/zmk/app/build/technikable30/zephyr/zmk.elf -z /home/peter/git/zmk/zephyr -o /home/peter/git/zmk/app/build/technikable30 --workspace=/home/peter/git/zmk -d 99 rom
Path Size %
==============================================================================================================
Root 170842 100.00%
├── (hidden) 5733 3.36%
├── (no paths) 3590 2.10%
│ ├── CSWTCH.14 6 0.00%
│ ├── C
-- west build: running target ram_report
[0/1] cd /home/peter/git/zmk/app/build/zl_ble && /usr/bin/python3.10 /home/peter/git/zmk/zephyr/scripts/footprint/size_report -k /home/peter/git/zmk/app/build/zl_ble/zephyr/zmk.elf -z /home/peter/git/zmk/zephyr -o /home/peter/git/zmk/app/build/zl_ble --workspace=/home/peter/git/zmk -d 99 ram
Path Size %
==============================================================================================================
Root 61166 100.00%
├── (hidden) 4751 7.77%
├── (no paths) 5014 8.20%
│ ├── CSWTCH.14 6 0.01%
│ ├── CSWTCH.17
#include <dt-bindings/zmk/keys.h>
#include <behaviors.dtsi>
/ {
behaviors {
lr: positional_hold_tap {
compatible = "zmk,behavior-hold-tap";
label = "LAYER_REPEAT_HT";
#binding-cells = <1>;
flavor = "hold-preferred";
warning: `part1` (bin "part1") generated 1 warning
error: could not compile `part1` due to previous error; 1 warning emitted
d474c7e06993:/workspace/day2/part1$ cargo run
Compiling part1 v0.1.0 (/workspace/day2/part1)
error[E0283]: type annotations needed
--> src/main.rs:26:26
|
26 | let mut dir_parser = alt((
| -------------- ^^^ cannot infer type for type parameter `E` declared on the function `alt`
| |
@petejohanson
petejohanson / esp32-c3.log
Created November 12, 2021 18:21
Log booting the M5 Stamp C3
❯ sudo tio /dev/ttyACM0
[sudo] password for peter:
[tio 13:20:11] tio v1.32
[tio 13:20:11] Press ctrl-t q to quit
[tio 13:20:11] Connected
ESP-ROM:esp32c3-api1-20210207
Build:Feb 7 2021
rst:0xf (BROWNOUT_RST),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
@petejohanson
petejohanson / zmk-rfc-service-support-for-studio.md
Created October 22, 2021 17:45
WIP - ZMK firmware enhancement RFC to support ZMK Studio

RFC: Studio Firmware Support

Needs

  • Support keys and encoders, as inputs.
    • Consider future pointer input settings, but not in the initial scope.
  • Support multiple layouts (e.g. board w/ ANSI and ISO layouts, or numpads w/ 1u and 2u options, etc.)
    • Ideally, the layout can be selected by studio as well, so you can flash one firmware to a board, and then configure which layout you've built/setup.
    • Each layout should be able to specify all the physical locations of the keys and encoders for that layout.
  • Have encoders as an optional layer on top of any given layout.
@petejohanson
petejohanson / service.proto
Created October 22, 2021 16:43
ZMK service definition for ZMK Studio Interactions
syntax = "proto3";
import "zmk/ble/gatt.proto";
import "zmk/layout/layout.proto";
import "zmk/keymap/keymap.proto";
package zmk;
message GetLayoutsRequest {}
message GetLayoutsResponse { repeated zmk.layout.Layout layouts = 1; }

Thank you, contributor, for your patience with how long review and merge of boards/shields has taken!

There are three recent refactors/changes to boards and shields that require some attention, and then we can finally get this PR merged!

  1. Hardware Metadata
  2. Pro Micro shield DT naming changes
  3. Split changes for BLE advertising

Hardware Metadata

@petejohanson
petejohanson / .config
Created September 25, 2021 18:19
Zaphod config
#
# ZMK
#
#
# Basic Keyboard Setup
#
CONFIG_ZMK_KEYBOARD_NAME="Zaphod"
CONFIG_USB_DEVICE_PRODUCT="Zaphod"
# Copyright (c) 2021 The ZMK Contributors
# SPDX-License-Identifier: MIT
'''Metadata command for ZMK.'''
from functools import cached_property
import glob
import json
from jsonschema import validate, ValidationError
import os
import sys