diff --git a/.sublime-project b/.sublime-project index 5d751aaf6..da2ef41a1 100644 --- a/.sublime-project +++ b/.sublime-project @@ -6,16 +6,20 @@ } ], "settings": { - "LSP": { - "clangd": { - "initializationOptions": { - "clangd.compile-commands-dir": "build/latest", - "clangd.header-insertion": "never", - "clangd.query-driver": "**", - "clangd.clang-tidy": true, - }, + "LSP": { + "clangd": { "enabled": true, + "initializationOptions": { + // Use with toolchain version 39+ + // Set `"binary": "custom",` option in LSP-clangd config to use toolchain clangd + // "custom_command": ["toolchain/current/bin/clangd"], + + "clangd.compile-commands-dir": "build/latest", + "clangd.header-insertion": "never", + "clangd.query-driver": "**/arm-none-eabi-*", + "clangd.clang-tidy": true, + }, }, - }, + }, }, } diff --git a/.vscode/.gitignore b/.vscode/.gitignore index 481efcdef..bd4df47d6 100644 --- a/.vscode/.gitignore +++ b/.vscode/.gitignore @@ -1,5 +1,3 @@ -/c_cpp_properties.json -/extensions.json -/launch.json -/settings.json -/tasks.json +* +!example/ +!ReadMe.md diff --git a/.vscode/example/settings.json.tmpl b/.vscode/example/settings.json.tmpl index 5e5b5dcf4..5e0da6897 100644 --- a/.vscode/example/settings.json.tmpl +++ b/.vscode/example/settings.json.tmpl @@ -12,7 +12,7 @@ "SConstruct": "python", "*.fam": "python" }, - "clangd.path": "${workspaceFolder}/toolchain/current/bin/clangd@FBT_PLATFORM_EXECUTABLE_EXT@", + // "clangd.path": "${workspaceFolder}/toolchain/current/bin/clangd@FBT_PLATFORM_EXECUTABLE_EXT@", "clangd.arguments": [ "--query-driver=**/arm-none-eabi-*", "--compile-commands-dir=${workspaceFolder}/build/latest", diff --git a/applications/main/infrared/resources/infrared/assets/tv.ir b/applications/main/infrared/resources/infrared/assets/tv.ir index d9aaac130..a31e2e07d 100755 --- a/applications/main/infrared/resources/infrared/assets/tv.ir +++ b/applications/main/infrared/resources/infrared/assets/tv.ir @@ -3563,3 +3563,4 @@ type: parsed protocol: NEC address: 40 00 00 00 command: 17 00 00 00 + diff --git a/scripts/ufbt/project_template/.clang-format b/scripts/ufbt/project_template/.clang-format index ad3484ba0..c42068920 100644 --- a/scripts/ufbt/project_template/.clang-format +++ b/scripts/ufbt/project_template/.clang-format @@ -11,9 +11,9 @@ AlignConsecutiveAssignments: AlignFunctionPointers: false PadOperators: true AlignConsecutiveBitFields: - Enabled: false - AcrossEmptyLines: false - AcrossComments: false + Enabled: true + AcrossEmptyLines: true + AcrossComments: true AlignCompound: false AlignFunctionPointers: false PadOperators: true @@ -25,10 +25,10 @@ AlignConsecutiveDeclarations: AlignFunctionPointers: false PadOperators: true AlignConsecutiveMacros: - Enabled: false + Enabled: true AcrossEmptyLines: false - AcrossComments: false - AlignCompound: false + AcrossComments: true + AlignCompound: true AlignFunctionPointers: false PadOperators: true AlignConsecutiveShortCaseStatements: @@ -47,7 +47,7 @@ AllowBreakBeforeNoexceptSpecifier: Never AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false AllowShortCompoundRequirementOnASingleLine: true -AllowShortEnumsOnASingleLine: true +AllowShortEnumsOnASingleLine: false AllowShortFunctionsOnASingleLine: None AllowShortIfStatementsOnASingleLine: WithoutElse AllowShortLambdasOnASingleLine: All @@ -108,6 +108,7 @@ ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH + - M_EACH IfMacros: - KJ_IF_MAYBE IncludeBlocks: Preserve @@ -136,7 +137,7 @@ IndentRequiresClause: false IndentWidth: 4 IndentWrappedFunctionNames: true InsertBraces: false -InsertNewlineAtEOF: false +InsertNewlineAtEOF: true InsertTrailingCommas: None IntegerLiteralSeparator: Binary: 0 @@ -179,7 +180,7 @@ ReferenceAlignment: Pointer ReflowComments: false RemoveBracesLLVM: false RemoveParentheses: Leave -RemoveSemicolon: false +RemoveSemicolon: true RequiresClausePosition: OwnLine RequiresExpressionIndentation: OuterScope SeparateDefinitionBlocks: Leave @@ -226,7 +227,7 @@ SpacesInParensOptions: InEmptyParentheses: false Other: false SpacesInSquareBrackets: false -Standard: c++03 +Standard: c++20 StatementAttributeLikeMacros: - Q_EMIT StatementMacros: diff --git a/scripts/ufbt/project_template/.vscode/settings.json b/scripts/ufbt/project_template/.vscode/settings.json index d304752a9..b93ad82f1 100644 --- a/scripts/ufbt/project_template/.vscode/settings.json +++ b/scripts/ufbt/project_template/.vscode/settings.json @@ -19,7 +19,7 @@ "[python]": { "editor.defaultFormatter": "ms-python.black-formatter" }, - "clangd.path": "@UFBT_TOOLCHAIN_CLANGD@", + // "clangd.path": "@UFBT_TOOLCHAIN_CLANGD@", "clangd.arguments": [ "--query-driver=**/arm-none-eabi-*", "--compile-commands-dir=${workspaceFolder}/.vscode", diff --git a/targets/f7/furi_hal/furi_hal_interrupt.c b/targets/f7/furi_hal/furi_hal_interrupt.c index 6e14e09c8..35c40c259 100644 --- a/targets/f7/furi_hal/furi_hal_interrupt.c +++ b/targets/f7/furi_hal/furi_hal_interrupt.c @@ -13,10 +13,15 @@ #define FURI_HAL_INTERRUPT_DEFAULT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY + 5) +#ifdef FURI_RAM_EXEC +#define FURI_HAL_INTERRUPT_ACCOUNT_START() +#define FURI_HAL_INTERRUPT_ACCOUNT_END() +#else #define FURI_HAL_INTERRUPT_ACCOUNT_START() const uint32_t _isr_start = DWT->CYCCNT; #define FURI_HAL_INTERRUPT_ACCOUNT_END() \ const uint32_t _time_in_isr = DWT->CYCCNT - _isr_start; \ furi_hal_interrupt.counter_time_in_isr_total += _time_in_isr; +#endif typedef struct { FuriHalInterruptISR isr; @@ -372,6 +377,7 @@ void LPUART1_IRQHandler(void) { furi_hal_interrupt_call(FuriHalInterruptIdLpUart1); } +// Potential space-saver for updater build const char* furi_hal_interrupt_get_name(uint8_t exception_number) { int32_t id = (int32_t)exception_number - 16;