From d3894392d5f4a6df097c5af3df731a325ac54a57 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Mon, 1 Jul 2024 16:49:03 -0600 Subject: [PATCH] Replace clang-format with uncrustify LLVM/clang is not used for any compilation due to it not supporting the 8-bit architectures we use (MCS-51, AVR). This means we are effectively installing 250+ MiB of dependencies for a C formatting tool. Replace it with uncrustify, which uses only ~600 KiB of space and has more granular control of formatting (800+ options). Signed-off-by: Tim Crawford --- .clang-format | 141 ---------------- .github/workflows/ci.yml | 2 +- .uncrustify.cfg | 156 ++++++++++++++++++ Makefile | 2 +- scripts/clang-format.sh | 16 -- scripts/deps.sh | 6 +- scripts/lint/02-clang-format.sh | 34 ---- scripts/lint/02-uncrustify.sh | 36 ++++ src/arch/8051/time.c | 2 +- src/arch/avr/i2c_slave.c | 2 + src/arch/avr/include/arch/gpio.h | 2 - src/arch/avr/uart.c | 2 - src/board/arduino/mega2560/parallel.c | 21 ++- src/board/arduino/uno/parallel.c | 23 +-- src/board/system76/addw1/gpio.c | 4 +- src/board/system76/addw1/include/board/gpio.h | 2 - src/board/system76/addw2/gpio.c | 4 +- src/board/system76/addw2/include/board/gpio.h | 2 - src/board/system76/addw3/gpio.c | 4 +- src/board/system76/addw4/gpio.c | 4 +- src/board/system76/bonw14/gpio.c | 4 +- .../system76/bonw14/include/board/gpio.h | 2 - src/board/system76/bonw15/gpio.c | 4 +- .../system76/bonw15/include/board/gpio.h | 2 - src/board/system76/common/acpi.c | 22 +-- src/board/system76/common/charger/bq24780s.c | 4 +- src/board/system76/common/charger/oz26786.c | 5 +- src/board/system76/common/espi.c | 2 +- src/board/system76/common/fan.c | 6 - src/board/system76/common/flash/main.c | 7 +- .../system76/common/include/board/flash.h | 2 - src/board/system76/common/kbc.c | 2 - src/board/system76/common/kbled/common.c | 2 - src/board/system76/common/kbscan.c | 2 - src/board/system76/common/parallel.c | 2 - src/board/system76/common/peci.c | 2 - src/board/system76/common/power.c | 2 - src/board/system76/darp10-b/gpio.c | 4 +- src/board/system76/darp10/gpio.c | 4 +- src/board/system76/darp5/gpio.c | 4 +- src/board/system76/darp5/include/board/gpio.h | 2 - src/board/system76/darp7/gpio.c | 4 +- src/board/system76/darp7/include/board/gpio.h | 2 - src/board/system76/darp8/gpio.c | 4 +- src/board/system76/darp8/include/board/gpio.h | 2 - src/board/system76/darp9/gpio.c | 4 +- src/board/system76/darp9/include/board/gpio.h | 2 - src/board/system76/galp3-c/gpio.c | 4 +- .../system76/galp3-c/include/board/gpio.h | 2 - src/board/system76/galp5/gpio.c | 4 +- src/board/system76/galp5/include/board/gpio.h | 2 - src/board/system76/galp6/gpio.c | 4 +- src/board/system76/galp6/include/board/gpio.h | 2 - src/board/system76/gaze15/gpio.c | 4 +- .../system76/gaze15/include/board/gpio.h | 2 - src/board/system76/gaze16-3050/gpio.c | 4 +- src/board/system76/gaze16-3060/gpio.c | 4 +- src/board/system76/gaze17-3050/gpio.c | 4 +- src/board/system76/gaze17-3060/gpio.c | 4 +- src/board/system76/gaze18/gpio.c | 4 +- src/board/system76/lemp10/gpio.c | 4 +- .../system76/lemp10/include/board/gpio.h | 2 - src/board/system76/lemp11/gpio.c | 4 +- .../system76/lemp11/include/board/gpio.h | 2 - src/board/system76/lemp12/gpio.c | 4 +- .../system76/lemp12/include/board/gpio.h | 2 - src/board/system76/lemp13-b/gpio.c | 4 +- .../system76/lemp13-b/include/board/gpio.h | 2 - src/board/system76/lemp13/gpio.c | 4 +- .../system76/lemp13/include/board/gpio.h | 2 - src/board/system76/lemp9/gpio.c | 4 +- src/board/system76/lemp9/include/board/gpio.h | 2 - src/board/system76/oryp11/gpio.c | 4 +- src/board/system76/oryp12/gpio.c | 4 +- src/board/system76/oryp5/gpio.c | 4 +- src/board/system76/oryp5/include/board/gpio.h | 2 - src/board/system76/oryp6/gpio.c | 4 +- src/board/system76/oryp6/include/board/gpio.h | 2 - src/board/system76/oryp7/gpio.c | 4 +- src/board/system76/oryp7/include/board/gpio.h | 2 - src/board/system76/oryp8/gpio.c | 4 +- src/board/system76/oryp9/gpio.c | 4 +- src/board/system76/oryp9/include/board/gpio.h | 2 - src/board/system76/serw13/gpio.c | 4 +- .../system76/serw13/include/board/gpio.h | 2 - src/common/i2c.c | 4 - src/common/include/common/i2c.h | 4 - src/common/keymap.c | 34 ++-- src/common/version.c | 2 - src/ec/ite/i2c.c | 9 +- src/ec/ite/include/ec/espi.h | 2 - src/ec/ite/include/ec/gpio.h | 4 - src/ec/ite/intc.c | 2 - src/ec/ite/pmc.c | 2 - src/ec/ite/ps2.c | 2 - src/ec/ite/signature.c | 2 - src/ec/ite/wuc.c | 4 - .../system76/14in_81/include/board/keymap.h | 4 +- .../system76/14in_81/keymap/default.c | 4 +- src/keyboard/system76/14in_81/keymap/jeremy.c | 4 +- .../system76/14in_83/include/board/keymap.h | 6 +- .../14in_83/keymap/clevo_l141cu_us_iso.c | 4 +- .../system76/14in_83/keymap/darp10-b.c | 4 +- .../system76/14in_83/keymap/default.c | 4 +- src/keyboard/system76/14in_83/keymap/fabian.c | 4 +- .../system76/14in_83/keymap/ins-prtsc.c | 4 +- src/keyboard/system76/14in_83/keymap/jeremy.c | 4 +- src/keyboard/system76/14in_83/keymap/levi.c | 4 +- .../14in_83/keymap/valentin_french_iso.c | 4 +- .../system76/14in_86/include/board/keymap.h | 4 +- src/keyboard/system76/14in_86/keymap/carl.c | 4 +- .../system76/14in_86/keymap/default.c | 4 +- src/keyboard/system76/14in_86/keymap/jeremy.c | 4 +- .../system76/15in_102/include/board/keymap.h | 4 +- .../system76/15in_102/keymap/default.c | 4 +- .../system76/15in_102/keymap/jeremy.c | 4 +- .../15in_102_nkey/include/board/keymap.h | 4 +- .../system76/15in_102_nkey/keymap/default.c | 4 +- .../system76/15in_102_nkey/keymap/jeremy.c | 4 +- .../system76/18H9LHA04/include/board/keymap.h | 4 +- .../system76/18H9LHA04/keymap/default.c | 4 +- .../system76/18H9LHA04/keymap/jeremy.c | 4 +- .../system76/18H9LHA05/include/board/keymap.h | 4 +- .../system76/18H9LHA05/keymap/darp10.c | 4 +- .../system76/18H9LHA05/keymap/default.c | 4 +- 125 files changed, 392 insertions(+), 484 deletions(-) delete mode 100644 .clang-format create mode 100644 .uncrustify.cfg delete mode 100755 scripts/clang-format.sh delete mode 100755 scripts/lint/02-clang-format.sh create mode 100755 scripts/lint/02-uncrustify.sh diff --git a/.clang-format b/.clang-format deleted file mode 100644 index 18a64c9..0000000 --- a/.clang-format +++ /dev/null @@ -1,141 +0,0 @@ -# https://releases.llvm.org/14.0.0/tools/clang/docs/ClangFormatStyleOptions.html -# LLVM 14 used to support Ubuntu 22.04 LTS. ---- -Language: Cpp -AccessModifierOffset: -4 -AlignAfterOpenBracket: BlockIndent -AlignConsecutiveAssignments: false -AlignConsecutiveBitFields: None -AlignConsecutiveDeclarations: None -AlignConsecutiveMacros: false -AlignEscapedNewlines: DontAlign -AlignOperands: DontAlign -AlignTrailingComments: false -AllowAllArgumentsOnNextLine: false -AllowAllConstructorInitializersOnNextLine: false -AllowAllParametersOfDeclarationOnNextLine: false -AllowShortBlocksOnASingleLine: Empty -AllowShortCaseLabelsOnASingleLine: false -AllowShortEnumsOnASingleLine: false -AllowShortFunctionsOnASingleLine: Empty -AllowShortIfStatementsOnASingleLine: Never -AllowShortLambdasOnASingleLine: Empty -AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: Yes -BinPackArguments: false -BinPackParameters: false -BraceWrapping: - AfterCaseLabel: false - AfterClass: true - AfterControlStatement: Never - AfterEnum: false - AfterFunction: false - AfterNamespace: false - AfterObjCDeclaration: false - AfterStruct: false - AfterUnion: false - AfterExternBlock: false - BeforeCatch: false - BeforeElse: false - BeforeLambdaBody: false - BeforeWhile: false - IndentBraces: false - SplitEmptyFunction: false - SplitEmptyRecord: false - SplitEmptyNamespace: false -BreakAfterJavaFieldAnnotations: true -BreakBeforeBinaryOperators: None -BreakBeforeBraces: Custom -BreakBeforeTernaryOperators: true -BreakConstructorInitializers: AfterColon -BreakConstructorInitializersBeforeComma: false -BreakInheritanceList: AfterColon -BreakStringLiterals: false -ColumnLimit: 100 -CommentPragmas: '^ IWYU pragma:' -CompactNamespaces: false -ConstructorInitializerAllOnOneLineOrOnePerLine: true -ConstructorInitializerIndentWidth: 4 -ContinuationIndentWidth: 4 -Cpp11BracedListStyle: false -DeriveLineEnding: false -DerivePointerAlignment: false -DisableFormat: false -ExperimentalAutoDetectBinPacking: false -FixNamespaceComments: false -ForEachMacros: - - 'foreach' -IncludeBlocks: Regroup -IncludeCategories: - - Regex: '^"(llvm|llvm-c|clang|clang-c)/' - Priority: 2 - SortPriority: 0 - - Regex: '^(<|"(gtest|gmock|isl|json)/)' - Priority: 3 - SortPriority: 0 - - Regex: '.*' - Priority: 1 - SortPriority: 0 -IncludeIsMainRegex: '(_test)?$' -IncludeIsMainSourceRegex: '' -IndentCaseBlocks: true -IndentCaseLabels: false -IndentExternBlock: NoIndent -IndentGotoLabels: false -IndentPPDirectives: None -IndentWidth: 4 -IndentWrappedFunctionNames: false -InsertTrailingCommas: Wrapped -JavaScriptQuotes: Double -JavaScriptWrapImports: true -KeepEmptyLinesAtTheStartOfBlocks: false -MacroBlockBegin: '' -MacroBlockEnd: '' -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -ObjCBinPackProtocolList: Auto -ObjCBlockIndentWidth: 4 -ObjCBreakBeforeNestedBlockParam: true -ObjCSpaceAfterProperty: true -ObjCSpaceBeforeProtocolList: false -PenaltyBreakAssignment: 1000 -PenaltyBreakBeforeFirstCallParameter: 19 -PenaltyBreakComment: 300 -PenaltyBreakFirstLessLess: 120 -PenaltyBreakString: 1000 -PenaltyBreakTemplateDeclaration: 10 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 1000 -PointerAlignment: Right -ReflowComments: false -SortIncludes: false -SortUsingDeclarations: true -SpaceAfterCStyleCast: false -SpaceAfterLogicalNot: false -SpaceAfterTemplateKeyword: false -SpaceBeforeAssignmentOperators: true -SpaceBeforeCpp11BracedList: false -SpaceBeforeCtorInitializerColon: true -SpaceBeforeInheritanceColon: true -SpaceBeforeParens: ControlStatementsExceptForEachMacros -SpaceBeforeRangeBasedForLoopColon: true -SpaceBeforeSquareBrackets: false -SpaceInEmptyBlock: false -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 1 -SpacesInAngles: false -SpacesInCStyleCastParentheses: false -SpacesInConditionalStatement: false -SpacesInContainerLiterals: false -SpacesInParentheses: false -SpacesInSquareBrackets: false -Standard: Latest -StatementMacros: -TabWidth: 4 -UseCRLF: false -UseTab: Never -WhitespaceSensitiveMacros: - - 'STRINGIZE' -... diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d7e73c..164c9ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: run: ./scripts/lint/01-spdx-tags.sh - name: Check formatting - run: ./scripts/lint/02-clang-format.sh + run: ./scripts/lint/02-uncrustify.sh - name: Check shell scripts run: ./scripts/lint/03-shellcheck.sh diff --git a/.uncrustify.cfg b/.uncrustify.cfg new file mode 100644 index 0000000..1f9e52f --- /dev/null +++ b/.uncrustify.cfg @@ -0,0 +1,156 @@ +# SPDX-License-Identifier: CC0-1.0 +# SPDX-FileCopyrightText: NONE + +# Uncrustify-0.78.1_f +# https://github.com/uncrustify/uncrustify/blob/uncrustify-0.78.1/documentation/htdocs/config.txt + +newlines = lf +input_tab_size = 4 +output_tab_size = 4 +disable_processing_cmt = "uncrustify:off" +enable_processing_cmt = "uncrustify:on" +utf8_bom = remove +sp_arith_additive = force +sp_assign = force +sp_enum_brace = force +sp_enum_after_assign = force +sp_pp_concat = ignore +sp_bool = force +sp_compare = force +sp_inside_paren = remove +sp_paren_paren = remove +sp_cparen_oparen = remove +sp_paren_brace = force +sp_before_ptr_star = force +sp_between_ptr_star = remove +sp_between_ptr_ref = remove +sp_after_ptr_star = remove +sp_after_type = ignore # XXX: Fixes using macros in assignments +sp_before_sparen = force +sp_inside_sparen = remove +sp_inside_for = remove +sp_sparen_paren = remove +sp_sparen_brace = force +sp_do_brace_open = force +sp_brace_close_while = force +sp_before_semi_for = remove +sp_before_semi_for_empty = remove +sp_between_semi_for_empty = remove +sp_after_semi_for_empty = remove +sp_before_square = remove +sp_before_squares = remove +sp_inside_square = remove +sp_after_comma = add +sp_after_cast = remove +sp_inside_paren_cast = remove +sp_sizeof_paren = remove +sp_inside_braces = add +sp_inside_braces_empty = remove +sp_func_proto_paren = remove +sp_func_def_paren = remove +sp_inside_fparens = remove +sp_inside_fparen = remove +sp_inside_tparen = remove +sp_after_tparen_close = remove +sp_fparen_brace = force +sp_func_call_paren = remove +sp_return_paren = force +sp_attribute_paren = remove +sp_defined_paren = remove +sp_else_brace = force +sp_brace_else = force +sp_brace_typedef = force +sp_before_nl_cont = force +sp_cond_colon = force +sp_cond_question = force +sp_endif_cmt = force +sp_before_tr_cmt = add +sp_num_before_tr_cmt = 1 +indent_columns = 4 +indent_with_tabs = 0 +indent_macro_brace = false +indent_ignore_label = true +indent_paren_close = 2 +indent_align_assign = false +indent_align_paren = false +indent_compound_literal_return = false +nl_collapse_empty_body = true +nl_collapse_empty_body_functions = true +nl_start_of_file = remove +nl_end_of_file = force +nl_end_of_file_min = 1 +nl_assign_brace = remove +nl_fcall_brace = remove +nl_enum_brace = remove +nl_struct_brace = remove +nl_union_brace = remove +nl_if_brace = remove +nl_brace_else = remove +nl_else_brace = remove +nl_else_if = remove +nl_for_brace = remove +nl_while_brace = remove +nl_do_brace = remove +nl_brace_while = remove +nl_switch_brace = remove +nl_after_case = true +nl_enum_own_lines = force +nl_func_type_name = remove +nl_func_proto_type_name = remove +nl_func_paren = remove +nl_func_def_paren = remove +nl_func_call_paren = remove +nl_fdef_brace = remove +nl_return_expr = remove +nl_after_semicolon = true +nl_brace_struct_var = remove +nl_ds_struct_enum_close_brace = true +nl_split_if_one_liner = true +nl_split_for_one_liner = true +nl_split_while_one_liner = true +nl_max = 2 +eat_blanks_after_open_brace = true +eat_blanks_before_close_brace = true +code_width = 100 +ls_for_split_full = true +ls_func_split_full = true +align_on_tabstop = true +align_var_def_star_style = 1 +align_var_def_amp_style = 1 +align_typedef_star_style = 1 +align_typedef_amp_style = 1 +align_func_proto_star_style = 1 +align_func_proto_amp_style = 1 +align_pp_define_together = true +cmt_width = 100 +cmt_convert_tab_to_spaces = true +cmt_trailing_single_line_c_to_cpp = true +mod_paren_on_return = remove +mod_remove_extra_semicolon = true +mod_remove_duplicate_include = true +mod_sort_incl_import_prioritize_filename = true +mod_move_case_break = true +mod_move_case_return = true +mod_remove_empty_return = true +mod_enum_last_comma = add +pp_multiline_define_body_indent = 4 +pp_indent_case = false +pp_indent_func_def = false +pp_indent_extern = false + +#set QUALIFIER __at # XXX: Allow it to be treated as a function call +set QUALIFIER __code +set QUALIFIER __critical +set QUALIFIER __data +set QUALIFIER __idata +set QUALIFIER __pdata +set QUALIFIER __reentrant +set QUALIFIER __xdata + +set TYPE __bit +set TYPE __sbit +set TYPE __sfr +set TYPE __sfr16 +set TYPE __sfr32 + +set FUNC_CALL __asm__ diff --git a/Makefile b/Makefile index 15b999d..d414d4a 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ clean: .PHONY: fmt fmt: - ./scripts/clang-format.sh apply + uncrustify -c .uncrustify.cfg -q --no-backup $(shell git ls-files '*.c' '*.h') .PHONY: lint lint: diff --git a/scripts/clang-format.sh b/scripts/clang-format.sh deleted file mode 100755 index 1289406..0000000 --- a/scripts/clang-format.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: GPL-3.0-only - -readarray -t FILES < <(git ls-files '*.c' '*.h') - -FMT_OPTS=( - "-style=file" - "--fallback-style=none" - "--Werror" -) - -if [[ "$1" = "apply" ]]; then - clang-format "${FMT_OPTS[@]}" -i "${FILES[@]}" -else - clang-format "${FMT_OPTS[@]}" --dry-run "${FILES[@]}" -fi diff --git a/scripts/deps.sh b/scripts/deps.sh index 4a7abe4..e87e088 100755 --- a/scripts/deps.sh +++ b/scripts/deps.sh @@ -19,7 +19,6 @@ if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then --yes \ avr-libc \ avrdude \ - clang-format \ curl \ gcc \ gcc-avr \ @@ -30,6 +29,7 @@ if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then pkgconf \ sdcc \ shellcheck \ + uncrustify \ xxd elif [[ "${ID}" =~ "fedora" ]] || [[ "${ID_LIKE}" =~ "fedora" ]]; then sudo dnf install \ @@ -37,13 +37,13 @@ elif [[ "${ID}" =~ "fedora" ]] || [[ "${ID_LIKE}" =~ "fedora" ]]; then avr-gcc \ avr-libc \ avrdude \ - clang-tools-extra \ curl \ gcc \ make \ sdcc \ ShellCheck \ systemd-devel \ + uncrustify \ vim-common elif [[ "${ID}" =~ "arch" ]] || [[ "${ID_LIKE}" =~ "arch" ]]; then sudo pacman -S \ @@ -51,7 +51,6 @@ elif [[ "${ID}" =~ "arch" ]] || [[ "${ID_LIKE}" =~ "arch" ]]; then avr-gcc \ avr-libc \ avrdude \ - clang \ curl \ gcc \ make \ @@ -59,6 +58,7 @@ elif [[ "${ID}" =~ "arch" ]] || [[ "${ID_LIKE}" =~ "arch" ]]; then sdcc \ shellcheck \ systemd-libs \ + uncrustify \ vim else msg "Please add support for your distribution to:" diff --git a/scripts/lint/02-clang-format.sh b/scripts/lint/02-clang-format.sh deleted file mode 100755 index 56902af..0000000 --- a/scripts/lint/02-clang-format.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# SPDX-License-Identifier: GPL-3.0-only - -# Check if any C files or headers need to be formatted. - -LINT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) -. "$LINT_DIR/util.sh" - -echo -n "Checking C style..." - -if ! command -v clang-format > /dev/null; then - skipped "clang-format not found" - exit 0 -fi - -readarray -t FILES < <(git ls-files '*.c' '*.h') - -FMT_OPTS=( - "-style=file" - "--fallback-style=none" - "--dry-run" - "--Werror" -) - -# NOTE: It is too slow to run clang-format on every file individually to report -# which ones fail. Leave it up to the user to apply formatting via `make fmt`. - -_output=$(clang-format "${FMT_OPTS[@]}" "${FILES[@]}" 2>&1) -if [[ $_output != "" ]]; then - failed - exit 1 -fi - -passed diff --git a/scripts/lint/02-uncrustify.sh b/scripts/lint/02-uncrustify.sh new file mode 100755 index 0000000..9829c84 --- /dev/null +++ b/scripts/lint/02-uncrustify.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: GPL-3.0-only + +# Check if any C files or headers need to be formatted. + +# shellcheck disable=SC1091 + +LINT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) +. "$LINT_DIR/util.sh" + +echo -n "Checking C style..." + +if ! command -v uncrustify > /dev/null; then + skipped "uncrustify not found" + exit 0 +fi + +needs_formatting=() + +for file in $(git ls-files '*.c' '*.h'); do + if ! uncrustify -c .uncrustify.cfg -q --check "$file" >/dev/null 2>&1; then + needs_formatting+=("$file") + fi +done + +if [[ "${#needs_formatting[@]}" != "0" ]]; then + failed + + for file in "${needs_formatting[@]}"; do + echo "- $file" + done + + exit 1 +fi + +passed diff --git a/src/arch/8051/time.c b/src/arch/8051/time.c index 31ebeeb..29ef275 100644 --- a/src/arch/8051/time.c +++ b/src/arch/8051/time.c @@ -8,7 +8,7 @@ #define OSC_DIVISOR 12 #define TICK_INTERVAL_MS 1 // Value to reload into the timer when the overflow interrupt is triggered. -#define TIMER_RELOAD (0xFFFF - ((TICK_INTERVAL_MS) * ((CONFIG_CLOCK_FREQ_KHZ) / OSC_DIVISOR))) +#define TIMER_RELOAD (0xFFFF - (TICK_INTERVAL_MS * (CONFIG_CLOCK_FREQ_KHZ / OSC_DIVISOR))) static volatile uint32_t time_overflows = 0; diff --git a/src/arch/avr/i2c_slave.c b/src/arch/avr/i2c_slave.c index 548558b..df9031f 100644 --- a/src/arch/avr/i2c_slave.c +++ b/src/arch/avr/i2c_slave.c @@ -11,9 +11,11 @@ #include #include +// uncrustify:off static void (*volatile i2c_slave_new_cb)() = NULL; static void (*volatile i2c_slave_recv_cb)(uint8_t) = NULL; static uint8_t (*volatile i2c_slave_send_cb)() = NULL; +// uncrustify:on void i2c_slave_init( uint8_t address, diff --git a/src/arch/avr/include/arch/gpio.h b/src/arch/avr/include/arch/gpio.h index ca5f77a..225c12d 100644 --- a/src/arch/avr/include/arch/gpio.h +++ b/src/arch/avr/include/arch/gpio.h @@ -16,14 +16,12 @@ struct Gpio { uint8_t value; }; -// clang-format off #define GPIO(BLOCK, NUMBER) { \ .pin = &PIN ## BLOCK, \ .ddr = &DDR ## BLOCK, \ .port = &PORT ## BLOCK, \ .value = BIT(NUMBER), \ } -// clang-format on bool gpio_get(const struct Gpio *const gpio); void gpio_set(struct Gpio *const gpio, bool value); diff --git a/src/arch/avr/uart.c b/src/arch/avr/uart.c index 4aaf833..a2f8914 100644 --- a/src/arch/avr/uart.c +++ b/src/arch/avr/uart.c @@ -6,7 +6,6 @@ #include #include -// clang-format off #define UART(N) \ { \ &UCSR ## N ## A, \ @@ -40,7 +39,6 @@ #else #error "Could not find UART definitions" #endif -// clang-format on int16_t uart_count(void) { return sizeof(UARTS) / sizeof(struct Uart); diff --git a/src/board/arduino/mega2560/parallel.c b/src/board/arduino/mega2560/parallel.c index 215ae31..1396550 100644 --- a/src/board/arduino/mega2560/parallel.c +++ b/src/board/arduino/mega2560/parallel.c @@ -11,7 +11,6 @@ #include #include -// clang-format off // Mapping of 24-pin ribbon cable to parallel pins. See schematic #define PINS \ /* Data (KSO0 - KSO7) - bi-directional */ \ @@ -114,8 +113,6 @@ static struct Parallel PORT = { .state = PARALLEL_STATE_UNKNOWN, }; -// clang-format on - // Set port to all high-impedance inputs void parallel_hiz(struct Parallel *const port) { #define PIN(N, P) \ @@ -137,8 +134,10 @@ void parallel_data_dir(struct Parallel *const port, bool dir) { void parallel_data_set_high(struct Parallel *const port, uint8_t byte) { // By convention all lines are high, so only set the ones needed #define DATA_BIT(B) \ - if (!(byte & (1 << B))) \ - gpio_set(port->d##B, true); + if (!(byte & (1 << B))) { \ + gpio_set(port->d##B, true); \ + } + DATA_BITS #undef DATA_BIT } @@ -205,8 +204,10 @@ void parallel_state(struct Parallel *const port, enum ParallelState state) { uint8_t parallel_read_data(struct Parallel *const port) { uint8_t byte = 0; #define DATA_BIT(B) \ - if (gpio_get(port->d##B)) \ - byte |= (1 << B); + if (gpio_get(port->d##B)) { \ + byte |= (1 << B); \ + } + DATA_BITS #undef DATA_BIT return byte; @@ -216,8 +217,10 @@ void parallel_write_data(struct Parallel *const port, uint8_t byte) { // By convention all lines are high, so only set the ones needed #define DATA_BIT(B) \ - if (!(byte & (1 << B))) \ - gpio_set(port->d##B, false); + if (!(byte & (1 << B))) { \ + gpio_set(port->d##B, false); \ + } + DATA_BITS #undef DATA_BIT } diff --git a/src/board/arduino/uno/parallel.c b/src/board/arduino/uno/parallel.c index e853f31..d73141a 100644 --- a/src/board/arduino/uno/parallel.c +++ b/src/board/arduino/uno/parallel.c @@ -11,8 +11,6 @@ #include #include -// clang-format off - // Mapping of 24-pin ribbon cable to parallel pins. See schematic #define PINS \ /* Data (KSO0 - KSO7) - bi-directional */ \ @@ -67,8 +65,6 @@ static struct Gpio GPIOS[13] = { GPIO(C, 0), }; -// clang-format on - // Parallel struct definition // See http://efplus.com/techref/io/parallel/1284/eppmode.htm struct Parallel { @@ -89,6 +85,7 @@ void parallel_hiz(struct Parallel *const port) { #define PIN(N, P) \ gpio_set_dir(port->N, false); \ gpio_set(port->N, false); + PINS #undef PIN } @@ -105,8 +102,10 @@ void parallel_data_dir(struct Parallel *const port, bool dir) { void parallel_data_set_high(struct Parallel *const port, uint8_t byte) { // By convention all lines are high, so only set the ones needed #define DATA_BIT(B) \ - if (!(byte & (1 << B))) \ - gpio_set(port->d##B, true); + if (!(byte & (1 << B))) { \ + gpio_set(port->d##B, true); \ + } + DATA_BITS #undef DATA_BIT } @@ -154,8 +153,10 @@ void parallel_reset(struct Parallel *const port, bool host) { uint8_t parallel_read_data(struct Parallel *const port) { uint8_t byte = 0; #define DATA_BIT(B) \ - if (gpio_get(port->d##B)) \ - byte |= (1 << B); + if (gpio_get(port->d##B)) { \ + byte |= (1 << B); \ + } + DATA_BITS #undef DATA_BIT return byte; @@ -164,8 +165,10 @@ uint8_t parallel_read_data(struct Parallel *const port) { void parallel_write_data(struct Parallel *const port, uint8_t byte) { // By convention all lines are high, so only set the ones needed #define DATA_BIT(B) \ - if (!(byte & (1 << B))) \ - gpio_set(port->d##B, false); + if (!(byte & (1 << B))) { \ + gpio_set(port->d##B, false); \ + } + DATA_BITS #undef DATA_BIT } diff --git a/src/board/system76/addw1/gpio.c b/src/board/system76/addw1/gpio.c index e204aa7..5cc27e8 100644 --- a/src/board/system76/addw1/gpio.c +++ b/src/board/system76/addw1/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 6); struct Gpio __code AC_PRESENT = GPIO(E, 7); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -42,7 +42,7 @@ struct Gpio __code USB_PWR_EN_N = GPIO(F, 7); struct Gpio __code VA_EC_EN = GPIO(J, 0); // renamed to SLP_SUS_EC# struct Gpio __code WLAN_EN = GPIO(J, 2); struct Gpio __code WLAN_PWR_EN = GPIO(B, 0); -// clang-format on +// uncrustify:on void gpio_init(void) { // Enable LPC reset on GPD2 diff --git a/src/board/system76/addw1/include/board/gpio.h b/src/board/system76/addw1/include/board/gpio.h index c8b16dd..cc927ae 100644 --- a/src/board/system76/addw1/include/board/gpio.h +++ b/src/board/system76/addw1/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -53,6 +52,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; #define HAVE_XLP_OUT 0 -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/addw2/gpio.c b/src/board/system76/addw2/gpio.c index a6dc2bc..ec37446 100644 --- a/src/board/system76/addw2/gpio.c +++ b/src/board/system76/addw2/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -40,7 +40,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(J, 7); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/addw2/include/board/gpio.h b/src/board/system76/addw2/include/board/gpio.h index 067fd5c..8f47d07 100644 --- a/src/board/system76/addw2/include/board/gpio.h +++ b/src/board/system76/addw2/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -50,6 +49,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/addw3/gpio.c b/src/board/system76/addw3/gpio.c index 27a0968..be4039b 100644 --- a/src/board/system76/addw3/gpio.c +++ b/src/board/system76/addw3/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -32,7 +32,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(D, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/addw4/gpio.c b/src/board/system76/addw4/gpio.c index 1029bad..7239b5f 100644 --- a/src/board/system76/addw4/gpio.c +++ b/src/board/system76/addw4/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -32,7 +32,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); //struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(H, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/bonw14/gpio.c b/src/board/system76/bonw14/gpio.c index 03c61d1..81a704c 100644 --- a/src/board/system76/bonw14/gpio.c +++ b/src/board/system76/bonw14/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code AC_V1_EC = GPIO(J, 7); @@ -39,7 +39,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); // renamed to SLP_SUS# struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); // renamed to EN_3V -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/bonw14/include/board/gpio.h b/src/board/system76/bonw14/include/board/gpio.h index be21ee3..fd96a71 100644 --- a/src/board/system76/bonw14/include/board/gpio.h +++ b/src/board/system76/bonw14/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code AC_V1_EC; @@ -48,6 +47,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/bonw15/gpio.c b/src/board/system76/bonw15/gpio.c index b8b4c71..a044504 100644 --- a/src/board/system76/bonw15/gpio.c +++ b/src/board/system76/bonw15/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -34,7 +34,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(B, 5); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/bonw15/include/board/gpio.h b/src/board/system76/bonw15/include/board/gpio.h index f3031c3..7d18438 100644 --- a/src/board/system76/bonw15/include/board/gpio.h +++ b/src/board/system76/bonw15/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -43,6 +42,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/common/acpi.c b/src/board/system76/common/acpi.c index 7486d75..8cf7f50 100644 --- a/src/board/system76/common/acpi.c +++ b/src/board/system76/common/acpi.c @@ -43,22 +43,22 @@ void fcommand(void) { break; // Set color case 3: - // clang-format off kbled_set_color( ((uint32_t)fbuf[0]) | ((uint32_t)fbuf[1] << 16) | ((uint32_t)fbuf[2] << 8) ); - // clang-format on break; // Get color case 4: + // uncrustify:off { uint32_t color = kbled_get_color(); fbuf[0] = color & 0xFF; fbuf[1] = (color >> 16) & 0xFF; fbuf[2] = (color >> 8) & 0xFF; } + // uncrustify:on break; // DUPLICATE: Set brightness case 6: @@ -83,7 +83,7 @@ void acpi_reset(void) { #endif } -// clang-format off +// uncrustify:off uint8_t acpi_read(uint8_t addr) { uint8_t data = 0; @@ -181,20 +181,20 @@ uint8_t acpi_read(uint8_t addr) { #endif // HAVE_LED_AIRPLANE_N // Set size of flash (from old firmware) - ACPI_8 (0xE5, 0x80); + ACPI_8(0xE5, 0x80); - ACPI_8 (0xF8, fcmd); - ACPI_8 (0xF9, fdat); - ACPI_8 (0xFA, fbuf[0]); - ACPI_8 (0xFB, fbuf[1]); - ACPI_8 (0xFC, fbuf[2]); - ACPI_8 (0xFD, fbuf[3]); + ACPI_8(0xF8, fcmd); + ACPI_8(0xF9, fdat); + ACPI_8(0xFA, fbuf[0]); + ACPI_8(0xFB, fbuf[1]); + ACPI_8(0xFC, fbuf[2]); + ACPI_8(0xFD, fbuf[3]); } TRACE("acpi_read %02X = %02X\n", addr, data); return data; } -// clang-format on +// uncrustify:on void acpi_write(uint8_t addr, uint8_t data) { TRACE("acpi_write %02X = %02X\n", addr, data); diff --git a/src/board/system76/common/charger/bq24780s.c b/src/board/system76/common/charger/bq24780s.c index eb3d102..aa6c3ae 100644 --- a/src/board/system76/common/charger/bq24780s.c +++ b/src/board/system76/common/charger/bq24780s.c @@ -8,7 +8,7 @@ #include #include -// clang-format off +// uncrustify:off // Registers #define REG_CHARGE_CURRENT 0x14 @@ -86,7 +86,7 @@ #error Invalid adapter:battery RSENSE ratio #endif -// clang-format on +// uncrustify:on // XXX: Assumption: ac_last is initialized high. static bool charger_enabled = false; diff --git a/src/board/system76/common/charger/oz26786.c b/src/board/system76/common/charger/oz26786.c index b7e1136..9f4ea79 100644 --- a/src/board/system76/common/charger/oz26786.c +++ b/src/board/system76/common/charger/oz26786.c @@ -8,7 +8,7 @@ #include #include -// clang-format off +// uncrustify:off // Registers #define REG_CHARGE_CURRENT 0x14 @@ -71,7 +71,8 @@ #else #error Invalid CHARGER_PSYS_GAIN value #endif -// clang-format on + +// uncrustify:on // Sense resistor values in milliohms. enum sense_resistor { diff --git a/src/board/system76/common/espi.c b/src/board/system76/common/espi.c index 400fe7d..010d4a6 100644 --- a/src/board/system76/common/espi.c +++ b/src/board/system76/common/espi.c @@ -16,7 +16,7 @@ #define DEBUG_SET(REG, MASK, BITS) \ { \ DEBUG("%s: %X", #REG, REG); \ - REG = ((REG) & ~(MASK)) | (BITS); \ + REG = (REG & ~(MASK)) | (BITS); \ DEBUG(" set to %X\n", REG); \ } diff --git a/src/board/system76/common/fan.c b/src/board/system76/common/fan.c index 6700165..1c17535 100644 --- a/src/board/system76/common/fan.c +++ b/src/board/system76/common/fan.c @@ -44,12 +44,10 @@ uint8_t fan_duty(const struct Fan *const fan, int16_t temp) __reentrant { if (temp > prev->temp) { int16_t dtemp = (cur->temp - prev->temp); int16_t dduty = ((int16_t)cur->duty) - ((int16_t)prev->duty); - // clang-format off return (uint8_t)( ((int16_t)prev->duty) + ((temp - prev->temp) * dduty) / dtemp ); - // clang-format on } } else { return prev->duty; @@ -127,11 +125,9 @@ uint8_t fan_smooth(uint8_t last_duty, uint8_t duty) __reentrant { // ramping down if (duty < last_duty) { // out of bounds (lower) safeguard - // clang-format off uint8_t smoothed = last_duty < MIN_FAN_SPEED + MAX_JUMP_DOWN ? MIN_FAN_SPEED : last_duty - MAX_JUMP_DOWN; - // clang-format on // use smoothed value if above min and if smoothed is closer than raw if (last_duty > MIN_SPEED_TO_SMOOTH && smoothed > duty) { @@ -142,11 +138,9 @@ uint8_t fan_smooth(uint8_t last_duty, uint8_t duty) __reentrant { // ramping up if (duty > last_duty) { // out of bounds (higher) safeguard - // clang-format off uint8_t smoothed = last_duty > MAX_FAN_SPEED - MAX_JUMP_UP ? MAX_FAN_SPEED : last_duty + MAX_JUMP_UP; - // clang-format on // use smoothed value if above min and if smoothed is closer than raw if (duty > MIN_SPEED_TO_SMOOTH && smoothed < duty) { diff --git a/src/board/system76/common/flash/main.c b/src/board/system76/common/flash/main.c index ade8b98..562f206 100644 --- a/src/board/system76/common/flash/main.c +++ b/src/board/system76/common/flash/main.c @@ -15,7 +15,6 @@ volatile uint8_t __xdata __at(0x103D) ECINDAR2; volatile uint8_t __xdata __at(0x103E) ECINDAR3; volatile uint8_t __xdata __at(0x103F) ECINDDR; -// clang-format off #define SPI_DEVICE (0x70) #define SPI_FOLLOW_MODE (0x0F) #define SPI_CHIP_SELECT (0xFD) @@ -30,7 +29,6 @@ volatile uint8_t __xdata __at(0x103F) ECINDDR; #define SPI_ERASE_SECTOR_COMMAND (0xD7) #define SPI_STATUS_WIP (0x01) -// clang-format on void flash_enter_follow_mode(void); void flash_exit_follow_mode(void); @@ -48,9 +46,7 @@ void flash_write_enable(void); * NOTE: __critical to ensure interrupts are disabled. This does mean that interrupt * such as the timer will be block until flash acccess is complete */ -// clang-format off void flash_entry(uint32_t addr, uint8_t *data, uint32_t length, uint8_t command) __reentrant __critical { - // clang-format on // Only allow access from 64KB to 128KB. if ((addr < 0x10000) || (length > 0x10000) || ((addr + length) > 0x20000)) return; @@ -73,7 +69,8 @@ void flash_entry(uint32_t addr, uint8_t *data, uint32_t length, uint8_t command) flash_enter_follow_mode(); while (length) { - // Note, this is the slow way to do it, but it's simple and all bytes are written properly. + // Note, this is the slow way to do it, but it's simple and all + // bytes are written properly. flash_write_enable(); // Select the device diff --git a/src/board/system76/common/include/board/flash.h b/src/board/system76/common/include/board/flash.h index 8d0fab7..e2cb84f 100644 --- a/src/board/system76/common/include/board/flash.h +++ b/src/board/system76/common/include/board/flash.h @@ -12,11 +12,9 @@ /** \cond INTERNAL * Internal defines */ -// clang-format off #define FLASH_COMMAND_READ (0x0) #define FLASH_COMMAND_WRITE (0x1) #define FLASH_COMMAND_ERASE_1K (0x2) -// clang-format on /** \endcond */ /** diff --git a/src/board/system76/common/kbc.c b/src/board/system76/common/kbc.c index eb156b6..c68e9d8 100644 --- a/src/board/system76/common/kbc.c +++ b/src/board/system76/common/kbc.c @@ -41,7 +41,6 @@ static bool kbc_translate = true; // LED state uint8_t kbc_leds = 0; -// clang-format off // Values from linux/drivers/input/keyboard/atkbd.c static const uint16_t kbc_typematic_period[32] = { 33, // 30.0 cps = ~33.33ms @@ -77,7 +76,6 @@ static const uint16_t kbc_typematic_period[32] = { 470, // 2.1 cps = ~478.19ms 500, // 2.0 cps = 500ms }; -// clang-format on static uint8_t kbc_buffer[16] = { 0 }; static uint8_t kbc_buffer_head = 0; diff --git a/src/board/system76/common/kbled/common.c b/src/board/system76/common/kbled/common.c index 4281386..2cff8ab 100644 --- a/src/board/system76/common/kbled/common.c +++ b/src/board/system76/common/kbled/common.c @@ -5,7 +5,6 @@ enum KbledKind kbled_kind = KBLED_NONE; -// clang-format off static uint8_t LEVEL_I = 1; #ifdef KBLED_DAC // XXX: DAC uses separate levels due to brightness being different. @@ -38,7 +37,6 @@ static const uint32_t __code COLORS[] = { 0x00FFFF, 0xFFFF00 }; -// clang-format on void kbled_hotkey_color(void) { if (COLOR_I < (ARRAY_SIZE(COLORS) - 1)) { diff --git a/src/board/system76/common/kbscan.c b/src/board/system76/common/kbscan.c index b3e33b2..938a4fa 100644 --- a/src/board/system76/common/kbscan.c +++ b/src/board/system76/common/kbscan.c @@ -330,10 +330,8 @@ void kbscan_event(void) { // A key was pressed or released for (uint8_t j = 0; j < KM_IN; j++) { - // clang-format off bool new_b = new & BIT(j); bool last_b = last & BIT(j); - // clang-format on if (new_b != last_b) { bool reset = false; diff --git a/src/board/system76/common/parallel.c b/src/board/system76/common/parallel.c index 6476c4f..4524657 100644 --- a/src/board/system76/common/parallel.c +++ b/src/board/system76/common/parallel.c @@ -19,14 +19,12 @@ * nWAIT = KSOH[1] */ -// clang-format off #define CTL_WRITE BIT(0) #define CTL_DATA BIT(1) #define CTL_RESET BIT(2) #define CTL_ADDR BIT(3) #define STS_WAIT BIT(1) -// clang-format on // Maximum peripheral response time in ms #define PARALLEL_TIMEOUT 10 diff --git a/src/board/system76/common/peci.c b/src/board/system76/common/peci.c index 71a13b6..a73ab18 100644 --- a/src/board/system76/common/peci.c +++ b/src/board/system76/common/peci.c @@ -36,9 +36,7 @@ int16_t peci_temp = 0; // Maximum OOB channel response time in ms #define PECI_ESPI_TIMEOUT 10 -// clang-format off #define FAN_POINT(T, D) { .temp = PECI_TEMP(T), .duty = PWM_DUTY(D) } -// clang-format on // Fan curve with temperature in degrees C, duty cycle in percent static struct FanPoint __code FAN_POINTS[] = { diff --git a/src/board/system76/common/power.c b/src/board/system76/common/power.c index d2f8387..296f231 100644 --- a/src/board/system76/common/power.c +++ b/src/board/system76/common/power.c @@ -491,7 +491,6 @@ void power_event(void) { } pg_last = pg_new; - // clang-format off static bool rst_last = false; bool rst_new = gpio_get(&BUF_PLT_RST_N); #if LEVEL >= LEVEL_DEBUG @@ -508,7 +507,6 @@ void power_event(void) { #endif // CONFIG_BUS_ESPI } rst_last = rst_new; - // clang-format on #if HAVE_SLP_SUS_N #if LEVEL >= LEVEL_DEBUG diff --git a/src/board/system76/darp10-b/gpio.c b/src/board/system76/darp10-b/gpio.c index 9950e7a..d847c17 100644 --- a/src/board/system76/darp10-b/gpio.c +++ b/src/board/system76/darp10-b/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(F, 7); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -31,7 +31,7 @@ struct Gpio __code SUSC_N_PCH = GPIO(H, 1); struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_PWR_EN = GPIO(E, 1); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/darp10/gpio.c b/src/board/system76/darp10/gpio.c index 9950e7a..d847c17 100644 --- a/src/board/system76/darp10/gpio.c +++ b/src/board/system76/darp10/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(F, 7); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -31,7 +31,7 @@ struct Gpio __code SUSC_N_PCH = GPIO(H, 1); struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_PWR_EN = GPIO(E, 1); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/darp5/gpio.c b/src/board/system76/darp5/gpio.c index f106049..2972a23 100644 --- a/src/board/system76/darp5/gpio.c +++ b/src/board/system76/darp5/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 6); struct Gpio __code AC_PRESENT = GPIO(E, 7); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -43,7 +43,7 @@ struct Gpio __code VA_EC_EN = GPIO(E, 3); struct Gpio __code VR_ON = GPIO(H, 4); struct Gpio __code WLAN_EN = GPIO(H, 5); struct Gpio __code WLAN_PWR_EN = GPIO(J, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // Enable LPC reset on GPD2 diff --git a/src/board/system76/darp5/include/board/gpio.h b/src/board/system76/darp5/include/board/gpio.h index 3de1094..0f05e07 100644 --- a/src/board/system76/darp5/include/board/gpio.h +++ b/src/board/system76/darp5/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -48,6 +47,5 @@ extern struct Gpio __code VR_ON; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; #define HAVE_XLP_OUT 0 -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/darp7/gpio.c b/src/board/system76/darp7/gpio.c index 2c46511..788b034 100644 --- a/src/board/system76/darp7/gpio.c +++ b/src/board/system76/darp7/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -40,7 +40,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/darp7/include/board/gpio.h b/src/board/system76/darp7/include/board/gpio.h index 3a6a31b..ed1927f 100644 --- a/src/board/system76/darp7/include/board/gpio.h +++ b/src/board/system76/darp7/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -50,6 +49,5 @@ extern struct Gpio __code VR_ON; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/darp8/gpio.c b/src/board/system76/darp8/gpio.c index d6889dd..524174e 100644 --- a/src/board/system76/darp8/gpio.c +++ b/src/board/system76/darp8/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -37,7 +37,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(F, 3); struct Gpio __code WLAN_PWR_EN = GPIO(G, 1); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/darp8/include/board/gpio.h b/src/board/system76/darp8/include/board/gpio.h index e05a241..4dab0ec 100644 --- a/src/board/system76/darp8/include/board/gpio.h +++ b/src/board/system76/darp8/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -46,6 +45,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/darp9/gpio.c b/src/board/system76/darp9/gpio.c index 6f52bfd..162c748 100644 --- a/src/board/system76/darp9/gpio.c +++ b/src/board/system76/darp9/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -37,7 +37,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(F, 3); struct Gpio __code WLAN_PWR_EN = GPIO(G, 1); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/darp9/include/board/gpio.h b/src/board/system76/darp9/include/board/gpio.h index f9879d8..462001c 100644 --- a/src/board/system76/darp9/include/board/gpio.h +++ b/src/board/system76/darp9/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -47,6 +46,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/galp3-c/gpio.c b/src/board/system76/galp3-c/gpio.c index 7bfafff..6824adb 100644 --- a/src/board/system76/galp3-c/gpio.c +++ b/src/board/system76/galp3-c/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 6); struct Gpio __code AC_PRESENT = GPIO(E, 7); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -42,7 +42,7 @@ struct Gpio __code VA_EC_EN = GPIO(E, 3); struct Gpio __code VR_ON = GPIO(H, 4); struct Gpio __code WLAN_EN = GPIO(H, 5); struct Gpio __code WLAN_PWR_EN = GPIO(J, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // Enable LPC reset on GPD2 diff --git a/src/board/system76/galp3-c/include/board/gpio.h b/src/board/system76/galp3-c/include/board/gpio.h index a32e2dd..f9aea45 100644 --- a/src/board/system76/galp3-c/include/board/gpio.h +++ b/src/board/system76/galp3-c/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -47,6 +46,5 @@ extern struct Gpio __code VR_ON; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; #define HAVE_XLP_OUT 0 -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/galp5/gpio.c b/src/board/system76/galp5/gpio.c index 880d562..878a372 100644 --- a/src/board/system76/galp5/gpio.c +++ b/src/board/system76/galp5/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -41,7 +41,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/galp5/include/board/gpio.h b/src/board/system76/galp5/include/board/gpio.h index 4a2b684..1b9b4fc 100644 --- a/src/board/system76/galp5/include/board/gpio.h +++ b/src/board/system76/galp5/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -50,6 +49,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/galp6/gpio.c b/src/board/system76/galp6/gpio.c index 3cc5d62..6e88e30 100644 --- a/src/board/system76/galp6/gpio.c +++ b/src/board/system76/galp6/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -39,7 +39,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/galp6/include/board/gpio.h b/src/board/system76/galp6/include/board/gpio.h index 7e371d5..1d13ace 100644 --- a/src/board/system76/galp6/include/board/gpio.h +++ b/src/board/system76/galp6/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -49,6 +48,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/gaze15/gpio.c b/src/board/system76/gaze15/gpio.c index 4f456a5..ef097fc 100644 --- a/src/board/system76/gaze15/gpio.c +++ b/src/board/system76/gaze15/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -38,7 +38,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); // renamed to SLP_SUS# struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/gaze15/include/board/gpio.h b/src/board/system76/gaze15/include/board/gpio.h index b8c9901..8348877 100644 --- a/src/board/system76/gaze15/include/board/gpio.h +++ b/src/board/system76/gaze15/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -46,6 +45,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/gaze16-3050/gpio.c b/src/board/system76/gaze16-3050/gpio.c index e454155..424a396 100644 --- a/src/board/system76/gaze16-3050/gpio.c +++ b/src/board/system76/gaze16-3050/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -36,7 +36,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/gaze16-3060/gpio.c b/src/board/system76/gaze16-3060/gpio.c index 0991c71..0523bda 100644 --- a/src/board/system76/gaze16-3060/gpio.c +++ b/src/board/system76/gaze16-3060/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -37,7 +37,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/gaze17-3050/gpio.c b/src/board/system76/gaze17-3050/gpio.c index bd737c7..ab4d016 100644 --- a/src/board/system76/gaze17-3050/gpio.c +++ b/src/board/system76/gaze17-3050/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -36,7 +36,7 @@ struct Gpio __code VA_EC_EN = GPIO(H, 7); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/gaze17-3060/gpio.c b/src/board/system76/gaze17-3060/gpio.c index 7345e13..6a735b6 100644 --- a/src/board/system76/gaze17-3060/gpio.c +++ b/src/board/system76/gaze17-3060/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -36,7 +36,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(D, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/gaze18/gpio.c b/src/board/system76/gaze18/gpio.c index 9267691..ddd42c2 100644 --- a/src/board/system76/gaze18/gpio.c +++ b/src/board/system76/gaze18/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -33,7 +33,7 @@ struct Gpio __code VA_EC_EN = GPIO(H, 7); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // Not documented diff --git a/src/board/system76/lemp10/gpio.c b/src/board/system76/lemp10/gpio.c index b72504c..1345ee8 100644 --- a/src/board/system76/lemp10/gpio.c +++ b/src/board/system76/lemp10/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -39,7 +39,7 @@ struct Gpio __code VR_ON = GPIO(H, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/lemp10/include/board/gpio.h b/src/board/system76/lemp10/include/board/gpio.h index 09e61c9..9affd2f 100644 --- a/src/board/system76/lemp10/include/board/gpio.h +++ b/src/board/system76/lemp10/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -49,6 +48,5 @@ extern struct Gpio __code VR_ON; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/lemp11/gpio.c b/src/board/system76/lemp11/gpio.c index 5cea0e9..2d08b39 100644 --- a/src/board/system76/lemp11/gpio.c +++ b/src/board/system76/lemp11/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -36,7 +36,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // Not documented diff --git a/src/board/system76/lemp11/include/board/gpio.h b/src/board/system76/lemp11/include/board/gpio.h index 0727863..72b0037 100644 --- a/src/board/system76/lemp11/include/board/gpio.h +++ b/src/board/system76/lemp11/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -46,6 +45,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/lemp12/gpio.c b/src/board/system76/lemp12/gpio.c index 543ba2b..7d97159 100644 --- a/src/board/system76/lemp12/gpio.c +++ b/src/board/system76/lemp12/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -37,7 +37,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // Enable LPC reset on GPD2 diff --git a/src/board/system76/lemp12/include/board/gpio.h b/src/board/system76/lemp12/include/board/gpio.h index 3961086..21a4314 100644 --- a/src/board/system76/lemp12/include/board/gpio.h +++ b/src/board/system76/lemp12/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -48,6 +47,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/lemp13-b/gpio.c b/src/board/system76/lemp13-b/gpio.c index a69782b..640fdec 100644 --- a/src/board/system76/lemp13-b/gpio.c +++ b/src/board/system76/lemp13-b/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(A, 4); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -28,7 +28,7 @@ struct Gpio __code SUSC_N_PCH = GPIO(H, 1); struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // Enable LPC reset on GPD2 diff --git a/src/board/system76/lemp13-b/include/board/gpio.h b/src/board/system76/lemp13-b/include/board/gpio.h index ce8d08d..7c46600 100644 --- a/src/board/system76/lemp13-b/include/board/gpio.h +++ b/src/board/system76/lemp13-b/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -44,6 +43,5 @@ extern struct Gpio __code VA_EC_EN; #define HAVE_WLAN_EN 0 extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/lemp13/gpio.c b/src/board/system76/lemp13/gpio.c index a69782b..640fdec 100644 --- a/src/board/system76/lemp13/gpio.c +++ b/src/board/system76/lemp13/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(A, 4); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -28,7 +28,7 @@ struct Gpio __code SUSC_N_PCH = GPIO(H, 1); struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // Enable LPC reset on GPD2 diff --git a/src/board/system76/lemp13/include/board/gpio.h b/src/board/system76/lemp13/include/board/gpio.h index ce8d08d..7c46600 100644 --- a/src/board/system76/lemp13/include/board/gpio.h +++ b/src/board/system76/lemp13/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -44,6 +43,5 @@ extern struct Gpio __code VA_EC_EN; #define HAVE_WLAN_EN 0 extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/lemp9/gpio.c b/src/board/system76/lemp9/gpio.c index 80d9cb8..4c3227d 100644 --- a/src/board/system76/lemp9/gpio.c +++ b/src/board/system76/lemp9/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -40,7 +40,7 @@ struct Gpio __code VR_ON = GPIO(H, 4); struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // Enable LPC reset on GPD2 diff --git a/src/board/system76/lemp9/include/board/gpio.h b/src/board/system76/lemp9/include/board/gpio.h index d8c7f8a..2405eef 100644 --- a/src/board/system76/lemp9/include/board/gpio.h +++ b/src/board/system76/lemp9/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -48,6 +47,5 @@ extern struct Gpio __code VR_ON; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/oryp11/gpio.c b/src/board/system76/oryp11/gpio.c index 34710e7..faaca91 100644 --- a/src/board/system76/oryp11/gpio.c +++ b/src/board/system76/oryp11/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -34,7 +34,7 @@ struct Gpio __code SLP_SUS_N = GPIO(H, 7); struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_PWR_EN = GPIO(D, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/oryp12/gpio.c b/src/board/system76/oryp12/gpio.c index f17a148..4551541 100644 --- a/src/board/system76/oryp12/gpio.c +++ b/src/board/system76/oryp12/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -35,7 +35,7 @@ struct Gpio __code SUSC_N_PCH = GPIO(H, 1); struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_PWR_EN = GPIO(J, 0); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/oryp5/gpio.c b/src/board/system76/oryp5/gpio.c index 31bb7eb..6d30a99 100644 --- a/src/board/system76/oryp5/gpio.c +++ b/src/board/system76/oryp5/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 6); struct Gpio __code AC_PRESENT = GPIO(E, 7); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -38,7 +38,7 @@ struct Gpio __code USB_PWR_EN_N = GPIO(F, 7); struct Gpio __code VA_EC_EN = GPIO(J, 0); // renamed to EC_SLP_SUS# struct Gpio __code WLAN_EN = GPIO(J, 7); struct Gpio __code WLAN_PWR_EN = GPIO(B, 0); -// clang-format on +// uncrustify:on void gpio_init(void) { // Enable LPC reset on GPD2 diff --git a/src/board/system76/oryp5/include/board/gpio.h b/src/board/system76/oryp5/include/board/gpio.h index 8c573c4..4cf22ca 100644 --- a/src/board/system76/oryp5/include/board/gpio.h +++ b/src/board/system76/oryp5/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -48,6 +47,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; #define HAVE_XLP_OUT 0 -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/oryp6/gpio.c b/src/board/system76/oryp6/gpio.c index 707289b..3d107d3 100644 --- a/src/board/system76/oryp6/gpio.c +++ b/src/board/system76/oryp6/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -38,7 +38,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); // renamed to EC_SLP_SUS# struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(A, 3); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/oryp6/include/board/gpio.h b/src/board/system76/oryp6/include/board/gpio.h index dbd7dce..19c8c81 100644 --- a/src/board/system76/oryp6/include/board/gpio.h +++ b/src/board/system76/oryp6/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -48,6 +47,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/oryp7/gpio.c b/src/board/system76/oryp7/gpio.c index bef4ffd..9a9ab36 100644 --- a/src/board/system76/oryp7/gpio.c +++ b/src/board/system76/oryp7/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -37,7 +37,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); // renamed to EC_SLP_SUS# struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(H, 4); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/oryp7/include/board/gpio.h b/src/board/system76/oryp7/include/board/gpio.h index db1937e..b5fe602 100644 --- a/src/board/system76/oryp7/include/board/gpio.h +++ b/src/board/system76/oryp7/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -48,6 +47,5 @@ extern struct Gpio __code VA_EC_EN; extern struct Gpio __code WLAN_EN; extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/oryp8/gpio.c b/src/board/system76/oryp8/gpio.c index 894349e..6db9f3f 100644 --- a/src/board/system76/oryp8/gpio.c +++ b/src/board/system76/oryp8/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -35,7 +35,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4); // renamed to EC_SLP_SUS# struct Gpio __code WLAN_EN = GPIO(G, 1); struct Gpio __code WLAN_PWR_EN = GPIO(H, 4); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // PWRSW WDT 2 Enable 2 diff --git a/src/board/system76/oryp9/gpio.c b/src/board/system76/oryp9/gpio.c index 6293c2f..775bde2 100644 --- a/src/board/system76/oryp9/gpio.c +++ b/src/board/system76/oryp9/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -38,7 +38,7 @@ struct Gpio __code USB_PWR_EN_N = GPIO(E, 3); struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code WLAN_PWR_EN = GPIO(G, 1); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // Not documented diff --git a/src/board/system76/oryp9/include/board/gpio.h b/src/board/system76/oryp9/include/board/gpio.h index 446d84a..d5ec255 100644 --- a/src/board/system76/oryp9/include/board/gpio.h +++ b/src/board/system76/oryp9/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -48,6 +47,5 @@ extern struct Gpio __code VA_EC_EN; #define HAVE_WLAN_EN 0 extern struct Gpio __code WLAN_PWR_EN; extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/board/system76/serw13/gpio.c b/src/board/system76/serw13/gpio.c index a05cff1..5c66e30 100644 --- a/src/board/system76/serw13/gpio.c +++ b/src/board/system76/serw13/gpio.c @@ -3,7 +3,7 @@ #include #include -// clang-format off +// uncrustify:off struct Gpio __code ACIN_N = GPIO(B, 0); struct Gpio __code AC_PRESENT = GPIO(E, 1); struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0); @@ -34,7 +34,7 @@ struct Gpio __code SWI_N = GPIO(B, 5); struct Gpio __code USB_PWR_EN_N = GPIO(E, 3); struct Gpio __code VA_EC_EN = GPIO(J, 4); struct Gpio __code XLP_OUT = GPIO(B, 4); -// clang-format on +// uncrustify:on void gpio_init(void) { // Not documented diff --git a/src/board/system76/serw13/include/board/gpio.h b/src/board/system76/serw13/include/board/gpio.h index aa8fe5c..676060b 100644 --- a/src/board/system76/serw13/include/board/gpio.h +++ b/src/board/system76/serw13/include/board/gpio.h @@ -7,7 +7,6 @@ void gpio_init(void); -// clang-format off extern struct Gpio __code ACIN_N; extern struct Gpio __code AC_PRESENT; extern struct Gpio __code ALL_SYS_PWRGD; @@ -45,6 +44,5 @@ extern struct Gpio __code VA_EC_EN; #define HAVE_WLAN_EN 0 #define HAVE_WLAN_PWR_EN 0 extern struct Gpio __code XLP_OUT; -// clang-format on #endif // _BOARD_GPIO_H diff --git a/src/common/i2c.c b/src/common/i2c.c index 2c2e367..e5fe144 100644 --- a/src/common/i2c.c +++ b/src/common/i2c.c @@ -2,9 +2,7 @@ #include -// clang-format off int16_t i2c_recv(struct I2C *const i2c, uint8_t addr, uint8_t *const data, uint16_t length) __reentrant { - // clang-format on int16_t res = 0; res = i2c_start(i2c, addr, true); @@ -20,9 +18,7 @@ int16_t i2c_recv(struct I2C *const i2c, uint8_t addr, uint8_t *const data, uint1 return res; } -// clang-format off int16_t i2c_send(struct I2C *const i2c, uint8_t addr, uint8_t *const data, uint16_t length) __reentrant { - // clang-format on int16_t res = 0; res = i2c_start(i2c, addr, false); diff --git a/src/common/include/common/i2c.h b/src/common/include/common/i2c.h index 87bbd6b..a55edac 100644 --- a/src/common/include/common/i2c.h +++ b/src/common/include/common/i2c.h @@ -30,8 +30,6 @@ int16_t i2c_write(struct I2C *const i2c, const uint8_t *const data, uint16_t len // Must be defined by arch, board, or ec int16_t i2c_read(struct I2C *const i2c, uint8_t *const data, uint16_t length) __reentrant; -// clang-format off - // Read multiple bytes from address in one transaction int16_t i2c_recv( struct I2C *const i2c, @@ -48,8 +46,6 @@ int16_t i2c_send( uint16_t length ) __reentrant; -// clang-format on - // Read multiple bytes from a register in one transaction int16_t i2c_get( struct I2C *const i2c, diff --git a/src/common/keymap.c b/src/common/keymap.c index af2c608..cbb51ae 100644 --- a/src/common/keymap.c +++ b/src/common/keymap.c @@ -9,26 +9,24 @@ #endif // https://www.win.tue.nl/~aeb/linux/kbd/scancodes-10.html#ss10.3 -// clang-format off static uint8_t __code lookup[256] = { -0xff, 0x43, 0x41, 0x3f, 0x3d, 0x3b, 0x3c, 0x58, 0x64, 0x44, 0x42, 0x40, 0x3e, 0x0f, 0x29, 0x59, -0x65, 0x38, 0x2a, 0x70, 0x1d, 0x10, 0x02, 0x5a, 0x66, 0x71, 0x2c, 0x1f, 0x1e, 0x11, 0x03, 0x5b, -0x67, 0x2e, 0x2d, 0x20, 0x12, 0x05, 0x04, 0x5c, 0x68, 0x39, 0x2f, 0x21, 0x14, 0x13, 0x06, 0x5d, -0x69, 0x31, 0x30, 0x23, 0x22, 0x15, 0x07, 0x5e, 0x6a, 0x72, 0x32, 0x24, 0x16, 0x08, 0x09, 0x5f, -0x6b, 0x33, 0x25, 0x17, 0x18, 0x0b, 0x0a, 0x60, 0x6c, 0x34, 0x35, 0x26, 0x27, 0x19, 0x0c, 0x61, -0x6d, 0x73, 0x28, 0x74, 0x1a, 0x0d, 0x62, 0x6e, 0x3a, 0x36, 0x1c, 0x1b, 0x75, 0x2b, 0x63, 0x76, -0x55, 0x56, 0x77, 0x78, 0x79, 0x7a, 0x0e, 0x7b, 0x7c, 0x4f, 0x7d, 0x4b, 0x47, 0x7e, 0x7f, 0x6f, -0x52, 0x53, 0x50, 0x4c, 0x4d, 0x48, 0x01, 0x45, 0x57, 0x4e, 0x51, 0x4a, 0x37, 0x49, 0x46, 0x54, -0x80, 0x81, 0x82, 0x41, 0x54, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, -0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, -0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, -0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, -0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, -0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, -0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, -0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, + 0xff, 0x43, 0x41, 0x3f, 0x3d, 0x3b, 0x3c, 0x58, 0x64, 0x44, 0x42, 0x40, 0x3e, 0x0f, 0x29, 0x59, + 0x65, 0x38, 0x2a, 0x70, 0x1d, 0x10, 0x02, 0x5a, 0x66, 0x71, 0x2c, 0x1f, 0x1e, 0x11, 0x03, 0x5b, + 0x67, 0x2e, 0x2d, 0x20, 0x12, 0x05, 0x04, 0x5c, 0x68, 0x39, 0x2f, 0x21, 0x14, 0x13, 0x06, 0x5d, + 0x69, 0x31, 0x30, 0x23, 0x22, 0x15, 0x07, 0x5e, 0x6a, 0x72, 0x32, 0x24, 0x16, 0x08, 0x09, 0x5f, + 0x6b, 0x33, 0x25, 0x17, 0x18, 0x0b, 0x0a, 0x60, 0x6c, 0x34, 0x35, 0x26, 0x27, 0x19, 0x0c, 0x61, + 0x6d, 0x73, 0x28, 0x74, 0x1a, 0x0d, 0x62, 0x6e, 0x3a, 0x36, 0x1c, 0x1b, 0x75, 0x2b, 0x63, 0x76, + 0x55, 0x56, 0x77, 0x78, 0x79, 0x7a, 0x0e, 0x7b, 0x7c, 0x4f, 0x7d, 0x4b, 0x47, 0x7e, 0x7f, 0x6f, + 0x52, 0x53, 0x50, 0x4c, 0x4d, 0x48, 0x01, 0x45, 0x57, 0x4e, 0x51, 0x4a, 0x37, 0x49, 0x46, 0x54, + 0x80, 0x81, 0x82, 0x41, 0x54, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, }; -// clang-format on uint16_t keymap_translate(uint16_t key) { return (key & 0xFF00) | lookup[(key & 0xFF)]; diff --git a/src/common/version.c b/src/common/version.c index 9fd072f..e1ebadb 100644 --- a/src/common/version.c +++ b/src/common/version.c @@ -7,7 +7,6 @@ #define __code #endif -// clang-format off static const char __code BOARD[] = "76EC_BOARD=" xstr(__BOARD__); @@ -15,7 +14,6 @@ static const char __code BOARD[] = static const char __code VERSION[] = "76EC_VERSION=" xstr(__FIRMWARE_VERSION__); -// clang-format on const char *board(void) { return &BOARD[11]; diff --git a/src/ec/ite/i2c.c b/src/ec/ite/i2c.c index cd0f13c..c164e99 100644 --- a/src/ec/ite/i2c.c +++ b/src/ec/ite/i2c.c @@ -134,15 +134,14 @@ static int16_t i2c_transaction( uint32_t timeout = I2C_TIMEOUT; for (timeout = I2C_TIMEOUT; timeout > 0; timeout--) { status = *(i2c->hosta); - // If error occured, kill transaction and return error if (status & HOSTA_ERR) { + // If error occured, kill transaction and return error i2c_reset(i2c, true); return -(int16_t)(status); - } else + } else if (status & HOSTA_BYTE_DONE) { // If byte done, break - if (status & HOSTA_BYTE_DONE) { - break; - } + break; + } } // If timeout occured, kill transaction and return error if (timeout == 0) { diff --git a/src/ec/ite/include/ec/espi.h b/src/ec/ite/include/ec/espi.h index e026f46..cc276f8 100644 --- a/src/ec/ite/include/ec/espi.h +++ b/src/ec/ite/include/ec/espi.h @@ -13,13 +13,11 @@ struct VirtualWire { uint8_t valid_mask; }; -// clang-format off #define VIRTUAL_WIRE(INDEX, SHIFT) { \ .index = &VWIDX ## INDEX, \ .data_mask = BIT(SHIFT), \ .valid_mask = BIT(SHIFT + 4), \ } -// clang-format on enum VirtualWireState { VWS_INVALID = 0x00, diff --git a/src/ec/ite/include/ec/gpio.h b/src/ec/ite/include/ec/gpio.h index 112fd6d..e618cce 100644 --- a/src/ec/ite/include/ec/gpio.h +++ b/src/ec/ite/include/ec/gpio.h @@ -8,13 +8,11 @@ #include #include -// clang-format off #define GPIO_ALT (0b00U << 6) #define GPIO_IN (0b10U << 6) #define GPIO_OUT (0b01U << 6) #define GPIO_UP BIT(2) #define GPIO_DOWN BIT(1) -// clang-format on struct Gpio { volatile uint8_t __xdata *data; @@ -23,14 +21,12 @@ struct Gpio { uint8_t value; }; -// clang-format off #define GPIO(BLOCK, NUMBER) { \ .data = &GPDR ## BLOCK, \ .mirror = &GPDMR ## BLOCK, \ .control = &GPCR ## BLOCK ## NUMBER, \ .value = BIT(NUMBER), \ } -// clang-format on bool gpio_get(const struct Gpio *const gpio); void gpio_set(struct Gpio *const gpio, bool value); diff --git a/src/ec/ite/intc.c b/src/ec/ite/intc.c index da7d512..54651ee 100644 --- a/src/ec/ite/intc.c +++ b/src/ec/ite/intc.c @@ -10,7 +10,6 @@ struct IrqGroup { volatile uint8_t *polarity; }; -// clang-format off #define IRQ_GROUP(nr) { \ .status = &ISR ## nr, \ .enable = &IER ## nr, \ @@ -44,7 +43,6 @@ static const struct IrqGroup irqs[] = { IRQ_GROUP(21), #endif }; -// clang-format on void intc_enable(uint8_t nr) { // XXX: SDCC doesn't optimize division with power-of-2. diff --git a/src/ec/ite/pmc.c b/src/ec/ite/pmc.c index f5968bc..6b21329 100644 --- a/src/ec/ite/pmc.c +++ b/src/ec/ite/pmc.c @@ -2,7 +2,6 @@ #include -// clang-format off #define PMC(NUM) { \ .status = &PM ## NUM ## STS, \ .data_out = &PM ## NUM ## DO, \ @@ -11,7 +10,6 @@ .interrupt_control = &PM ## NUM ## IC, \ .interrupt_enable = &PM ## NUM ## IE, \ } -// clang-format on struct Pmc __code PMC_1 = PMC(1); struct Pmc __code PMC_2 = PMC(2); diff --git a/src/ec/ite/ps2.c b/src/ec/ite/ps2.c index a837108..ada30ae 100644 --- a/src/ec/ite/ps2.c +++ b/src/ec/ite/ps2.c @@ -2,14 +2,12 @@ #include -// clang-format off #define PS2(NUM) { \ .control = &PSCTL ## NUM, \ .interrupt = &PSINT ## NUM, \ .status = &PSSTS ## NUM, \ .data = &PSDAT ## NUM, \ } -// clang-format on struct Ps2 __code PS2_1 = PS2(1); struct Ps2 __code PS2_2 = PS2(2); diff --git a/src/ec/ite/signature.c b/src/ec/ite/signature.c index ef8681b..767f532 100644 --- a/src/ec/ite/signature.c +++ b/src/ec/ite/signature.c @@ -2,7 +2,6 @@ #include -// clang-format off #if CONFIG_BUS_ESPI // eSPI signature (byte 7 = 0xA4) static __code const uint8_t __at(0x40) SIGNATURE[16] = { @@ -16,4 +15,3 @@ static __code const uint8_t __at(0x40) SIGNATURE[16] = { 0x85, 0x12, 0x5A, 0x5A, 0xAA, 0x00, 0x55, 0x55, }; #endif // CONFIG_BUS_ESPI -// clang-format on diff --git a/src/ec/ite/wuc.c b/src/ec/ite/wuc.c index cf875c3..eb34814 100644 --- a/src/ec/ite/wuc.c +++ b/src/ec/ite/wuc.c @@ -10,8 +10,6 @@ struct WucGroup { volatile uint8_t *enable; }; -// clang-format off - // Only groups 1, 3, and 4 have WUENR. #define WUC_GROUP_EN(nr) { \ .edge = &WUEMR ## nr, \ @@ -43,8 +41,6 @@ static const struct WucGroup wuc[] = { WUC_GROUP(14), }; -// clang-format on - void wuc_enable(uint8_t nr, enum WucEdgeMode detect) { // XXX: SDCC doesn't optimize division with power-of-2. const uint8_t group = nr >> 3U; diff --git a/src/keyboard/system76/14in_81/include/board/keymap.h b/src/keyboard/system76/14in_81/include/board/keymap.h index 2635cd0..7df9be2 100644 --- a/src/keyboard/system76/14in_81/include/board/keymap.h +++ b/src/keyboard/system76/14in_81/include/board/keymap.h @@ -13,8 +13,8 @@ // common/keymap.h requires KM_LAY, KM_OUT, and KM_IN definitions #include -// clang-format off // Conversion of physical ANSI layout to keyboard matrix +// uncrustify:off #define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ @@ -41,7 +41,7 @@ /*14*/{ ___, K2D, K57, K1D, ___, K0F, ___, K0G }, \ /*15*/{ ___, ___, K3C, ___, K0C, ___, ___, K58 } \ } -// clang-format on +// uncrustify:on // Position of physical Esc key in the matrix #define MATRIX_ESC_INPUT 7 diff --git a/src/keyboard/system76/14in_81/keymap/default.c b/src/keyboard/system76/14in_81/keymap/default.c index 0e685ab..57553c8 100644 --- a/src/keyboard/system76/14in_81/keymap/default.c +++ b/src/keyboard/system76/14in_81/keymap/default.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_PAUSE, K_DEL, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_SUPER, K_LEFT_ALT, K_SPACE, K_RIGHT_ALT, K_APP, K_HOME, K_END, K_PGDN ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/14in_81/keymap/jeremy.c b/src/keyboard/system76/14in_81/keymap/jeremy.c index 7df5ab1..233adbb 100644 --- a/src/keyboard/system76/14in_81/keymap/jeremy.c +++ b/src/keyboard/system76/14in_81/keymap/jeremy.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_PAUSE, K_DEL, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_ALT, K_LEFT_SUPER, K_ESC, K_RIGHT_ALT, K_APP, K_HOME, K_END, K_PGDN ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/14in_83/include/board/keymap.h b/src/keyboard/system76/14in_83/include/board/keymap.h index 45c7df2..4c2119e 100644 --- a/src/keyboard/system76/14in_83/include/board/keymap.h +++ b/src/keyboard/system76/14in_83/include/board/keymap.h @@ -13,8 +13,8 @@ // common/keymap.h requires KM_LAY, KM_OUT, and KM_IN definitions #include -// clang-format off // Conversion of physical ANSI layout to keyboard matrix +// uncrustify:off #define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ @@ -41,8 +41,10 @@ { ___, K2D, K60, K1D, K57, K0F, ___, K0G }, \ { ___, ___, K3C, ___, K61, K0C, ___, K59 } \ } +// uncrustify:on // Conversion of physical ISO layout to keyboard matrix +// uncrustify:off #define LAYOUT_ISO( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ @@ -69,7 +71,7 @@ { ___, ___, K60, K1D, K57, K0F, ___, K0G }, \ { ___, ___, K2D, ___, K61, K0C, ___, K59 } \ } -// clang-format on +// uncrustify:on // Position of physical Esc key in the matrix #define MATRIX_ESC_INPUT 7 diff --git a/src/keyboard/system76/14in_83/keymap/clevo_l141cu_us_iso.c b/src/keyboard/system76/14in_83/keymap/clevo_l141cu_us_iso.c index 8887f16..b09f3a4 100644 --- a/src/keyboard/system76/14in_83/keymap/clevo_l141cu_us_iso.c +++ b/src/keyboard/system76/14in_83/keymap/clevo_l141cu_us_iso.c @@ -5,7 +5,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { // TODO: K0E=K_PAUSE (once defined in src/common/include/common/keymap.h) LAYOUT_ISO( @@ -28,4 +28,4 @@ LAYOUT_ISO( K_LEFT, K_DOWN, K_RIGHT ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/14in_83/keymap/darp10-b.c b/src/keyboard/system76/14in_83/keymap/darp10-b.c index 1fc3bb7..f28cc78 100644 --- a/src/keyboard/system76/14in_83/keymap/darp10-b.c +++ b/src/keyboard/system76/14in_83/keymap/darp10-b.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_HOME, K_END, K_PRINT_SCREEN, K_DEL, @@ -25,4 +25,4 @@ LAYOUT( K_LEFT, K_DOWN, K_RIGHT ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/14in_83/keymap/default.c b/src/keyboard/system76/14in_83/keymap/default.c index f696aee..d84fb46 100644 --- a/src/keyboard/system76/14in_83/keymap/default.c +++ b/src/keyboard/system76/14in_83/keymap/default.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_HOME, K_END, K_PRINT_SCREEN, K_DEL, @@ -25,4 +25,4 @@ LAYOUT( K_LEFT, K_DOWN, K_RIGHT ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/14in_83/keymap/fabian.c b/src/keyboard/system76/14in_83/keymap/fabian.c index 1ff1d84..8609405 100644 --- a/src/keyboard/system76/14in_83/keymap/fabian.c +++ b/src/keyboard/system76/14in_83/keymap/fabian.c @@ -8,7 +8,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { // TODO: K0E=K_PAUSE (once defined in src/common/include/common/keymap.h) LAYOUT_ISO( @@ -31,4 +31,4 @@ LAYOUT_ISO( K_LEFT, K_DOWN, K_RIGHT ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/14in_83/keymap/ins-prtsc.c b/src/keyboard/system76/14in_83/keymap/ins-prtsc.c index 74dcf3c..f55d775 100644 --- a/src/keyboard/system76/14in_83/keymap/ins-prtsc.c +++ b/src/keyboard/system76/14in_83/keymap/ins-prtsc.c @@ -5,7 +5,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_HOME, K_END, K_INSERT, K_DEL, @@ -26,4 +26,4 @@ LAYOUT( K_LEFT, K_DOWN, K_RIGHT ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/14in_83/keymap/jeremy.c b/src/keyboard/system76/14in_83/keymap/jeremy.c index f162f67..4a7720a 100644 --- a/src/keyboard/system76/14in_83/keymap/jeremy.c +++ b/src/keyboard/system76/14in_83/keymap/jeremy.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_HOME, K_END, K_PRINT_SCREEN, K_DEL, @@ -25,4 +25,4 @@ LAYOUT( K_LEFT, K_DOWN, K_RIGHT ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/14in_83/keymap/levi.c b/src/keyboard/system76/14in_83/keymap/levi.c index 13af2d3..1bc425e 100644 --- a/src/keyboard/system76/14in_83/keymap/levi.c +++ b/src/keyboard/system76/14in_83/keymap/levi.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_HOME, K_END, K_PRINT_SCREEN, K_DEL, @@ -25,4 +25,4 @@ LAYOUT( K_LEFT, K_DOWN, K_RIGHT ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/14in_83/keymap/valentin_french_iso.c b/src/keyboard/system76/14in_83/keymap/valentin_french_iso.c index a969a78..0739b59 100644 --- a/src/keyboard/system76/14in_83/keymap/valentin_french_iso.c +++ b/src/keyboard/system76/14in_83/keymap/valentin_french_iso.c @@ -7,7 +7,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { // TODO: K0E=K_PAUSE (once defined in src/common/include/common/keymap.h) LAYOUT_ISO( @@ -30,4 +30,4 @@ LAYOUT_ISO( K_LEFT, K_DOWN, K_RIGHT ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/14in_86/include/board/keymap.h b/src/keyboard/system76/14in_86/include/board/keymap.h index e3c62f4..40cde7a 100644 --- a/src/keyboard/system76/14in_86/include/board/keymap.h +++ b/src/keyboard/system76/14in_86/include/board/keymap.h @@ -13,8 +13,8 @@ // common/keymap.h requires KM_LAY, KM_OUT, and KM_IN definitions #include -// clang-format off // Conversion of physical layout to keyboard matrix +// uncrustify:off #define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ @@ -40,7 +40,7 @@ { ___, K2D, K58, K1D, K2E, K0F, K1E, K0G }, \ { K56, ___, K3C, ___, K59, K0C, K4D, K3D } \ } -// clang-format on +// uncrustify:on // Position of physical Esc key in the matrix #define MATRIX_ESC_INPUT 7 diff --git a/src/keyboard/system76/14in_86/keymap/carl.c b/src/keyboard/system76/14in_86/keymap/carl.c index 5b964ae..7d05965 100644 --- a/src/keyboard/system76/14in_86/keymap/carl.c +++ b/src/keyboard/system76/14in_86/keymap/carl.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, 0 /* pause */, K_INSERT, K_DEL, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_ALT, K_LEFT_SUPER, K_SPACE, K_RIGHT_CTRL, K_APP, K_RIGHT_ALT, K_LEFT, K_DOWN, K_RIGHT ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/14in_86/keymap/default.c b/src/keyboard/system76/14in_86/keymap/default.c index 7adbba3..1175ca2 100644 --- a/src/keyboard/system76/14in_86/keymap/default.c +++ b/src/keyboard/system76/14in_86/keymap/default.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_PAUSE, K_INSERT, K_DEL, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_SUPER, K_LEFT_ALT, K_SPACE, K_RIGHT_ALT, K_APP, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/14in_86/keymap/jeremy.c b/src/keyboard/system76/14in_86/keymap/jeremy.c index 33ec62b..2d62d7d 100644 --- a/src/keyboard/system76/14in_86/keymap/jeremy.c +++ b/src/keyboard/system76/14in_86/keymap/jeremy.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, 0 /* pause */, K_INSERT, K_DEL, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_ALT, K_LEFT_SUPER, K_ESC, KT_FN, K_RIGHT_ALT, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/15in_102/include/board/keymap.h b/src/keyboard/system76/15in_102/include/board/keymap.h index 66c056b..40fdf8b 100644 --- a/src/keyboard/system76/15in_102/include/board/keymap.h +++ b/src/keyboard/system76/15in_102/include/board/keymap.h @@ -21,8 +21,8 @@ #define KI2 K_INT_2 #endif -// clang-format off // Conversion of physical layout to keyboard matrix +// uncrustify:off #define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I, K0J, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, \ @@ -50,7 +50,7 @@ { K0H, K0G, K43, K4C, K59, K10, K0B, K0C }, \ { K35, K1C, K4F, K51, K4D, K58, K5A, ___ } \ } -// clang-format on +// uncrustify:on // Position of physical Esc key in the matrix #define MATRIX_ESC_INPUT 7 diff --git a/src/keyboard/system76/15in_102/keymap/default.c b/src/keyboard/system76/15in_102/keymap/default.c index 12c3b93..d359c28 100644 --- a/src/keyboard/system76/15in_102/keymap/default.c +++ b/src/keyboard/system76/15in_102/keymap/default.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_DEL, K_HOME, K_END, K_PGUP, K_PGDN, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_SUPER, K_LEFT_ALT, K_SPACE, K_RIGHT_ALT, K_APP, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/15in_102/keymap/jeremy.c b/src/keyboard/system76/15in_102/keymap/jeremy.c index 9500271..68e52e9 100644 --- a/src/keyboard/system76/15in_102/keymap/jeremy.c +++ b/src/keyboard/system76/15in_102/keymap/jeremy.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_DEL, K_HOME, K_END, K_PGUP, K_PGDN, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_ALT, K_LEFT_SUPER, K_ESC, KT_FN, K_RIGHT_ALT, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/15in_102_nkey/include/board/keymap.h b/src/keyboard/system76/15in_102_nkey/include/board/keymap.h index e80ff7f..118ad63 100644 --- a/src/keyboard/system76/15in_102_nkey/include/board/keymap.h +++ b/src/keyboard/system76/15in_102_nkey/include/board/keymap.h @@ -15,8 +15,8 @@ // common/keymap.h requires KM_LAY, KM_OUT, and KM_IN definitions #include -// clang-format off // Conversion of physical layout to keyboard matrix +// uncrustify:off #define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I, K0J, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, \ @@ -44,7 +44,7 @@ { ___, ___, ___, ___, ___, ___, ___, ___ }, /* 16 */ \ { ___, ___, ___, ___, ___, ___, ___, ___ } /* 17 */ \ } -// clang-format on +// uncrustify:on // Position of physical Esc key in the matrix #define MATRIX_ESC_INPUT 0 diff --git a/src/keyboard/system76/15in_102_nkey/keymap/default.c b/src/keyboard/system76/15in_102_nkey/keymap/default.c index 12c3b93..d359c28 100644 --- a/src/keyboard/system76/15in_102_nkey/keymap/default.c +++ b/src/keyboard/system76/15in_102_nkey/keymap/default.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_DEL, K_HOME, K_END, K_PGUP, K_PGDN, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_SUPER, K_LEFT_ALT, K_SPACE, K_RIGHT_ALT, K_APP, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/15in_102_nkey/keymap/jeremy.c b/src/keyboard/system76/15in_102_nkey/keymap/jeremy.c index 9500271..68e52e9 100644 --- a/src/keyboard/system76/15in_102_nkey/keymap/jeremy.c +++ b/src/keyboard/system76/15in_102_nkey/keymap/jeremy.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_DEL, K_HOME, K_END, K_PGUP, K_PGDN, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_ALT, K_LEFT_SUPER, K_ESC, KT_FN, K_RIGHT_ALT, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/18H9LHA04/include/board/keymap.h b/src/keyboard/system76/18H9LHA04/include/board/keymap.h index 66c056b..40fdf8b 100644 --- a/src/keyboard/system76/18H9LHA04/include/board/keymap.h +++ b/src/keyboard/system76/18H9LHA04/include/board/keymap.h @@ -21,8 +21,8 @@ #define KI2 K_INT_2 #endif -// clang-format off // Conversion of physical layout to keyboard matrix +// uncrustify:off #define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I, K0J, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, \ @@ -50,7 +50,7 @@ { K0H, K0G, K43, K4C, K59, K10, K0B, K0C }, \ { K35, K1C, K4F, K51, K4D, K58, K5A, ___ } \ } -// clang-format on +// uncrustify:on // Position of physical Esc key in the matrix #define MATRIX_ESC_INPUT 7 diff --git a/src/keyboard/system76/18H9LHA04/keymap/default.c b/src/keyboard/system76/18H9LHA04/keymap/default.c index 703de6a..3268c12 100644 --- a/src/keyboard/system76/18H9LHA04/keymap/default.c +++ b/src/keyboard/system76/18H9LHA04/keymap/default.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_DEL, K_HOME, K_END, K_PGUP, K_PGDN, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_SUPER, K_LEFT_ALT, K_SPACE, K_RIGHT_ALT, K_APP, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/18H9LHA04/keymap/jeremy.c b/src/keyboard/system76/18H9LHA04/keymap/jeremy.c index 54dde98..76dd509 100644 --- a/src/keyboard/system76/18H9LHA04/keymap/jeremy.c +++ b/src/keyboard/system76/18H9LHA04/keymap/jeremy.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_DEL, K_HOME, K_END, K_PGUP, K_PGDN, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_ALT, K_LEFT_SUPER, K_ESC, KT_FN, K_RIGHT_ALT, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/18H9LHA05/include/board/keymap.h b/src/keyboard/system76/18H9LHA05/include/board/keymap.h index 66c056b..40fdf8b 100644 --- a/src/keyboard/system76/18H9LHA05/include/board/keymap.h +++ b/src/keyboard/system76/18H9LHA05/include/board/keymap.h @@ -21,8 +21,8 @@ #define KI2 K_INT_2 #endif -// clang-format off // Conversion of physical layout to keyboard matrix +// uncrustify:off #define LAYOUT( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I, K0J, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, \ @@ -50,7 +50,7 @@ { K0H, K0G, K43, K4C, K59, K10, K0B, K0C }, \ { K35, K1C, K4F, K51, K4D, K58, K5A, ___ } \ } -// clang-format on +// uncrustify:on // Position of physical Esc key in the matrix #define MATRIX_ESC_INPUT 7 diff --git a/src/keyboard/system76/18H9LHA05/keymap/darp10.c b/src/keyboard/system76/18H9LHA05/keymap/darp10.c index 2c53222..c258ce9 100644 --- a/src/keyboard/system76/18H9LHA05/keymap/darp10.c +++ b/src/keyboard/system76/18H9LHA05/keymap/darp10.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_DEL, K_HOME, K_END, K_PGUP, K_PGDN, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_SUPER, K_LEFT_ALT, K_SPACE, K_RIGHT_ALT, K_APP, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD ) }; -// clang-format on +// uncrustify:on diff --git a/src/keyboard/system76/18H9LHA05/keymap/default.c b/src/keyboard/system76/18H9LHA05/keymap/default.c index 62053a3..ab7ea7c 100644 --- a/src/keyboard/system76/18H9LHA05/keymap/default.c +++ b/src/keyboard/system76/18H9LHA05/keymap/default.c @@ -4,7 +4,7 @@ #include -// clang-format off +// uncrustify:off uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { LAYOUT( K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_DEL, K_HOME, K_END, K_PGUP, K_PGDN, @@ -23,4 +23,4 @@ LAYOUT( K_LEFT_CTRL, KT_FN, K_LEFT_SUPER, K_LEFT_ALT, K_SPACE, K_RIGHT_ALT, K_APP, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD ) }; -// clang-format on +// uncrustify:on