summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2025-06-15 01:56:45 +0000
committerQMK Bot <hello@qmk.fm>2025-06-15 01:56:45 +0000
commit02bed7e5a5624a8ca3818c110017536b681a85e3 (patch)
tree8d11d0865f13bfce642a0518262ba78e4e1845f0
parent7919848324076250894542c12adcd6781c99b9d1 (diff)
parent7f9ceef3dd52066b6349130a93bfc681cd435d68 (diff)
Merge remote-tracking branch 'origin/master' into develop
-rw-r--r--.clangd35
-rwxr-xr-xlib/python/qmk/compilation_database.py13
-rw-r--r--platforms/avr/_wait.h2
3 files changed, 42 insertions, 8 deletions
diff --git a/.clangd b/.clangd
index 63dadd7e7c..82ee5628b0 100644
--- a/.clangd
+++ b/.clangd
@@ -1,4 +1,33 @@
1CompileFlags: 1CompileFlags:
2 Add: [-Wno-unknown-attributes, -Wno-maybe-uninitialized, -Wno-unknown-warning-option] 2 Add:
3 Remove: [-W*, -mmcu=*, -mcpu=*, -mfpu=*, -mfloat-abi=*, -mno-unaligned-access, -mno-thumb-interwork, -mcall-prologues, -D__has_include*] 3 [
4 Compiler: clang 4 -Wno-unknown-attributes,
5 -Wno-maybe-uninitialized,
6 -Wno-unknown-warning-option,
7 -Wno-pointer-to-int-cast,
8 -Wno-int-to-void-pointer-cast,
9 -DPROGMEM=,
10 ]
11 Remove:
12 [
13 -W*,
14 -mmcu=*,
15 -mcpu=*,
16 -mfpu=*,
17 -mfloat-abi=*,
18 -mno-unaligned-access,
19 -mno-thumb-interwork,
20 -mcall-prologues,
21 -D__has_include*,
22 -mlra,
23 ]
24 Compiler: clang
25Diagnostics:
26 UnusedIncludes: None
27 Suppress:
28 [
29 asm_invalid_output_constraint,
30 asm_invalid_input_constraint,
31 invalid_asm_value_for_constraint,
32 anyx86_interrupt_attribute,
33 ]
diff --git a/lib/python/qmk/compilation_database.py b/lib/python/qmk/compilation_database.py
index c403297405..851dc3f157 100755
--- a/lib/python/qmk/compilation_database.py
+++ b/lib/python/qmk/compilation_database.py
@@ -44,8 +44,7 @@ def cpu_defines(binary: str, compiler_args: str) -> List[str]:
44 invocation.extend(['-x', 'c', '-std=gnu11']) 44 invocation.extend(['-x', 'c', '-std=gnu11'])
45 elif binary.endswith("g++"): 45 elif binary.endswith("g++"):
46 invocation.extend(['-x', 'c++', '-std=gnu++14']) 46 invocation.extend(['-x', 'c++', '-std=gnu++14'])
47 compiler_args = shlex.split(compiler_args) 47 invocation.extend(shlex.split(compiler_args))
48 invocation.extend(compiler_args)
49 invocation.append('-') 48 invocation.append('-')
50 result = cli.run(invocation, capture_output=True, check=True, stdin=None, input='\n') 49 result = cli.run(invocation, capture_output=True, check=True, stdin=None, input='\n')
51 define_args = [] 50 define_args = []
@@ -55,7 +54,11 @@ def cpu_defines(binary: str, compiler_args: str) -> List[str]:
55 define_args.append(f'-D{line_args[1]}={line_args[2]}') 54 define_args.append(f'-D{line_args[1]}={line_args[2]}')
56 elif len(line_args) == 2 and line_args[0] == '#define': 55 elif len(line_args) == 2 and line_args[0] == '#define':
57 define_args.append(f'-D{line_args[1]}') 56 define_args.append(f'-D{line_args[1]}')
58 return list(sorted(set(define_args))) 57
58 type_filter = re.compile(
59 r'^-D__(SIZE|INT|UINT|WINT|WCHAR|BYTE|SHRT|SIG|FLOAT|LONG|CHAR|SCHAR|DBL|FLT|LDBL|PTRDIFF|QQ|DQ|DA|HA|HQ|SA|SQ|TA|TQ|UDA|UDQ|UHA|UHQ|USQ|USA|UTQ|UTA|UQQ|UQA|ACCUM|FRACT|UACCUM|UFRACT|LACCUM|LFRACT|ULACCUM|ULFRACT|LLACCUM|LLFRACT|ULLACCUM|ULLFRACT|SACCUM|SFRACT|USACCUM|USFRACT)'
60 )
61 return list(sorted(set(filter(lambda x: not type_filter.match(x), define_args))))
59 return [] 62 return []
60 63
61 64
@@ -92,8 +95,8 @@ def parse_make_n(f: Iterator[str]) -> List[Dict[str, str]]:
92 for s in system_libs(binary): 95 for s in system_libs(binary):
93 args += ['-isystem', '%s' % s] 96 args += ['-isystem', '%s' % s]
94 args.extend(cpu_defines(binary, ' '.join(shlex.quote(s) for s in compiler_args))) 97 args.extend(cpu_defines(binary, ' '.join(shlex.quote(s) for s in compiler_args)))
95 new_cmd = ' '.join(shlex.quote(s) for s in args) 98 args[0] = binary
96 records.append({"directory": str(QMK_FIRMWARE.resolve()), "command": new_cmd, "file": this_file}) 99 records.append({"arguments": args, "directory": str(QMK_FIRMWARE.resolve()), "file": this_file})
97 state = 'start' 100 state = 'start'
98 101
99 return records 102 return records
diff --git a/platforms/avr/_wait.h b/platforms/avr/_wait.h
index 39cbf618d2..54f578ace0 100644
--- a/platforms/avr/_wait.h
+++ b/platforms/avr/_wait.h
@@ -21,6 +21,8 @@
21#include <util/delay.h> 21#include <util/delay.h>
22#pragma GCC diagnostic pop 22#pragma GCC diagnostic pop
23 23
24extern void __builtin_avr_delay_cycles(uint32_t);
25
24// http://ww1.microchip.com/downloads/en/devicedoc/atmel-0856-avr-instruction-set-manual.pdf 26// http://ww1.microchip.com/downloads/en/devicedoc/atmel-0856-avr-instruction-set-manual.pdf
25// page 22: Table 4-2. Arithmetic and Logic Instructions 27// page 22: Table 4-2. Arithmetic and Logic Instructions
26/* 28/*