summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-04-25 13:45:01 +0200
committerlonkaars <loek@pipeframe.xyz>2022-04-25 13:45:01 +0200
commit64df55e0b65d74e37987333a33a53ae98378bed2 (patch)
treed1f3c7b7b1820688fe820a9a0e868c5fe7dbbf52
parent559736432356e2bb4ce805e60c32353a5582a568 (diff)
code style update + make format works now
-rw-r--r--.clang-format2
-rw-r--r--main.c3
-rw-r--r--makefile3
3 files changed, 4 insertions, 4 deletions
diff --git a/.clang-format b/.clang-format
index ee35ba8..03e38c9 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,7 +1,7 @@
---
AccessModifierOffset: 0
BasedOnStyle: LLVM
-BreakBeforeBraces: Linux
+BreakBeforeBraces: Attach
ColumnLimit: 100
IndentWidth: '4'
Language: Cpp
diff --git a/main.c b/main.c
index 1dae142..dfc8d68 100644
--- a/main.c
+++ b/main.c
@@ -4,7 +4,7 @@ int main() {
print("Hello!");
play("L16 ceg>c");
- while(1) {
+ while (1) {
red_led(0);
green_led(1);
@@ -18,4 +18,3 @@ int main() {
return 0;
}
-
diff --git a/makefile b/makefile
index 0f00eaf..01b7bb4 100644
--- a/makefile
+++ b/makefile
@@ -11,6 +11,7 @@ LDFLAGS=-Wl,-gc-sections -lpololu_$(DEVICE) -Wl,-relax
PORT ?= /dev/ttyACM0
SOURCES := $(wildcard *.c)
+HEADERS := $(wildcard *.h)
OBJECTS := $(patsubst %.c,%.o, $(SOURCES))
AVRDUDE=avrdude
@@ -35,7 +36,7 @@ flash: out.hex
$(AVRDUDE) -p $(AVRDUDE_DEVICE) -c avrisp2 -P $(PORT) -U flash:w:out.hex
format:
- find . -name '*.c' -o -name '*.h' | clang-format -i
+ clang-format -i $(SOURCES) $(HEADERS)
compile_commands: clean
bear -- make