Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,15 @@ jobs:
python-version: '3.8'

- name: Install conan
uses: BSFishy/pip-action@v1
with:
packages: |
conan
run: pip install "conan<2.0" pytest && conan --version

#Install the latest cmake
- name : Get the latest CMake version
uses: lukka/get-cmake@latest

- name: Run build for MSVC compiler
run: |
cmake -G"Visual Studio 16 2019" -Ax64 -S"${{ github.workspace }}/Firmware/" -B"${{ env.buildDir }}" -DPACKAGE_TESTS=ON -DTARGET_PLATFORM:STRING="FIRMWARE_SIMULATOR" -DCMAKE_BUILD_TYPE=Release
cmake -G"Visual Studio 17 2022" -Ax64 -S"${{ github.workspace }}/Firmware/" -B"${{ env.buildDir }}" -DPACKAGE_TESTS=ON -DTARGET_PLATFORM:STRING="FIRMWARE_SIMULATOR" -DCMAKE_BUILD_TYPE=Release
cd ${{ env.buildDir }}
cmake --build . --config Release
- name : Run firmware testing
Expand Down Expand Up @@ -140,10 +137,7 @@ jobs:
python-version: '3.8'

- name: Install conan
uses: BSFishy/pip-action@v1
with:
packages: |
conan
run: pip install "conan<2.0" pytest && conan --version

- name: Intall system required packages
run: |
Expand Down
9 changes: 4 additions & 5 deletions Firmware/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ if( ${TARGET_PLATFORM} STREQUAL "ARM_CORTEX" )

elseif(${TARGET_PLATFORM} STREQUAL "FIRMWARE_SIMULATOR")
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.16.1/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake"
EXPECTED_HASH SHA256=396e16d0f5eabdc6a14afddbcfff62a54a7ee75c6da23f32f7a31bc85db23484
TLS_VERIFY ON)
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake"
TLS_VERIFY ON)
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
Expand Down
6 changes: 3 additions & 3 deletions Firmware/drivers/board/watchboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ APP_TIMER_DEF(m_ledDriverTimer);
#include "delay/delay_provider.hpp"
#include "logger/logger_service.hpp"

#if defined (USE_DEVICE_SPECIFIC)
#if defined(USE_DEVICE_SPECIFIC)
#define FMT_HEADER_ONLY
#endif

Expand All @@ -32,7 +32,7 @@ namespace
{
static void TimerExpiredCallback(void* _pExpiredContext) noexcept
{
std::coroutine_handle<>::from_address(_pExpiredContext).resume();
stdcoro::coroutine_handle<>::from_address(_pExpiredContext).resume();
}
} // namespace

Expand Down Expand Up @@ -65,7 +65,7 @@ auto operator co_await(std::chrono::milliseconds _duration)
app_timer_stop(m_ledDriverTimer);
}
#else
bool await_suspend(std::coroutine_handle<> _coroLedHandle) noexcept
bool await_suspend(stdcoro::coroutine_handle<> _coroLedHandle) noexcept
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class GC9A01Compact
std::uint16_t _y,
std::uint16_t _width,
std::uint16_t _height,
TBaseSpiDisplay::TColor* _colorToFill) noexcept
typename TBaseSpiDisplay::TColor* _colorToFill) noexcept
{

const std::uint16_t DisplayHeight = TBaseSpiDisplay::getHeight();
Expand All @@ -140,8 +140,8 @@ class GC9A01Compact
const size_t BytesSizeX = (_width - _x + 1);
const size_t BytesSizeY = (_height - _y + 1);
const size_t BytesSquare = BytesSizeX * BytesSizeY;
const size_t TransferBufferSize
= (BytesSquare * sizeof(typename TBaseSpiDisplay::TColor));
const size_t TransferBufferSize =
(BytesSquare * sizeof(typename TBaseSpiDisplay::TColor));

co_await TBaseSpiDisplay::m_displayInitialized;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class BaseSpiDisplayCoroutine
if (resetDcPin)
pBaseDisplay->setDcPin();
}
void await_suspend(std::coroutine_handle<> thisCoroutine) const
void await_suspend(stdcoro::coroutine_handle<> thisCoroutine) const
{
if (resetDcPin)
pBaseDisplay->resetDcPin();
Expand Down
11 changes: 5 additions & 6 deletions Firmware/drivers/spi/inc/backends/spi_backend_desktop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
#include <chrono>
#include <condition_variable>
#include <cstdint>
#include <fmt/ranges.h>
#include <functional>
#include <iostream>
#include <mutex>
#include <queue>
#include <span>
#include <thread>
#include <vector>
#include <span>
#include <fmt/ranges.h>

#include <utils/MetaUtils.hpp>

Expand All @@ -33,14 +33,14 @@ class SpiBusDesktopBackend
{
#ifdef USE_THREADING_ASYNC_BACKEND

m_dmaThread = std::make_unique<std::thread>([this]()mutable {
m_dmaThread = std::make_unique<std::thread>([this]() mutable {
while (m_processSpiTransactions)
{
if (m_newDataArrived)
{
using namespace std::chrono_literals;

std::unique_lock<std::mutex>(m_transactionBufferGuard);
std::unique_lock<std::mutex> transactionWrap(m_transactionBufferGuard);
fmt::print("[Desktop SPI simultator]{}\n", m_dataBuffer);

m_newDataArrived.store(false);
Expand All @@ -59,7 +59,6 @@ class SpiBusDesktopBackend
}

public:

void setCsPinHigh() noexcept
{
}
Expand All @@ -74,7 +73,7 @@ class SpiBusDesktopBackend
m_dataBuffer.clear();
m_dataBuffer.reserve(_bufferSize);

std::unique_lock<std::mutex>(m_transactionBufferGuard);
std::unique_lock<std::mutex> transactionWrap(m_transactionBufferGuard);
std::copy(_pBuffer, _pBuffer + _bufferSize, std::back_inserter(m_dataBuffer));
m_newDataArrived.store(true, std::memory_order_release);

Expand Down
10 changes: 5 additions & 5 deletions Firmware/drivers/spi/inc/spi/spi_wrapper_async_templated.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#include <atomic>
#include <coroutine>
#include <cstdint>
#include <memory>
#include <optional>
#include <span>
#include <utils/CoroUtils.hpp>

#include <etl/vector.h>
#include <utils/CoroUtils.hpp>
Expand Down Expand Up @@ -48,7 +48,7 @@ template <typename SpiBackendImpl> class SpiBus : private Utils::noncopyable
{
m_backendImpl.setTransactionCompletedHandler([this] { transmitCompleted(); });

m_coroHandle = std::coroutine_handle<>::from_address(_pUserData);
m_coroHandle = stdcoro::coroutine_handle<>::from_address(_pUserData);

TransactionContext newContext{
.restoreInSpiCtx = _restoreInSpiCtx,
Expand All @@ -68,7 +68,7 @@ template <typename SpiBackendImpl> class SpiBus : private Utils::noncopyable
void* _pUserData,
bool _restoreInSpiCtx) noexcept
{
m_coroHandle = std::coroutine_handle<>::from_address(_pUserData);
m_coroHandle = stdcoro::coroutine_handle<>::from_address(_pUserData);
m_backendImpl.setTransactionCompletedHandler([this] { transmitCompleted(); });

const size_t TransferBufferSize = _pBuffer.size();
Expand Down Expand Up @@ -97,8 +97,8 @@ template <typename SpiBackendImpl> class SpiBus : private Utils::noncopyable
m_backendImpl.sendChunk(_pBuffer.data(), _pBuffer.size());
}
}
public:

public:
void setCsPinHigh() noexcept
{
getBackendImpl().setCsPinHigh();
Expand Down Expand Up @@ -168,7 +168,7 @@ template <typename SpiBackendImpl> class SpiBus : private Utils::noncopyable

private:
SpiBackendImpl m_backendImpl;
std::coroutine_handle<> m_coroHandle;
stdcoro::coroutine_handle<> m_coroHandle;

struct TransactionContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ template <typename TSpiBusInstance> class WinbondFlashDriver
void await_resume() const noexcept
{
}
void await_suspend(std::coroutine_handle<> thisCoroutine) const
void await_suspend(stdcoro::coroutine_handle<> thisCoroutine) const
{
pThis->getSpiBus()->xferBuffer(
pTransmitBuffer, pReceiveBuffer, thisCoroutine.address(), restoreInSpiCtx);
Expand All @@ -271,7 +271,7 @@ template <typename TSpiBusInstance> class WinbondFlashDriver
void await_resume() const noexcept
{
}
void await_suspend(std::coroutine_handle<> thisCoroutine) const
void await_suspend(stdcoro::coroutine_handle<> thisCoroutine) const
{
pThis->getSpiBus()->transmitBuffer(
pTransmitBuffer,
Expand Down
Loading