Skip to content

Commit

Permalink
fix(templates): Escape <& in templates
Browse files Browse the repository at this point in the history
Mako has an undocumented behavior (likely a bug) where <& gets turned
into just &. This is a fairly common sequence in Devicetree, so there
were a few places in the templates affected by this.

This changes all instances of <&node> to <${'&node'}> as a workaround.
  • Loading branch information
joelspadin committed Oct 20, 2024
1 parent e011f98 commit 9d90d74
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion zmk/templates/board/nrf52840/common_inner.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// vbatt: vbatt {
// compatible = "voltage-divider";
// io-channels = <&adc 2>;
// io-channels = <${'&adc 2'}>;
// output-ohms = <2000000>;
// full-ohms = <(2000000 + 806000)>;
// };
4 changes: 2 additions & 2 deletions zmk/templates/board/nrf52840/common_outer.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
&uart0 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-0 = <${'&uart0_default'}>;
pinctrl-1 = <${'&uart0_sleep'}>;
pinctrl-names = "default", "sleep";
};

Expand Down
12 changes: 6 additions & 6 deletions zmk/templates/common/layouts.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
default_layout: default_layout {
compatible = "zmk,physical-layout";
display-name = "Default Layout";
transform = <&default_transform>;
kscan = <&kscan>;
transform = <${'&default_transform'}>;
kscan = <${'&kscan'}>;

// Edit this to define the positions and sizes of the keys, or remove it
// if your keyboard will not support ZMK Studio.
// https://zmk.dev/docs/development/hardware-integration/physical-layouts#optional-keys-property
keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 0 0 0 0>
, <&key_physical_attrs 100 100 100 0 0 0 0>
, <&key_physical_attrs 100 100 0 100 0 0 0>
, <&key_physical_attrs 100 100 100 100 0 0 0>
= <${'&key_physical_attrs'} 100 100 0 0 0 0 0>
, <${'&key_physical_attrs'} 100 100 100 0 0 0 0>
, <${'&key_physical_attrs'} 100 100 0 100 0 0 0>
, <${'&key_physical_attrs'} 100 100 100 100 0 0 0>
;
};
};

0 comments on commit 9d90d74

Please sign in to comment.