patch 9.1.0823: filetype: Zephyr overlay files not recognized

Problem:  filetype: Zephyr overlay files not recognized
Solution: detect '*.overlay' files as dts filetype,
          include syntax tests for DTS files
          (Xudong Zheng)

Reference:
https://docs.zephyrproject.org/latest/build/dts/howtos.html

closes: #15963

Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Xudong Zheng
2024-10-31 09:32:25 +01:00
committed by Christian Brabandt
parent d52fb2fabd
commit a68bd6f089
8 changed files with 108 additions and 3 deletions

View File

@ -754,8 +754,12 @@ au BufNewFile,BufRead *.dsl
" DTD (Document Type Definition for XML)
au BufNewFile,BufRead *.dtd setf dtd
" DTS/DSTI/DTSO (device tree files)
au BufNewFile,BufRead *.dts,*.dtsi,*.dtso,*.its,*.keymap setf dts
" Devicetree (.its for U-Boot Flattened Image Trees, .keymap for ZMK keymap, and
" .overlay for Zephyr overlay)
au BufNewFile,BufRead *.dts,*.dtsi,*.dtso setf dts
au BufNewFile,BufRead *.its setf dts
au BufNewFile,BufRead *.keymap setf dts
au BufNewFile,BufRead *.overlay setf dts
" Earthfile
au BufNewFile,BufRead Earthfile setf earthfile

View File

@ -0,0 +1,20 @@
>/+0&#ffffff0| |{| @71
@8|c+0#00e0003&|h|o|s|e|n| |{+0#0000000&| @58
@16|z|e|p|h|y|r|,|u|a|r|t|-|m|c|u|m|g|r| |=| |&+0#e000e06&|c|d|c|_|a|c|m|_|u|a|r|t|0|;+0#0000000&| @22
@16|z|e|p|h|y|r|,|s|h|e|l@1|-|u|a|r|t| |=| |&+0#e000e06&|c|d|c|_|a|c|m|_|u|a|r|t|1|;+0#0000000&| @23
@8|}|;| @64
|}|;| @72
@75
|&+0#e000e06&|z|e|p|h|y|r|_|u|d|c|0| +0#0000000&|{| @60
| +0#af5f00255&@7|c|d|c|_|a|c|m|_|u|a|r|t|0|:| +0#0000000&|c+0#00e0003&|d|c|_|a|c|m|_|u|a|r|t|0| |{+0#0000000&| @36
@16|c|o|m|p|a|t|i|b|l|e| |=| |"+0#e000002&|z|e|p|h|y|r|,|c|d|c|-|a|c|m|-|u|a|r|t|"|;+0#0000000&| @23
@8|}|;| @64
@75
| +0#af5f00255&@7|c|d|c|_|a|c|m|_|u|a|r|t|1|:| +0#0000000&|c+0#00e0003&|d|c|_|a|c|m|_|u|a|r|t|1| |{+0#0000000&| @36
@16|c|o|m|p|a|t|i|b|l|e| |=| |"+0#e000002&|z|e|p|h|y|r|,|c|d|c|-|a|c|m|-|u|a|r|t|"|;+0#0000000&| @23
@8|}|;| @64
|}|;| @72
|~+0#4040ff13&| @73
|~| @73
|~| @73
| +0#0000000&@56|1|,|1| @10|A|l@1|

View File

@ -0,0 +1,20 @@
>#+0#e000e06#ffffff0|i|n|c|l|u|d|e| |<+0#e000002&|b|e|h|a|v|i|o|r|s|.|d|t|s|i|>| +0#0000000&@49
|#+0#e000e06&|i|n|c|l|u|d|e| |<+0#e000002&|d|t|-|b|i|n|d|i|n|g|s|/|z|m|k|/|k|e|y|s|.|h|>| +0#0000000&@41
@75
|/+0#0000e05&@1| |D|e|f|i|n|e| |m|a|c|r|o| |f|o|r| |l|a|y|e|r|s|.| +0#0000000&@47
|#+0#e000e06&|d|e|f|i|n|e| |L|A|Y|E|R|_|M|A|I|N| |0| +0#0000000&@54
@75
|/| |{| @71
@8|k+0#00e0003&|e|y|m|a|p| |{+0#0000000&| @58
@16|c|o|m|p|a|t|i|b|l|e| |=| |"+0#e000002&|z|m|k|,|k|e|y|m|a|p|"|;+0#0000000&| @32
@75
@16|l+0#00e0003&|a|y|e|r|_|0| |{+0#0000000&| @49
@24|b|i|n|d|i|n|g|s| |=| |<+0#e000002&| +0#0000000&@38
| +0#e000002&@31|&+0#e000e06&|k|p| +0#e000002&|Z| +0#0000000&@37
| +0#e000002&@31|&+0#e000e06&|k|p| +0#e000002&|M| +0#0000000&@37
| +0#e000002&@31|&+0#e000e06&|k|p| +0#e000002&|K| +0#0000000&@37
| +0#e000002&@31|&+0#e000e06&|z|m|k|_|s|t|r|i|n|g| +0#0000000&@31
| +0#e000002&@31|&+0#e000e06&|t|o| +0#e000002&|L|A|Y|E|R|_|M|A|I|N| +0#0000000&@28
| +0#e000002&@23|>|;+0#0000000&| @48
@16|}|;| @56
@57|1|,|1| @10|T|o|p|

View File

@ -0,0 +1,20 @@
| +0#e000002#ffffff0@31|&+0#e000e06&|k|p| +0#e000002&|M| +0#0000000&@37
| +0#e000002&@31|&+0#e000e06&|k|p| +0#e000002&|K| +0#0000000&@37
| +0#e000002&@31|&+0#e000e06&|z|m|k|_|s|t|r|i|n|g| +0#0000000&@31
| +0#e000002&@31|&+0#e000e06&|t|o| +0#e000002&|L|A|Y|E|R|_|M|A|I|N| +0#0000000&@28
| +0#e000002&@23|>|;+0#0000000&| @48
@16>}|;| @56
@8|}|;| @64
@75
@8|Z|M|K|_|M|A|C|R|O|(|z|m|k|_|s|t|r|i|n|g|,| |w|a|i|t|-|m|s| |=| |<+0#e000002&|1|0|>|;+0#0000000&| |t|a|p|-|m|s| |=| |<+0#e000002&|1|0|>|;+0#0000000&| |b|i|n|d|i|n|g|s| |=| |<+0#e000002&|&+0#e000e06&|m
|a|c|r|o|_|t|a|p| +0#e000002&|&+0#e000e06&|k|p| +0#e000002&|Z| |&+0#e000e06&|k|p| +0#e000002&|M| |&+0#e000e06&|k|p| +0#e000002&|K|>|;+0#0000000&|)| @45
|}|;| @72
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
| +0#0000000&@56|1|9|,|3|-|1|7| @6|B|o|t|

View File

@ -0,0 +1,16 @@
/ {
chosen {
zephyr,uart-mcumgr = &cdc_acm_uart0;
zephyr,shell-uart = &cdc_acm_uart1;
};
};
&zephyr_udc0 {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
cdc_acm_uart1: cdc_acm_uart1 {
compatible = "zephyr,cdc-acm-uart";
};
};

View File

@ -0,0 +1,23 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
// Define macro for layers.
#define LAYER_MAIN 0
/ {
keymap {
compatible = "zmk,keymap";
layer_0 {
bindings = <
&kp Z
&kp M
&kp K
&zmk_string
&to LAYER_MAIN
>;
};
};
ZMK_MACRO(zmk_string, wait-ms = <10>; tap-ms = <10>; bindings = <&macro_tap &kp Z &kp M &kp K>;)
};

View File

@ -239,7 +239,7 @@ def s:GetFilenameChecks(): dict<list<string>>
dracula: ['file.drac', 'file.drc', 'file.lvs', 'file.lpe', 'drac.file'],
dtd: ['file.dtd'],
dtrace: ['/usr/lib/dtrace/io.d'],
dts: ['file.dts', 'file.dtsi', 'file.dtso', 'file.its', 'file.keymap'],
dts: ['file.dts', 'file.dtsi', 'file.dtso', 'file.its', 'file.keymap', 'file.overlay'],
dune: ['jbuild', 'dune', 'dune-project', 'dune-workspace', 'dune-file'],
dylan: ['file.dylan'],
dylanintr: ['file.intr'],

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
823,
/**/
822,
/**/