Skip to content

Commit

Permalink
draft structure
Browse files Browse the repository at this point in the history
  • Loading branch information
irvingywang committed Aug 22, 2024
0 parents commit daf7770
Show file tree
Hide file tree
Showing 51 changed files with 2,816 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build Project
on:
push:
paths:
- "src/**"
- "lib/**"
pull_request:
paths:
- "src/**"
- "lib/**"

jobs:
build:
name: Build
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: "recursive" # Ensure submodules are checked out

- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
update: true
install: mingw-w64-x86_64-arm-none-eabi-gcc make

- name: Build project
run: |
make -j24 V=1
shell: msys2 {0}
31 changes: 31 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"configurations": [
{
"name": "Default",
"includePath": [
"${workspaceFolder}${/}**",
"${workspaceFolder}${/}lib${/}typec-board-base${/}Core${/}Inc",
"${workspaceFolder}${/}lib${/}typec-board-base${/}Drivers${/}STM32F4xx_HAL_Driver${/}Inc",
"${workspaceFolder}${/}lib${/}typec-board-base${/}Drivers${/}STM32F4xx_HAL_Driver${/}Inc${/}Legacy",
"${workspaceFolder}${/}lib${/}typec-board-base${/}Middlewares${/}Third_Party${/}FreeRTOS${/}Source${/}include",
"${workspaceFolder}${/}lib${/}typec-board-base${/}Middlewares${/}Third_Party${/}FreeRTOS${/}Source${/}CMSIS_RTOS",
"${workspaceFolder}${/}lib${/}typec-board-base${/}Middlewares${/}Third_Party${/}FreeRTOS${/}Source${/}portable${/}RVDS${/}ARM_CM4F",
"${workspaceFolder}${/}lib${/}typec-board-base${/}Drivers${/}CMSIS${/}Device${/}ST${/}STM32F4xx${/}Include",
"${workspaceFolder}${/}lib${/}typec-board-base${/}Drivers${/}CMSIS${/}Include",
"${workspaceFolder}${/}lib${/}CMSIS-DSP${/}Include",
"${workspaceFolder}${/}src${/}devices${/}inc",
"${workspaceFolder}${/}src${/}algo${/}inc",
"${workspaceFolder}${/}src${/}bsp${/}inc",
"${workspaceFolder}${/}src${/}app${/}inc"
],
"defines": [
"USE_HAL_DRIVER",
"STM32F407xx"
],
"macFrameworkPath": [
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
]
}
],
"version": 4
}
43 changes: 43 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "CMSIS-DAP",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}${/}build${/}control-base.elf",
"request": "launch",
"type": "cortex-debug",
"svdFile": "STM32F407.svd",
"servertype": "openocd", //GDB server
"configFiles": [
"${workspaceRoot}${/}config${/}openocd_cmsis_dap.cfg" // config
],
//"runToEntryPoint": "main", // stop at main
"rtos": "FreeRTOS",
"liveWatch": {
"enabled": true,
"samplesPerSecond": 4
},
"preLaunchTask": "build" // build before debug
},
{
"name": "ST-LINK",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}${/}build${/}control-base.elf",
"request": "launch",
"type": "cortex-debug",
"svdFile": "STM32F407.svd",
"servertype": "openocd", //GDB server
"configFiles": [
"${workspaceRoot}${/}config${/}openocd_stlink.cfg" // config
],
//"runToEntryPoint": "main", // stop at main
"rtos": "FreeRTOS",
"liveWatch": {
"enabled": true,
"samplesPerSecond": 4
},
"preLaunchTask": "build" // build before debug
}
]
}
81 changes: 81 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"osx": {
"command": "make -j V=1"
},
"linux": {
"command": "make -j V=1"
},
"windows": {
"command": "mingw32-make -j V=1"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"fileLocation": "absolute",
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "clean",
"type": "shell",
"osx": {
"command": "git submodule update; make clean_unix"
},
"linux": {
"command": "git submodule update; make clean_unix"
},
"windows": {
"command": "git submodule update; mingw32-make clean"
},
"problemMatcher": []
},
{
"label": "flash",
"type": "shell",
"osx": {
"command": "make download"
},
"linux": {
"command": "make download"
},
"windows": {
"command": "mingw32-make download_powershell"
},
"problemMatcher": []
},
{
"label": "build and flash",
"type": "shell",
"dependsOn": [
"build",
"flash"
],
"dependsOrder": "sequence",
"problemMatcher": []
},
{
"label": "rebuild",
"type": "shell",
"dependsOn": [
"clean",
"build"
],
"dependsOrder": "sequence",
"problemMatcher": []
}
]
}
Loading

0 comments on commit daf7770

Please sign in to comment.