Skip to content

afc.cfg: define _AFC_GLOBAL_VARS so the BT_* helper macros work - #314

Open
kyleinoregon wants to merge 1 commit into
OpenCentauri:mainfrom
kyleinoregon:canvas-afc-macro-vars
Open

afc.cfg: define _AFC_GLOBAL_VARS so the BT_* helper macros work#314
kyleinoregon wants to merge 1 commit into
OpenCentauri:mainfrom
kyleinoregon:canvas-afc-macro-vars

Conversation

@kyleinoregon

Copy link
Copy Markdown

BT_CHANGE_TOOL, BT_LANE_EJECT, BT_LANE_MOVE, AFC_DISABLE_SKEW and AFC_ENABLE_SKEW in the shipped afc.cfg all read printer['gcode_macro _AFC_GLOBAL_VARS']. Upstream AFC defines that section in AFC_Macro_Vars.cfg, which COSMOS does not ship, so every one of those macros fails with a Jinja error the first time someone tries them.

This adds the section with the three variables the shipped macros use, with the lane prefix set to CANVAS_, so BT_CHANGE_TOOL LANE=2 becomes CHANGE_TOOL LANE=CANVAS_2.

A user who already defined _AFC_GLOBAL_VARS in printer.cfg keeps working: Klipper merges duplicate sections and the later one wins.

Tested

On a CC1 with CANVAS on 26.08.0 with this section in printer.cfg (same content): BT_LANE_EJECT LANE=2 resolves to LANE_UNLOAD LANE=CANVAS_2 and runs; without the section it fails with 'gcode_macro _AFC_GLOBAL_VARS' undefined.

Related: the lane eject those macros call is being enabled in the AFC fork (suchmememanyskill/AFC-Klipper-Add-On#1); once that lands the AFC recipe's SRCREV can move.

BT_CHANGE_TOOL, BT_LANE_EJECT, BT_LANE_MOVE, AFC_DISABLE_SKEW and
AFC_ENABLE_SKEW all read printer['gcode_macro _AFC_GLOBAL_VARS'], which
upstream AFC defines in AFC_Macro_Vars.cfg. COSMOS ships its own afc.cfg
without that section, so every one of those macros fails with a template
error. Define the three variables the shipped macros use, with the lane
prefix set to CANVAS_.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants