Skip to content

Instantly share code, notes, and snippets.

View genfab-nda's full-sized avatar
🎯
Focusing

Nick Armstrong genfab-nda

🎯
Focusing
View GitHub Profile
@genfab-nda
genfab-nda / gist:3219be07ca944bb12234c05c6b9b430e
Created June 20, 2022 17:32
Alias traditional gcode commands to Klipper's extended command format
Traditional gcode commands used by Marlin use the syntax `CODE [ARG[VALUE]]`, whereas the
extended format in klipper uses the syntax CODE [ARG[=VALUE]]. It's possible to mimic the
functionality of `{rawparams}` using Jinja2's for statement on the `params` object to
alias one type to another.
Extended to Traditional:
[gcode_macro EXTENDED_MACRO]
gcode:
GXX {% for p in params %}{'%s%s ' % (p, params[p])}{% endfor %}
@genfab-nda
genfab-nda / gist:6cc520dea7280f6e6b70ed2b8856d6ca
Created June 20, 2022 17:19
Updating Klipper [include] configs using SAVE_CONFIG
Klipper attempts to comment out cofig fields being overwritted by `SAVE_CONFIG` when the command is executed.
This functionality does not apply to config files attached to `printer.cfg` using the `[include config_name]`
section. To overcome this for fields that will trigger a shutdown when missing, like a heater control field,
a dummy save config must be included in `printer.cfg` and the fields must be manually commented out in the
include.
For example, a machine with a bed configuration in configs/heater_bed, the following dummy would need to be
appended to `printer.cfg`:
#*# <---------------------- SAVE_CONFIG ---------------------->
@genfab-nda
genfab-nda / printer.cfg
Created August 18, 2021 20:50 — forked from CircuitSetup/printer.cfg
CR-30 Config
# This file contains pin mappings for the Creality CR-30 PrintMill. To
# use this config, during "make menuconfig" select the STM32F103 with
# a "28KiB bootloader" and serial (on USART1 PA10/PA9) communication.
# If you prefer a direct serial connection, in "make menuconfig"
# select "Enable extra low-level configuration options" and select
# serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
# cable used for the LCD module as follows:
# 3: Tx, 4: Rx, 9: GND, 10: VCC
### Keybase proof
I hereby claim:
* I am genfab-nda on github.
* I am nickarmstrong (https://keybase.io/nickarmstrong) on keybase.
* I have a public key ASAFaHcA6CV_iH2VaujaSIvwRl4_W92y8eRXGvsqC7Iqgwo
To claim this, I am signing this object: