diff --git a/.clangd b/.clangd new file mode 100644 index 0000000..62a050d --- /dev/null +++ b/.clangd @@ -0,0 +1,8 @@ +CompileFlags: + Remove: + - -mno-thumb-interwork + - -mthumb-interwork + +Diagnostics: + UnusedIncludes: None + MissingIncludes: None diff --git a/justfile b/justfile index a1f7d72..37bfc77 100644 --- a/justfile +++ b/justfile @@ -2,6 +2,22 @@ default: @just --list +# compile moonlander matej keymap (artifact lands in firmware/) +moonlander: + make -C qmk_upstream zsa/moonlander:matej QMK_USERSPACE={{justfile_directory()}} + mkdir -p firmware + mv -f zsa_moonlander_matej.bin firmware/ + rm -f qmk_upstream/zsa_moonlander_matej.bin + +# compile + flash moonlander (polls until keyboard is in DFU mode; -d filter avoids the Cambridge DAC VID:PID collision) +flash-moonlander: moonlander + until dfu-util -a 0 -d 0483:df11 -s 0x08000000:leave -D firmware/zsa_moonlander_matej.bin >/dev/null 2>&1; do sleep 0.5; done + @echo "flashed" + +# generate compile_commands.json for clangd / LSP +compdb: + cd qmk_upstream && QMK_USERSPACE={{justfile_directory()}} qmk compile --compiledb -kb zsa/moonlander -km matej + # format C/H files in place fmt: git ls-files '*.c' '*.h' | xargs --no-run-if-empty clang-format -i diff --git a/qmk.json b/qmk.json index 3afc389..34e7587 100644 --- a/qmk.json +++ b/qmk.json @@ -1,4 +1,6 @@ { "userspace_version": "1.0", - "build_targets": [] + "build_targets": [ + ["zsa/moonlander", "matej"] + ] } \ No newline at end of file