Skip to content

Commit d64f4ef

Browse files
committed
[board] Merge split descriptions
1 parent b18385c commit d64f4ef

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

repo.lb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def init(repo):
230230
if (module.parent / "module.md").exists():
231231
description = FileReader(str(module.parent / "module.md"))
232232
else:
233-
description = re.search(r'\.description += +(""".*?"""|".*?")',
233+
description = re.search(r'description += +(""".*?"""|".*?")',
234234
module_text, flags=re.S|re.M)
235235
description = description.group(1).strip('"\\') if description else None
236236
versions = re.search(r"#+ +[Rr]evisions? += +\[(.*)\]", module_text)

src/modm/board/black_pill_f103/module.lb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
1212
# -----------------------------------------------------------------------------
1313

14-
def init(module):
15-
module.name = ":board:black-pill-f103"
16-
module.description = """\
14+
description = """
1715
# Black Pill
1816
1917
STM32F103C8T6 "Black Pill" Minimum System Development Board
@@ -22,9 +20,7 @@ Cheap and bread-board-friendly board for STM32 F1 series.
2220
Sold for less than 2 USD on well known Internet shops from China.
2321
2422
https://stm32-base.org/boards/STM32F103C8T6-Black-Pill.html
25-
""" + descr_programming
2623
27-
descr_programming = """
2824
## Programming
2925
3026
Since the board doesn't have a programmer on-board, you need to use your
@@ -54,6 +50,10 @@ Then include this file in your build options like so:
5450
```
5551
"""
5652

53+
def init(module):
54+
module.name = ":board:black-pill-f103"
55+
module.description = description
56+
5757
def prepare(module, options):
5858
if not options[":target"].partname.startswith("stm32f103c8t"):
5959
return False
@@ -81,4 +81,4 @@ def build(env):
8181

8282
# Warn the user if they forgot to set a custom openocd config
8383
if env.has_option(":build:openocd.cfg") and not len(env.get(":build:openocd.cfg", "")):
84-
env.log.warning("You need to provide the programmer via a custom OpenOCD config!\n" + descr_programming)
84+
env.log.warning("You need to provide the programmer via a custom OpenOCD config!\n" + description)

src/modm/board/blue_pill_f103/module.lb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
1212
# -----------------------------------------------------------------------------
1313

14-
def init(module):
15-
module.name = ":board:blue-pill-f103"
16-
module.description = """\
14+
description = """
1715
# Blue Pill
1816
1917
STM32F103C8T6 "Blue Pill" Minimum System Development Board
@@ -22,9 +20,7 @@ Cheap and bread-board-friendly board for STM32 F1 series.
2220
Sold for less than 2 USD on well known Internet shops from China.
2321
2422
https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill.html
25-
""" + descr_programming
2623
27-
descr_programming = """
2824
## Programming
2925
3026
Since the board doesn't have a programmer on-board, you need to use your
@@ -54,6 +50,10 @@ Then include this file in your build options like so:
5450
```
5551
"""
5652

53+
def init(module):
54+
module.name = ":board:blue-pill-f103"
55+
module.description = description
56+
5757
def prepare(module, options):
5858
if not options[":target"].partname.startswith("stm32f103c8t"):
5959
return False
@@ -81,4 +81,4 @@ def build(env):
8181

8282
# Warn the user if they forgot to set a custom openocd config
8383
if env.has_option(":build:openocd.cfg") and not len(env.get(":build:openocd.cfg", "")):
84-
env.log.warning("You need to provide the programmer via a custom OpenOCD config!\n" + descr_programming)
84+
env.log.warning("You need to provide the programmer via a custom OpenOCD config!\n" + description)

src/modm/board/devebox_stm32h750vb/module.lb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
1111
# -----------------------------------------------------------------------------
1212

13-
def init(module):
14-
module.name = ":board:devebox-stm32h750vb"
15-
module.description = """\
13+
description = """
1614
# STM32F750VB mcudev DevEBox
1715
1816
[STM32F750VB mcudev DevEBox H7xx](https://github.com/mcauser/MCUDEV_DEVEBOX_H7XX_M)
@@ -34,9 +32,7 @@ target option in your `project.xml`:
3432
</options>
3533
</library>
3634
```
37-
""" + descr_programming
3835
39-
descr_programming = """
4036
## Programming
4137
4238
Since the board doesn't have a programmer on-board, you need to use your
@@ -66,6 +62,10 @@ Then include this file in your build options like so:
6662
```
6763
"""
6864

65+
def init(module):
66+
module.name = ":board:devebox-stm32h750vb"
67+
module.description = description
68+
6969
def prepare(module, options):
7070
if not options[":target"].partname.startswith("stm32h750vbt"):
7171
return False
@@ -95,4 +95,4 @@ def build(env):
9595

9696
# Warn the user if they forgot to set a custom openocd config
9797
if env.has_option(":build:openocd.cfg") and not len(env.get(":build:openocd.cfg", "")):
98-
env.log.warning("You need to provide the programmer via a custom OpenOCD config!\n" + descr_programming)
98+
env.log.warning("You need to provide the programmer via a custom OpenOCD config!\n" + description)

src/modm/board/stm32f030f4p6_demo/module.lb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
1212
# -----------------------------------------------------------------------------
1313

14-
def init(module):
15-
module.name = ":board:stm32f030_demo"
16-
module.description = """\
14+
description = """
1715
# STM32F030 Demo Board
1816
1917
STM32F030F4P6 Minimum System Development Board.
@@ -22,9 +20,7 @@ Cheap and bread-board-friendly board for STM32 F0 series.
2220
Sold for less than 1.5 USD on well known Internet shops from China.
2321
2422
https://stm32-base.org/boards/STM32F030F4P6-STM32F030-DEMO-BOARD-V1.1
25-
""" + descr_programming
2623
27-
descr_programming = """
2824
## Programming
2925
3026
Since the board doesn't have a programmer on-board, you need to use your
@@ -51,6 +47,10 @@ Then include this file in your build options like so:
5147
```
5248
"""
5349

50+
def init(module):
51+
module.name = ":board:stm32f030_demo"
52+
module.description = description
53+
5454
def prepare(module, options):
5555
if not options[":target"].partname.startswith("stm32f030f4p"):
5656
return False
@@ -78,4 +78,4 @@ def build(env):
7878

7979
# Warn the user if they forgot to set a custom openocd config
8080
if env.has_option(":build:openocd.cfg") and not len(env.get(":build:openocd.cfg", "")):
81-
env.log.warning("You need to provide the programmer via a custom OpenOCD config!\n" + descr_programming)
81+
env.log.warning("You need to provide the programmer via a custom OpenOCD config!\n" + description)

0 commit comments

Comments
 (0)