From 96e14ed6ea89b1b7f624c0501cf8157cb05613f7 Mon Sep 17 00:00:00 2001 From: Drath Date: Sat, 2 May 2026 19:22:29 +0200 Subject: [PATCH] we're getttng C to work C deez nuts --- .clang-format | 60 +- .idea/codeStyles/Project.xml | 6 +- .idea/editor.xml | 3 +- CMakeLists.txt | 21 +- README.md | 9 +- include/LCDDisplay.hpp | 48 - include/app.hpp | 71 - include/cpu.hpp | 33 - include/gpu.hpp | 85 -- include/{gpu_metrics.hpp => gpu_metrics.h} | 1597 ++++++++++---------- include/hass.hpp | 37 - include/lcd.h | 35 + include/log.h | 41 + include/log.hpp | 96 -- include/sys.hpp | 49 - include/utils.hpp | 80 - main.cpp | 20 - src/LCDDisplay.cpp | 154 -- src/app.cpp | 209 --- src/cpu.cpp | 72 - src/gpu.cpp | 123 -- src/hass.cpp | 163 -- src/lcd.c | 133 ++ src/log.c | 95 ++ src/main.c | 115 ++ src/sys.cpp | 87 -- src/utils.cpp | 32 - 27 files changed, 1287 insertions(+), 2187 deletions(-) delete mode 100644 include/LCDDisplay.hpp delete mode 100644 include/app.hpp delete mode 100644 include/cpu.hpp delete mode 100644 include/gpu.hpp rename include/{gpu_metrics.hpp => gpu_metrics.h} (96%) delete mode 100644 include/hass.hpp create mode 100644 include/lcd.h create mode 100644 include/log.h delete mode 100644 include/log.hpp delete mode 100644 include/sys.hpp delete mode 100644 include/utils.hpp delete mode 100644 main.cpp delete mode 100644 src/LCDDisplay.cpp delete mode 100644 src/app.cpp delete mode 100644 src/cpu.cpp delete mode 100644 src/gpu.cpp delete mode 100644 src/hass.cpp create mode 100644 src/lcd.c create mode 100644 src/log.c create mode 100644 src/main.c delete mode 100644 src/sys.cpp delete mode 100644 src/utils.cpp diff --git a/.clang-format b/.clang-format index 222df9c..5ae9bee 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,56 @@ ---- -BasedOnStyle: Google -IndentWidth: 4 -ColumnLimit: 0 \ No newline at end of file +BasedOnStyle: LLVM + +# Indentation (Linux kernel style) +UseTab: Always +IndentWidth: 8 +TabWidth: 8 + +# Keep parameters on one line as much as possible +BinPackParameters: true +BinPackArguments: true + +# Allow long lines (important!) +ColumnLimit: 0 # or set to something large like 120 + +# Prevent breaking after return type / before function name +AlwaysBreakAfterReturnType: None +AlwaysBreakAfterDefinitionReturnType: None + +# Keep function declarations/definitions on one line if possible +PenaltyBreakBeforeFirstCallParameter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 1000000 + +# Braces: K&R style everywhere, INCLUDING functions (your modification) +BreakBeforeBraces: Attach + +# Control specific brace wrapping behavior +BraceWrapping: + AfterFunction: false # <-- key change (same line for functions) + AfterControlStatement: false + AfterStruct: false + AfterEnum: false + AfterUnion: false + AfterClass: false + BeforeElse: false + +# Spaces +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false + +# Pointer alignment (kernel prefers this style) +PointerAlignment: Right + +# Keep simple statements compact +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None + +# For-loop style similar to kernel +AllowShortBlocksOnASingleLine: Never + +# Don't align weirdly +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false + +# Include handling (kernel is manual about includes) +SortIncludes: false \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 81469bd..c93a9d9 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,8 +1,7 @@ - - - \ No newline at end of file diff --git a/.idea/editor.xml b/.idea/editor.xml index e7b96ca..6438eb1 100644 --- a/.idea/editor.xml +++ b/.idea/editor.xml @@ -245,7 +245,6 @@