aboutsummaryrefslogtreecommitdiffstats
path: root/docs/drivers/ws2812.md
diff options
context:
space:
mode:
authorRyan2024-11-14 19:00:02 +0100
committerGitHub2024-11-14 19:00:02 +0100
commit46236ce3de8385f27e3f13a9921abee7e1e0fa57 (patch)
tree0d5dfc4c40f2b590de0d493324a308d488bda02a /docs/drivers/ws2812.md
parenta8a47c40114c72a042516c1f93384f228685eb3e (diff)
[docs] Improve halconf/mcuconf code examples (#24597)
Diffstat (limited to 'docs/drivers/ws2812.md')
-rw-r--r--docs/drivers/ws2812.md44
1 files changed, 30 insertions, 14 deletions
diff --git a/docs/drivers/ws2812.md b/docs/drivers/ws2812.md
index 61addf1917..88c096794f 100644
--- a/docs/drivers/ws2812.md
+++ b/docs/drivers/ws2812.md
@@ -160,15 +160,23 @@ To configure the DI pin for open drain configuration, add the following to your
Depending on the ChibiOS board configuration, you may need to enable SPI at the keyboard level. For STM32, this would look like:
-`halconf.h`:
-```c
-#define HAL_USE_SPI TRUE
+::: code-group
+```c [halconf.h]
+#pragma once
+
+#define HAL_USE_SPI TRUE // [!code focus]
+
+#include_next <halconf.h>
```
-`mcuconf.h`:
-```c
-#undef STM32_SPI_USE_SPI1
-#define STM32_SPI_USE_SPI1 TRUE
+```c [mcuconf.h]
+#pragma once
+
+#include_next <mcuconf.h>
+
+#undef STM32_SPI_USE_SPI1 // [!code focus]
+#define STM32_SPI_USE_SPI1 TRUE // [!code focus]
```
+:::
The following `define`s apply only to the `spi` driver:
@@ -213,15 +221,23 @@ The following `#define`s apply only to the PIO driver:
Depending on the ChibiOS board configuration, you may need to enable PWM at the keyboard level. For STM32, this would look like:
-`halconf.h`:
-```c
-#define HAL_USE_PWM TRUE
+::: code-group
+```c [halconf.h]
+#pragma once
+
+#define HAL_USE_PWM TRUE // [!code focus]
+
+#include_next <halconf.h>
```
-`mcuconf.h`:
-```c
-#undef STM32_PWM_USE_TIM2
-#define STM32_PWM_USE_TIM2 TRUE
+```c [mcuconf.h]
+#pragma once
+
+#include_next <mcuconf.h>
+
+#undef STM32_PWM_USE_TIM2 // [!code focus]
+#define STM32_PWM_USE_TIM2 TRUE // [!code focus]
```
+:::
The following `#define`s apply only to the `pwm` driver: