Skip to content

Instantly share code, notes, and snippets.

View petejohanson's full-sized avatar

Pete Johanson petejohanson

View GitHub Profile
@petejohanson
petejohanson / gist:40271f9fa531969869862544c50f88b0
Created September 10, 2021 05:34
ZMK Setup Script Auto-Generated
❯ bash -c "$(curl -fsSL https://deploy-preview-883--zmk.netlify.app/setup.sh)"
Keyboard Selection:
1) BFO-9000 9) Jian 17) REVIUNG41
2) Boardsource 3x4 Macropad 10) Jorne 18) Romac+ Macropad
3) Corne 11) Kyria 19) Romac Macropad
4) Cradio/Ferris Sweep 12) Lily58 20) Sofle
5) CRBN Featherlight 13) Microdox 21) Splitreus62
6) eek! 14) Nibble 22) TG4x
7) Helix 15) QAZ 23) Tidbit Numpad
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <kernel.h>
#include <bluetooth/services/bas.h>
#include <logging/log.h>
@petejohanson
petejohanson / board.dts
Created September 1, 2021 14:06
Zephyr level shifter GPIO abstraction
/dts-v1/
/ {
shifter: 74hc595a@0 {
compatible = "ti,xx74hc595a";
a-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
b-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
c-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
import React from 'react';
import Layout from '@theme/Layout';
import { HardwareMetadata } from "../hardware-metadata";
function HardwareList(metadata: HardwareMetadata[]) {
return (
<Layout title="Hello">
{metadata.map(hm => <li>{hm.id}</li>)}
@petejohanson
petejohanson / west.yml
Created December 31, 2020 17:03
Example west.yml for testing my spam fix PR
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
- name: petejohanson
url-base: https://github.com/petejohanson
projects:
- name: zmk
remote: petejohanson
revision: core/ble-split-central-notify-main-thread
@petejohanson
petejohanson / seeeduino_xiao.overlay
Created December 29, 2020 15:42
Seeeduino XIAO Zephyr overlay for logic pin nexus nodes.
/ {
xiao_d: connector_d {
compatible = "seeeduino,xiao,gpio";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map
= <0 0 &porta 2 0> /* D0 */
, <1 0 &porta 4 0> /* D1 */
/*
* Copyright (c) 2020 Peter Johanson <[email protected]>
*
* SPDX-License-Identifier: MIT
*/
#include <logging/log.h>
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
@petejohanson
petejohanson / kyria.keymap
Last active August 6, 2020 20:50
Example refactored Kyria keymap
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
// ---------------------------------------------------------------------------------------------------------------------------------
// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ |
@petejohanson
petejohanson / README.md
Created June 18, 2020 02:58
ZMK behavior driver example

An approach at encoding behaviours. Even though this is defined in DT, it ends up generating sane structs holding the "behaviour label" and configured user params (e.g. keycode for that binding) which could be compiled in, and then updated with the values from some config stored in NVS.

The equivalent JSON for a "key press with keycode A" in the JSON would be:

{
 "bindings": [
@petejohanson
petejohanson / Error
Last active July 7, 2017 03:17
MonadState/StateT confusion
/home/peter/git/arachnid/src/Arachnid/Decisions.hs:129:17: error:
• Could not deduce (MonadState
Resp.ResponseData
(StateT a (StateT Resp.ResponseData (ResourceT IO))))
arising from a use of ‘gets’
from the context: Resource a
bound by the type signature for:
getBody :: Resource a =>
ResourceMonadResult a (Maybe (IO LBS.ByteString))
at src/Arachnid/Decisions.hs:123:1-86