-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
66 changed files
with
2,311 additions
and
743 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,6 +115,16 @@ jobs: | |
os: [macos-latest, windows-latest, ubuntu-latest] | ||
build-type: [Debug, Release] | ||
shared: [Shared, Static] | ||
platform: [x64] | ||
include: | ||
- platform: Win32 | ||
os: windows-latest | ||
shared: Shared | ||
build-type: Debug | ||
- platform: Win32 | ||
os: windows-latest | ||
shared: Shared | ||
build-type: Release | ||
steps: | ||
- name: Cache .hunter folder | ||
if: matrix.os != 'windows-latest' | ||
|
@@ -153,8 +163,13 @@ jobs: | |
echo "C:\tools\opencv\build\x64\vc15\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
- name: Configure ${{ matrix.build-type }}, ${{ matrix.shared }} | ||
if: matrix.shared == 'Shared' | ||
if: matrix.shared == 'Shared' && matrix.platform != 'Win32' | ||
run: cmake -S . -B build -D BUILD_SHARED_LIBS=ON -D CMAKE_BUILD_TYPE=${{ matrix.build-type }} -D CMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/depthai_install | ||
|
||
- name: Configure ${{ matrix.build-type }}, ${{ matrix.shared }}, Win32 | ||
if: matrix.shared == 'Shared' && matrix.platform == 'Win32' | ||
run: cmake -A Win32 -S . -B build -D BUILD_SHARED_LIBS=ON -D CMAKE_BUILD_TYPE=${{ matrix.build-type }} -D CMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/depthai_install | ||
|
||
- name: Configure ${{ matrix.build-type }}, ${{ matrix.shared }} | ||
if: matrix.shared == 'Static' | ||
run: cmake -S . -B build -D BUILD_SHARED_LIBS=OFF -D CMAKE_BUILD_TYPE=${{ matrix.build-type }} -D CMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/depthai_install | ||
|
@@ -166,6 +181,20 @@ jobs: | |
- name: Build and install | ||
run: cmake --build build --config ${{ matrix.build-type }} --target install --parallel 8 | ||
|
||
- name: Upload Win64 shared library | ||
if: matrix.os == 'windows-latest' && matrix.shared == 'Shared' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: windows-prebuilt-win64 | ||
path: ${{ env.GITHUB_WORKSPACE }}/depthai_install/ | ||
|
||
- name: Upload Win32 shared library | ||
if: matrix.os == 'windows-latest' && matrix.shared == 'Shared' && matrix.platform == 'Win32' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: windows-prebuilt-win32-no-opencv | ||
path: ${{ env.GITHUB_WORKSPACE }}/depthai_install/ | ||
|
||
- name: Build and test add_subdirectory | ||
run: | | ||
cmake -S tests/integration/ -B tests/integration/build_add_subdirectory -D TEST_FIND_PACKAGE=OFF | ||
|
@@ -214,10 +243,24 @@ jobs: | |
- name: Install dependencies | ||
run: python3.8 -m pip install git-archive-all | ||
|
||
- name: Download Win64 artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: 'windows-prebuilt-win64' | ||
path: depthai-core-${{ steps.tag.outputs.version }}-win64 | ||
|
||
- name: Download Win32 artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: 'windows-prebuilt-win32-no-opencv' | ||
path: depthai-core-${{ steps.tag.outputs.version }}-win32-no-opencv | ||
|
||
- name: Create release assets | ||
run: | | ||
git-archive-all depthai-core-${{ steps.tag.outputs.version }}.tar.gz | ||
git-archive-all depthai-core-${{ steps.tag.outputs.version }}.zip | ||
zip -r depthai-core-${{ steps.tag.outputs.version }}-win64.zip depthai-core-${{ steps.tag.outputs.version }}-win64 | ||
zip -r depthai-core-${{ steps.tag.outputs.version }}-win32-no-opencv.zip depthai-core-${{ steps.tag.outputs.version }}-win32-no-opencv | ||
# Create GitHub release | ||
- uses: actions/create-release@master | ||
|
@@ -257,3 +300,23 @@ jobs: | |
asset_path: ${{ github.workspace }}/depthai-core-${{ steps.tag.outputs.version }}.tar.gz | ||
asset_name: depthai-core-${{ steps.tag.outputs.version }}.tar.gz | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Win64 package (zip) | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.createRelease.outputs.upload_url }} | ||
asset_path: ${{ github.workspace }}/depthai-core-${{ steps.tag.outputs.version }}-win64.zip | ||
asset_name: depthai-core-${{ steps.tag.outputs.version }}-win64.zip | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Win32 package (zip) | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.createRelease.outputs.upload_url }} | ||
asset_path: ${{ github.workspace }}/depthai-core-${{ steps.tag.outputs.version }}-win32-no-opencv.zip | ||
asset_name: depthai-core-${{ steps.tag.outputs.version }}-win32-no-opencv.zip | ||
asset_content_type: application/octet-stream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Maturity level "snapshot" / "release" | ||
set(DEPTHAI_BOOTLOADER_MATURITY "release") | ||
#set(DEPTHAI_BOOTLOADER_MATURITY "snapshot") | ||
|
||
# "version if applicable" | ||
set(DEPTHAI_BOOTLOADER_VERSION "0.0.12") | ||
set(DEPTHAI_BOOTLOADER_VERSION "0.0.15") | ||
#set(DEPTHAI_BOOTLOADER_VERSION "870bec4ca0ef026ddb9c490a38dfe9d097614554") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#include "depthai/depthai.hpp" | ||
|
||
int main(int argc, char** argv) { | ||
// Options | ||
bool usage = false, read = true, clear = false; | ||
std::string path = ""; | ||
if(argc >= 2) { | ||
std::string op = argv[1]; | ||
if(op == "read") { | ||
read = true; | ||
} else if(op == "flash") { | ||
read = false; | ||
if(argc >= 3) { | ||
path = argv[2]; | ||
} | ||
} else if(op == "clear") { | ||
clear = true; | ||
read = false; | ||
} else if(op == "clear") { | ||
clear = true; | ||
read = false; | ||
} else { | ||
usage = true; | ||
} | ||
} else { | ||
usage = true; | ||
} | ||
if(usage) { | ||
std::cout << "Usage: " << argv[0] << " [read/flash/clear] [flash: path/to/config/json]" << std::endl; | ||
return -1; | ||
} | ||
|
||
// DeviceBootloader configuration | ||
bool res = false; | ||
dai::DeviceInfo info; | ||
std::tie(res, info) = dai::DeviceBootloader::getFirstAvailableDevice(); | ||
|
||
if(res) { | ||
std::cout << "Found device with name: " << info.desc.name << std::endl; | ||
dai::DeviceBootloader bl(info); | ||
|
||
if(read) { | ||
std::cout << "Current flashed configuration\n" << bl.readConfigData().dump(4) << std::endl; | ||
} else { | ||
bool success; | ||
std::string error; | ||
if(clear) { | ||
std::tie(success, error) = bl.flashConfigClear(); | ||
} else { | ||
if(path.empty()) { | ||
std::tie(success, error) = bl.flashConfig(dai::DeviceBootloader::Config{}); | ||
} else { | ||
std::tie(success, error) = bl.flashConfigFile(path); | ||
} | ||
} | ||
if(success) { | ||
std::cout << "Successfully flashed bootloader configuration\n"; | ||
} else { | ||
std::cout << "Error flashing bootloader configuration: " << error; | ||
} | ||
} | ||
|
||
} else { | ||
std::cout << "No devices found" << std::endl; | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.