diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12d33410..312e9d03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,9 +4,9 @@ name: CI # events but only for the master branch on: push: - branches: [ master,dev/develop,dev/coroutine,dev/build_ci_speedup] + branches: [ master,dev/develop,dev/migration_gcc_desktop_build] pull_request: - branches: [ master,dev/develop,dev/coroutine] + branches: [ master,dev/develop] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -14,7 +14,8 @@ jobs: build-windows-simulator: # The type of runner that the job will run on runs-on: windows-latest - + env: + buildDir: '${{ github.workspace }}\build' # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -33,11 +34,6 @@ jobs: packages: | conan - - name: Download libraries from Conan - run: | - mkdir ${{ runner.workspace }}/build/vsfirmwarebuild/Debug - conan install ${{ github.workspace }}/Firmware/conanfile.txt --install-folder ${{ runner.workspace }}/build/vsfirmwarebuild/ - #Install the latest cmake - name : Get the latest CMake version uses: lukka/get-cmake@latest @@ -50,11 +46,11 @@ jobs: cmakeListsTxtPath: ${{ github.workspace }}/Firmware/CMakeLists.txt cmakeBuildType: Debug cmakeAppendedArgs: '-DPACKAGE_TESTS=ON -DTARGET_PLATFORM:STRING="FIRMWARE_SIMULATOR" -DCMAKE_BUILD_TYPE:STRING=Release' - buildDirectory: '${{ runner.workspace }}/build/vsfirmwarebuild' + buildDirectory: ${{ env.buildDir }} buildWithCMake: true - name : Run firmware testing run: | - cd ${{ runner.workspace }}/build/vsfirmwarebuild/bin + cd ${{ env.buildDir }}\Debug .\FirmwareTesting.exe build-arm: @@ -132,3 +128,54 @@ jobs: # run: | # echo Add other actions to build, # echo test, and deploy your project. + build-linux-desktop-simulator: + runs-on: ubuntu-latest + env: + buildDir: '${{ github.workspace }}/build' + steps: + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + with: + submodules: 'true' + + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: Install conan + uses: BSFishy/pip-action@v1 + with: + packages: | + conan + + - name: Intall system required packages + run: | + sudo apt-get update + sudo apt-get install -y libegl-dev + #Install the latest cmake + - name : Get the latest CMake version + uses: lukka/get-cmake@latest + + - name: Set up GCC 11 + uses: egor-tensin/setup-gcc@v1 + with: + version: 11 + platform: x64 + + - name: Run CMakeLists generation for GCC compiler + uses: lukka/run-cmake@v2 + with: + cmakeGenerator: Unix Makefiles + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeListsTxtPath: ${{ github.workspace }}/Firmware/CMakeLists.txt + cmakeBuildType: Debug + cmakeAppendedArgs : '-DTARGET_PLATFORM:STRING="FIRMWARE_SIMULATOR" -DCMAKE_BUILD_TYPE:STRING=Debug -DREDUCE_LVGL_BINARY_SIZE=OFF -DPACKAGE_TESTS=ON -DENABLE_SANITIZE_BUILD=ON' + buildDirectory: ${{ env.buildDir }} + buildWithCMake: true + + - name : Run firmware testing + run: | + cd ${{ env.buildDir }} + ./FirmwareTesting \ No newline at end of file diff --git a/Firmware/CMakeLists.txt b/Firmware/CMakeLists.txt index e0c1390b..f13f32f6 100644 --- a/Firmware/CMakeLists.txt +++ b/Firmware/CMakeLists.txt @@ -95,6 +95,12 @@ target_compile_features( cxx_std_20 ) +target_compile_options( + ${NORDIC_TARGET} + PRIVATE + $<$:-fcoroutines> +) + if( ${TARGET_PLATFORM} STREQUAL "ARM_CORTEX" ) target_link_libraries( ${NORDIC_TARGET} PRIVATE diff --git a/Firmware/drivers/board/CMakeLists.txt b/Firmware/drivers/board/CMakeLists.txt index d234a0b0..2194ea33 100644 --- a/Firmware/drivers/board/CMakeLists.txt +++ b/Firmware/drivers/board/CMakeLists.txt @@ -43,10 +43,12 @@ if( ${TARGET_PLATFORM} STREQUAL "ARM_CORTEX" ) PUBLIC USE_DEVICE_SPECIFIC ) - target_compile_options( - watchboard - PRIVATE - -fcoroutines - ) elseif( ${TARGET_PLATFORM} STREQUAL "FIRMWARE_SIMULATOR") endif() + + +target_compile_options( + watchboard + PRIVATE + $<$:-fcoroutines> +) diff --git a/Firmware/drivers/board/inc/board/hardware_usings.hpp b/Firmware/drivers/board/inc/board/hardware_usings.hpp index 107a2a08..4b92cf1f 100644 --- a/Firmware/drivers/board/inc/board/hardware_usings.hpp +++ b/Firmware/drivers/board/inc/board/hardware_usings.hpp @@ -23,8 +23,10 @@ using TFlashDriver = ExternalFlash::WinbondFlashDriver< #else using BoardTimer = Buttons::NordicTimerBackend; using ButtonsBackend = Buttons::NordicButtonsBackend; -using TFlashDriver = ExternalFlash::WinbondFlashDriver>>; +using TFlashDriver = ExternalFlash::WinbondFlashDriver< + Interface::SpiTemplated::SpiBus>>; #endif using ButtonsDriver = Buttons::ButtonsDriverTemplate; diff --git a/Firmware/drivers/buttons/bt_firmware_simulator_hardware_buttons_manual_backend.cpp b/Firmware/drivers/buttons/bt_firmware_simulator_hardware_buttons_manual_backend.cpp index d66a50c2..50d345b8 100644 --- a/Firmware/drivers/buttons/bt_firmware_simulator_hardware_buttons_manual_backend.cpp +++ b/Firmware/drivers/buttons/bt_firmware_simulator_hardware_buttons_manual_backend.cpp @@ -1,3 +1,4 @@ + #include "inc/buttons/bt_firmware_simulator_hardware_buttons_manual_backend.hpp" #include @@ -10,6 +11,7 @@ namespace Buttons { + FirmwareSimulatorTimerBackend::FirmwareSimulatorTimerBackend() : m_isTimerEllapsed{true} { } diff --git a/Firmware/drivers/buttons/bt_os_stub_hardware_buttons_backend.cpp b/Firmware/drivers/buttons/bt_os_stub_hardware_buttons_backend.cpp new file mode 100644 index 00000000..1708e4fd --- /dev/null +++ b/Firmware/drivers/buttons/bt_os_stub_hardware_buttons_backend.cpp @@ -0,0 +1,38 @@ +#include "inc/buttons/bt_os_hardware_buttons_manual_backend.hpp" + +#include "utils/CallbackConnector.hpp" +#include "utils/MetaUtils.hpp" + +namespace Buttons +{ + +OsTimerBackend::OsTimerBackend() : m_isTimerEllapsed{true} +{ +} + +void OsTimerBackend::startTimer() +{ +} + +void OsTimerBackend::stopTimer() +{ +} + +void OsTimerBackend::initialize() +{ +} + +bool OsTimerBackend::isTimerEllapsed() const +{ + return m_isTimerEllapsed; +} + +OsButtonsBackend::OsButtonsBackend() +{ +} + +void OsButtonsBackend::initialize() +{ +} + +} // namespace Buttons diff --git a/Firmware/drivers/buttons/inc/buttons/bt_firmware_simulator_hardware_buttons_manual_backend.hpp b/Firmware/drivers/buttons/inc/buttons/bt_firmware_simulator_hardware_buttons_manual_backend.hpp index 6baaa6c5..e4ce5018 100644 --- a/Firmware/drivers/buttons/inc/buttons/bt_firmware_simulator_hardware_buttons_manual_backend.hpp +++ b/Firmware/drivers/buttons/inc/buttons/bt_firmware_simulator_hardware_buttons_manual_backend.hpp @@ -6,7 +6,6 @@ namespace Buttons { - class FirmwareSimulatorTimerBackend { @@ -42,7 +41,6 @@ class FirmwareSimulatorButtonsBackend public: void initialize(); - private: void initInternals(); }; diff --git a/Firmware/drivers/spi/CMakeLists.txt b/Firmware/drivers/spi/CMakeLists.txt index 213db49b..95c422ca 100644 --- a/Firmware/drivers/spi/CMakeLists.txt +++ b/Firmware/drivers/spi/CMakeLists.txt @@ -6,13 +6,13 @@ add_library( if( ${TARGET_PLATFORM} STREQUAL "ARM_CORTEX" ) target_link_libraries( spi INTERFACE NordicSDK::Common ) - target_compile_options( - spi - INTERFACE - -fcoroutines - ) endif() +target_compile_options( + spi + INTERFACE + $<$:-fcoroutines> +) target_include_directories( spi diff --git a/Firmware/utils/CMakeLists.txt b/Firmware/utils/CMakeLists.txt index 864c8926..fb776297 100644 --- a/Firmware/utils/CMakeLists.txt +++ b/Firmware/utils/CMakeLists.txt @@ -36,3 +36,8 @@ target_link_libraries( etl logger_service ) +target_compile_options( + UtilsLibrary + INTERFACE + $<$:-fcoroutines> +)