Skip to content

Commit

Permalink
actions: Add main-yml action configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
iqyx committed Apr 6, 2024
1 parent d2e636b commit 85650f7
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 73 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
branches:
- develop
- feature/*
workflow_dispatch:

jobs:
build:
name: build
runs-on: arm-none-eabi-gcc
steps:

- name: Setup arm-none-eabi-gcc path
run: echo "/opt/arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-eabi/bin" >> $GITHUB_PATH

- name: Checkout
uses: actions/checkout@v4
with:
set-safe-directory: false

- run: |
git fetch --prune --unshallow --no-recurse-submodules
git branch develop
git branch -u origin/develop develop
git branch master
git branch -u origin/master master
- name: Install python venv & dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
echo PATH=$PATH >> $GITHUB_ENV
echo VIRTUAL_ENV=$VIRTUAL_ENV >> $GITHUB_ENV
- name: Select the port
run: defconfig config/nwdaq_br28_fdc_defconfig

- name: Compile
run: |
scons firmware
16 changes: 3 additions & 13 deletions lib/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ def Git(self, url, dir=env['LIB_DEFAULT_REPO_DIR'], branch=None):
return

print(f'{Fore.BLUE}{Style.BRIGHT}Cloning git repo{Style.RESET_ALL} {url} into {dir}...')

try:
repo = git.Repo.clone_from(url, dir, progress=git_clone_progress(), branch=branch, depth=1)
except:
print(f'..{Fore.RED}{Style.BRIGHT}failed{Style.RESET_ALL}')
return
repo = git.Repo.clone_from(url, dir, progress=git_clone_progress(), branch=branch, depth=1)
stamp('.downloaded.stamp')


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

try:
r.git.apply([str(abspatch)])

except git.GitCommandError:
print(f'..{Fore.RED}{Style.BRIGHT}failed{Style.RESET_ALL}')
return
r.git.apply([str(abspatch)])

stamp('.patched.stamp')

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

r = subprocess.run(['make', target], cwd=str(cwd), stdout=subprocess.PIPE)
print(r.stdout.decode())

stamp('.compiled.stamp')

env.AddMethod(Make)
Expand Down
Empty file removed lib/libopencm3/.downloaded.stamp
Empty file.
Empty file removed lib/libopencm3/.patched.stamp
Empty file.
61 changes: 2 additions & 59 deletions lib/libopencm3/add-stm32-g4-rtc-iwdg.patch
Original file line number Diff line number Diff line change
@@ -1,42 +1,3 @@
diff --git a/include/libopencm3/stm32/g4/iwdg.h b/include/libopencm3/stm32/g4/iwdg.h
new file mode 100644
index 00000000..ce321c16
--- /dev/null
+++ b/include/libopencm3/stm32/g4/iwdg.h
@@ -0,0 +1,33 @@
+/** @defgroup iwdg_defines IWDG Defines
+ *
+ * @ingroup STM32G4xx_defines
+ *
+ * @brief <b>Defined Constants and Types for the STM32G4xx Independent Watchdog Timer</b>
+ *
+ * @version 1.0.0
+ *
+ * LGPL License Terms @ref lgpl_license
+ * */
+/*
+ * This file is part of the libopencm3 project.
+ *
+ * This library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LIBOPENCM3_IWDG_H
+#define LIBOPENCM3_IWDG_H
+
+#include <libopencm3/stm32/common/iwdg_common_v2.h>
+
+#endif
diff --git a/include/libopencm3/stm32/g4/rtc.h b/include/libopencm3/stm32/g4/rtc.h
new file mode 100644
index 00000000..d631fd90
Expand Down Expand Up @@ -79,19 +40,6 @@ index 00000000..d631fd90
+#include <libopencm3/stm32/common/rtc_common_l1f024.h>
+
+#endif
diff --git a/include/libopencm3/stm32/iwdg.h b/include/libopencm3/stm32/iwdg.h
index b94b8741..5572e25f 100644
--- a/include/libopencm3/stm32/iwdg.h
+++ b/include/libopencm3/stm32/iwdg.h
@@ -40,6 +40,8 @@
# include <libopencm3/stm32/l4/iwdg.h>
#elif defined(STM32G0)
# include <libopencm3/stm32/g0/iwdg.h>
+#elif defined(STM32G4)
+# include <libopencm3/stm32/g4/iwdg.h>
#else
# error "stm32 family not defined."
#endif
diff --git a/include/libopencm3/stm32/rtc.h b/include/libopencm3/stm32/rtc.h
index 53118d3c..d4a20e7f 100644
--- a/include/libopencm3/stm32/rtc.h
Expand All @@ -106,15 +54,10 @@ index 53118d3c..d4a20e7f 100644
# error "stm32 family not defined."
#endif
diff --git a/lib/stm32/g4/Makefile b/lib/stm32/g4/Makefile
index c6924130..836d69c3 100644
index 8cf1c4a..1e29807 100644
--- a/lib/stm32/g4/Makefile
+++ b/lib/stm32/g4/Makefile
@@ -46,10 +46,12 @@ OBJS += fdcan.o fdcan_common.o
OBJS += flash.o flash_common_all.o flash_common_f.o flash_common_idcache.o
OBJS += gpio_common_all.o gpio_common_f0234.o
OBJS += i2c_common_v2.o
+OBJS += iwdg_common_all.o
OBJS += opamp_common_all.o opamp_common_v2.o
@@ -52,6 +52,7 @@ OBJS += opamp_common_all.o opamp_common_v2.o
OBJS += pwr.o
OBJS += rcc.o rcc_common_all.o
OBJS += rng_common_v1.o
Expand Down
Empty file removed lib/spiffs/.downloaded.stamp
Empty file.
Empty file removed lib/treecli/.downloaded.stamp
Empty file.
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
gitdb==4.0.5
GitPython==3.1.14
pyaml==20.4.0
PyYAML==5.4.1
PyYAML==6.0.1
six==1.15.0
smmap==3.0.5
kconfiglib==14.1.0
protobuf==3.15.3
SCons==4.1.0.post1
tqdm==4.57.0
colorama==0.4.4

0 comments on commit 85650f7

Please sign in to comment.