Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc/porting-boards.md: fix code snippets in md view #19206

Merged
merged 1 commit into from
Jan 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 24 additions & 25 deletions doc/doxygen/src/porting-boards.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ The documentation must be under the proper doxygen group, you can compile the
documentation by calling `make doc` and then open the generated html file on
any browser.

@code
```c
/**
@defgroup boards_foo FooBoard
@ingroup boards
Expand All @@ -241,7 +241,7 @@ any browser.
...

*/
@endcode
```

# Helper tools

Expand Down Expand Up @@ -279,29 +279,28 @@ To avoid code duplication, common code across boards has been grouped in
In the case of source files this means some functions like `board_init` can be
already defined in the common code. Unless having specific configurations or
initialization you might not need a `board.c` or `board.h`. Another common use
case is common peripheral configurations:

@code
-\#include "cfg_timer_tim5.h"
+/**
+ * @name Timer configuration
+ * @{
+ */
+static const timer_conf_t timer_config[] = {
+ {
+ .dev = TIM5,
+ .max = 0xffffffff,
+ .rcc_mask = RCC_APB1ENR_TIM5EN,
+ .bus = APB1,
+ .irqn = TIM5_IRQn
+ }
+};
+
+#define TIMER_0_ISR isr_tim5
+
+#define TIMER_NUMOF ARRAY_SIZE(timer_config)
+/** @} */
@endcode
case is common peripheral configurations, for example in the `cfg_timer_tim5.h`:

```c
/**
* @name Timer configuration
* @{
*/
static const timer_conf_t timer_config[] = {
{
.dev = TIM5,
.max = 0xffffffff,
.rcc_mask = RCC_APB1ENR_TIM5EN,
.bus = APB1,
.irqn = TIM5_IRQn
}
};

#define TIMER_0_ISR isr_tim5

#define TIMER_NUMOF ARRAY_SIZE(timer_config)
/** @} */
```

If you want to use common makefiles, include them at the end of the specific
`Makefile`, e.g. for a `Makefile.features`:
Expand Down