Skip to content

Commit 4bd3b82

Browse files
committed
actions: Add main-yml action configuration
1 parent d2e636b commit 4bd3b82

File tree

4 files changed

+51
-67
lines changed

4 files changed

+51
-67
lines changed

.github/workflows/main.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
on:
2+
push:
3+
branches:
4+
- develop
5+
- feature/*
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
name: build
11+
runs-on: arm-none-eabi-gcc
12+
steps:
13+
14+
- name: Setup arm-none-eabi-gcc path
15+
run: echo "/opt/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin" >> $GITHUB_PATH
16+
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
set-safe-directory: false
21+
22+
- run: |
23+
git fetch --prune --unshallow --no-recurse-submodules
24+
git branch develop
25+
git branch -u origin/develop develop
26+
git branch master
27+
git branch -u origin/master master
28+
29+
- name: Install python venv & dependencies
30+
run: |
31+
python -m venv venv
32+
source venv/bin/activate
33+
pip install -r requirements.txt
34+
echo PATH=$PATH >> $GITHUB_ENV
35+
echo VIRTUAL_ENV=$VIRTUAL_ENV >> $GITHUB_ENV
36+
37+
- name: Select the port
38+
run: defconfig config/nwdaq_br28_fdc_defconfig
39+
40+
- name: Compile
41+
run: |
42+
mkdir -p lib/libopencm3/src
43+
scons firmware
44+

lib/SConscript

+3-13
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,7 @@ def Git(self, url, dir=env['LIB_DEFAULT_REPO_DIR'], branch=None):
3333
return
3434

3535
print(f'{Fore.BLUE}{Style.BRIGHT}Cloning git repo{Style.RESET_ALL} {url} into {dir}...')
36-
37-
try:
38-
repo = git.Repo.clone_from(url, dir, progress=git_clone_progress(), branch=branch, depth=1)
39-
except:
40-
print(f'..{Fore.RED}{Style.BRIGHT}failed{Style.RESET_ALL}')
41-
return
36+
repo = git.Repo.clone_from(url, dir, progress=git_clone_progress(), branch=branch, depth=1)
4237
stamp('.downloaded.stamp')
4338

4439

@@ -58,12 +53,7 @@ def Patch(self, ppatch, dir=env['LIB_DEFAULT_REPO_DIR']):
5853
abspatch = os.path.abspath(p)
5954
print(f'{Fore.BLUE}{Style.BRIGHT}Patching{Style.RESET_ALL} with {p}...')
6055

61-
try:
62-
r.git.apply([str(abspatch)])
63-
64-
except git.GitCommandError:
65-
print(f'..{Fore.RED}{Style.BRIGHT}failed{Style.RESET_ALL}')
66-
return
56+
r.git.apply([str(abspatch)])
6757

6858
stamp('.patched.stamp')
6959

@@ -78,7 +68,7 @@ def Make(self, target, cwd='.'):
7868

7969
r = subprocess.run(['make', target], cwd=str(cwd), stdout=subprocess.PIPE)
8070
print(r.stdout.decode())
81-
71+
8272
stamp('.compiled.stamp')
8373

8474
env.AddMethod(Make)

lib/libopencm3/add-stm32-g4-rtc-iwdg.patch

+1-53
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,3 @@
1-
diff --git a/include/libopencm3/stm32/g4/iwdg.h b/include/libopencm3/stm32/g4/iwdg.h
2-
new file mode 100644
3-
index 00000000..ce321c16
4-
--- /dev/null
5-
+++ b/include/libopencm3/stm32/g4/iwdg.h
6-
@@ -0,0 +1,33 @@
7-
+/** @defgroup iwdg_defines IWDG Defines
8-
+ *
9-
+ * @ingroup STM32G4xx_defines
10-
+ *
11-
+ * @brief <b>Defined Constants and Types for the STM32G4xx Independent Watchdog Timer</b>
12-
+ *
13-
+ * @version 1.0.0
14-
+ *
15-
+ * LGPL License Terms @ref lgpl_license
16-
+ * */
17-
+/*
18-
+ * This file is part of the libopencm3 project.
19-
+ *
20-
+ * This library is free software: you can redistribute it and/or modify
21-
+ * it under the terms of the GNU Lesser General Public License as published by
22-
+ * the Free Software Foundation, either version 3 of the License, or
23-
+ * (at your option) any later version.
24-
+ *
25-
+ * This library is distributed in the hope that it will be useful,
26-
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27-
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28-
+ * GNU Lesser General Public License for more details.
29-
+ *
30-
+ * You should have received a copy of the GNU Lesser General Public License
31-
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
32-
+ */
33-
+
34-
+#ifndef LIBOPENCM3_IWDG_H
35-
+#define LIBOPENCM3_IWDG_H
36-
+
37-
+#include <libopencm3/stm32/common/iwdg_common_v2.h>
38-
+
39-
+#endif
401
diff --git a/include/libopencm3/stm32/g4/rtc.h b/include/libopencm3/stm32/g4/rtc.h
412
new file mode 100644
423
index 00000000..d631fd90
@@ -79,19 +40,6 @@ index 00000000..d631fd90
7940
+#include <libopencm3/stm32/common/rtc_common_l1f024.h>
8041
+
8142
+#endif
82-
diff --git a/include/libopencm3/stm32/iwdg.h b/include/libopencm3/stm32/iwdg.h
83-
index b94b8741..5572e25f 100644
84-
--- a/include/libopencm3/stm32/iwdg.h
85-
+++ b/include/libopencm3/stm32/iwdg.h
86-
@@ -40,6 +40,8 @@
87-
# include <libopencm3/stm32/l4/iwdg.h>
88-
#elif defined(STM32G0)
89-
# include <libopencm3/stm32/g0/iwdg.h>
90-
+#elif defined(STM32G4)
91-
+# include <libopencm3/stm32/g4/iwdg.h>
92-
#else
93-
# error "stm32 family not defined."
94-
#endif
9543
diff --git a/include/libopencm3/stm32/rtc.h b/include/libopencm3/stm32/rtc.h
9644
index 53118d3c..d4a20e7f 100644
9745
--- a/include/libopencm3/stm32/rtc.h
@@ -113,7 +61,7 @@ index c6924130..836d69c3 100644
11361
OBJS += flash.o flash_common_all.o flash_common_f.o flash_common_idcache.o
11462
OBJS += gpio_common_all.o gpio_common_f0234.o
11563
OBJS += i2c_common_v2.o
116-
+OBJS += iwdg_common_all.o
64+
OBJS += iwdg_common_all.o
11765
OBJS += opamp_common_all.o opamp_common_v2.o
11866
OBJS += pwr.o
11967
OBJS += rcc.o rcc_common_all.o

requirements.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
gitdb==4.0.5
22
GitPython==3.1.14
33
pyaml==20.4.0
4-
PyYAML==5.4.1
4+
PyYAML==6.0.1
55
six==1.15.0
66
smmap==3.0.5
77
kconfiglib==14.1.0
88
protobuf==3.15.3
99
SCons==4.1.0.post1
10+
tqdm==4.57.0
11+
colorama==0.4.4

0 commit comments

Comments
 (0)