aboutsummaryrefslogtreecommitdiff
path: root/nrf528xx
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-11-20 16:53:33 +0100
committerlonkaars <loek@pipeframe.xyz>2022-11-20 16:53:33 +0100
commit87feae8a58bcda71b2e60a9156f678f3c4cec6d7 (patch)
treed0fb3837d45088dc0758eb27b8c575c2e6b2870c /nrf528xx
parent4413a40440a48aa0f79ae4bec0adf3a68408a0e3 (diff)
add clang-tidy and clang-format
Diffstat (limited to 'nrf528xx')
-rw-r--r--nrf528xx/main.c16
-rw-r--r--nrf528xx/makefile10
-rw-r--r--nrf528xx/readme.md2
3 files changed, 20 insertions, 8 deletions
diff --git a/nrf528xx/main.c b/nrf528xx/main.c
index 22777f9..c85a6c1 100644
--- a/nrf528xx/main.c
+++ b/nrf528xx/main.c
@@ -1,13 +1,13 @@
-#include <zephyr/zephyr.h>
#include <zephyr/drivers/gpio.h>
+#include <zephyr/zephyr.h>
-static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
+static const struct gpio_dt_spec CD_LED = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
-void main() {
- gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
+void main() { // NOLINT
+ gpio_pin_configure_dt(&CD_LED, GPIO_OUTPUT_ACTIVE);
- while (1) {
- gpio_pin_toggle_dt(&led);
- k_msleep(500);
- }
+ while (1) {
+ gpio_pin_toggle_dt(&CD_LED);
+ k_msleep(500);
+ }
}
diff --git a/nrf528xx/makefile b/nrf528xx/makefile
new file mode 100644
index 0000000..ab7d624
--- /dev/null
+++ b/nrf528xx/makefile
@@ -0,0 +1,10 @@
+.PHONY: format
+
+SRCS :=
+
+SRCS += $(wildcard *.c)
+SRCS += $(wildcard *.h)
+
+format:
+ clang-format -i $(SRCS)
+ clang-tidy --fix-errors $(SRCS)
diff --git a/nrf528xx/readme.md b/nrf528xx/readme.md
index 3cd3f02..dda17b9 100644
--- a/nrf528xx/readme.md
+++ b/nrf528xx/readme.md
@@ -1,5 +1,7 @@
# nrf528xx subdirectory
+> the makefile in this folder isn't used for building but for auxiliary rules
+
## building
```bash