Skip to content

Commit

Permalink
Remove support of legacy API from asyncFreeRtos
Browse files Browse the repository at this point in the history
* Remove (conditional) references from asyncFreeRtos to
  former modules looper and commonTimeout
* Remove legacy module commonTimeout

Change-Id: Ibc9342a09992fe3105e4ce47a72f93102889d1f2
  • Loading branch information
thomas-herrmann-1 committed Jan 8, 2025
1 parent 63f00d2 commit cb2cb55
Show file tree
Hide file tree
Showing 25 changed files with 1 addition and 806 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ extern "C"
#undef configCHECK_FOR_STACK_OVERFLOW
#define configCHECK_FOR_STACK_OVERFLOW 2 // change from 1 in order to watermark check boundaries

// Disable legacy support for async

#ifndef ASYNC_LOOPER_DISABLE
#define ASYNC_LOOPER_DISABLE 1
#endif // ASYNC_LOOPER_DISABLE

#ifndef ASYNC_TIMEOUTMANAGER2_DISABLE
#define ASYNC_TIMEOUTMANAGER2_DISABLE 1
#endif // ASYNC_TIMEOUTMANAGER2_DISABLE

#ifndef MINIMUM_STACK_SIZE
#define EXTRA_THREAD_DATA_STACK_SIZE 40U // see pxPortInitialiseStack()
#if (defined(_DYNAMIC_STACK_SIZE_SOURCE)) || (defined(_GNU_SOURCE))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,6 @@ standard names. */

#define configTIMER_SERVICE_TASK_NAME "TIMER_OS"

#ifndef ASYNC_LOOPER_DISABLE
#define ASYNC_LOOPER_DISABLE 1
#endif // ASYNC_LOOPER_DISABLE

#ifndef ASYNC_TIMEOUTMANAGER2_DISABLE
#define ASYNC_TIMEOUTMANAGER2_DISABLE 1
#endif // ASYNC_TIMEOUTMANAGER2_DISABLE

#ifdef __cplusplus
} /* extern "C" */
#endif
Expand Down
2 changes: 1 addition & 1 deletion executables/unitTest/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ add_library(utCommon src/util/EcuIdList.cpp src/util/crc/CRCCalculator.cpp)

target_include_directories(utCommon PUBLIC include test/gtest/include)

target_link_libraries(utCommon PUBLIC estd platform commonTimeout)
target_link_libraries(utCommon PUBLIC estd platform)

if (BUILD_UNIT_TESTS)
add_library(utCommonMock INTERFACE)
Expand Down
1 change: 0 additions & 1 deletion libs/bsw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ add_subdirectory(asyncFreeRtos EXCLUDE_FROM_ALL)
add_subdirectory(asyncImpl EXCLUDE_FROM_ALL)
add_subdirectory(bsp EXCLUDE_FROM_ALL)
add_subdirectory(common EXCLUDE_FROM_ALL)
add_subdirectory(commonTimeout EXCLUDE_FROM_ALL)
add_subdirectory(cpp2can EXCLUDE_FROM_ALL)
add_subdirectory(docan EXCLUDE_FROM_ALL)
add_subdirectory(estd EXCLUDE_FROM_ALL)
Expand Down
5 changes: 0 additions & 5 deletions libs/bsw/asyncFreeRtos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ add_library(
src/async/Async.cpp
src/async/FutureSupport.cpp
src/async/Hook.cpp
src/async/Legacy.cpp
src/async/Types.cpp)

target_include_directories(asyncFreeRtosImpl PRIVATE include)
Expand All @@ -37,10 +36,6 @@ target_link_libraries(

if (BUILD_UNIT_TESTS)
# These compile definitions apply to all unit test
target_compile_definitions(
asyncFreeRtos INTERFACE ASYNC_LOOPER_DISABLE
ASYNC_TIMEOUTMANAGER2_DISABLE)

add_library(asyncBinding INTERFACE)

target_include_directories(asyncBinding INTERFACE test/include)
Expand Down
68 changes: 0 additions & 68 deletions libs/bsw/asyncFreeRtos/include/async/FreeRtosAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@
#include "async/TaskContext.h"
#include "async/TaskInitializer.h"

#ifndef ASYNC_LOOPER_DISABLE
#include <looper/looper.h>
#endif // ASYNC_LOOPER_DISABLE

#ifndef ASYNC_TIMEOUTMANAGER2_DISABLE
#include <util/timeout/AsyncTimeoutManager.h>
#endif // ASYNC_TIMEOUTMANAGER2_DISABLE

#include <estd/array.h>
#include <estd/singleton.h>

Expand Down Expand Up @@ -131,27 +123,6 @@ class FreeRtosAdapter

static ContextType getCurrentTaskContext();

#ifndef ASYNC_TIMEOUTMANAGER2_DISABLE
/**
* Retrieves the timeout manager for a given context.
*
* \param context The task context.
* \return A reference to the timeout manager.
*/
static ::common::ITimeoutManager2& getTimeoutManager(ContextType context);
#endif // ASYNC_TIMEOUTMANAGER2_DISABLE

#ifndef ASYNC_LOOPER_DISABLE
/**
* Retrieves the looper for a given context.
*
* \param context The task context.
* \return A reference to the looper.
*/
static ::loop::looper& getLooper(ContextType context);
#endif // ASYNC_LOOPER_DISABLE

/// Initializes the FreeRTOS adapter and associated tasks.
static void init();

/// Starts the FreeRTOS scheduler.
Expand Down Expand Up @@ -244,12 +215,6 @@ class FreeRtosAdapter
static TaskInitializer* _idleTaskInitializer;
static TaskInitializer* _timerTaskInitializer;
static ::estd::array<TaskContextType, TASK_COUNT> _taskContexts;
#ifndef ASYNC_TIMEOUTMANAGER2_DISABLE
static ::estd::array<::common::AsyncTimeoutManager, TASK_COUNT> _timeoutManagers;
#endif // ASYNC_TIMEOUTMANAGER2_DISABLE
#ifndef ASYNC_LOOPER_DISABLE
static ::estd::array<::loop::looper, TASK_COUNT> _loopers;
#endif // ASYNC_LOOPER_DISABLE
static ::estd::array<uint32_t, FREERTOS_TASK_COUNT> _stackSizes;
static char const* _timerTaskName;
static BaseType_t _higherPriorityTaskWokenFlag;
Expand All @@ -270,16 +235,6 @@ template<class Binding>
::estd::
array<typename FreeRtosAdapter<Binding>::TaskContextType, FreeRtosAdapter<Binding>::TASK_COUNT>
FreeRtosAdapter<Binding>::_taskContexts;
#ifndef ASYNC_TIMEOUTMANAGER2_DISABLE
template<class Binding>
::estd::array<::common::AsyncTimeoutManager, FreeRtosAdapter<Binding>::TASK_COUNT>
FreeRtosAdapter<Binding>::_timeoutManagers;
#endif // ASYNC_TIMEOUTMANAGER2_DISABLE
#ifndef ASYNC_LOOPER_DISABLE
template<class Binding>
::estd::array<::loop::looper, FreeRtosAdapter<Binding>::TASK_COUNT>
FreeRtosAdapter<Binding>::_loopers;
#endif // ASYNC_LOOPER_DISABLE
template<class Binding>
::estd::array<uint32_t, FreeRtosAdapter<Binding>::FREERTOS_TASK_COUNT>
FreeRtosAdapter<Binding>::_stackSizes;
Expand Down Expand Up @@ -379,12 +334,6 @@ void FreeRtosAdapter<Binding>::initTask(
{
TaskContextType& taskContext = _taskContexts[static_cast<size_t>(context)];
taskContext.createTimer(timer, name);
#ifndef ASYNC_TIMEOUTMANAGER2_DISABLE
_timeoutManagers[static_cast<size_t>(context)].init(context);
#endif // ASYNC_TIMEOUTMANAGER2_DISABLE
#ifndef ASYNC_LOOPER_DISABLE
_loopers[static_cast<size_t>(context)].init(context);
#endif // ASYNC_LOOPER_DISABLE
}

template<class Binding>
Expand Down Expand Up @@ -467,23 +416,6 @@ inline void FreeRtosAdapter<Binding>::cancel(TimeoutType& timeout)
}
}

#ifndef ASYNC_LOOPER_DISABLE
template<class Binding>
::loop::looper& FreeRtosAdapter<Binding>::getLooper(ContextType const context)
{
return _loopers[static_cast<size_t>(context)];
}
#endif // ASYNC_LOOPER_DISABLE

#ifndef ASYNC_TIMEOUTMANAGER2_DISABLE
template<class Binding>
inline ::common::ITimeoutManager2&
FreeRtosAdapter<Binding>::getTimeoutManager(ContextType const context)
{
return _timeoutManagers[static_cast<size_t>(context)];
}
#endif // ASYNC_TIMEOUTMANAGER2_DISABLE

template<class Binding>
inline BaseType_t* FreeRtosAdapter<Binding>::getHigherPriorityTaskWoken()
{
Expand Down
28 changes: 0 additions & 28 deletions libs/bsw/asyncFreeRtos/include/async/Legacy.h

This file was deleted.

20 changes: 0 additions & 20 deletions libs/bsw/asyncFreeRtos/src/async/Legacy.cpp

This file was deleted.

1 change: 0 additions & 1 deletion libs/bsw/asyncFreeRtos/test/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ add_executable(
src/async/AsyncTest.cpp
src/async/FreeRtosAdapterTest.cpp
src/async/FutureSupportTest.cpp
src/async/LegacyTest.cpp
src/async/LockTest.cpp
src/async/ModifiableLockTest.cpp
src/async/StaticRunnableTest.cpp
Expand Down
1 change: 0 additions & 1 deletion libs/bsw/asyncFreeRtos/test/gtest/src/async/AsyncTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "async/AsyncBinding.h"
#include "async/ContextHookMock.h"
#include "async/Hook.h"
#include "async/Legacy.h"
#include "async/RunnableMock.h"
#include "async/TickHookMock.h"
#include "async/TimeoutMock.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,21 +278,6 @@ TEST_F(FreeRtosAdapterTest, testMinStackSize)
EXPECT_THROW({ TaskType task("test"); }, ::estd::assert_exception);
}

/**
* \refs: SMD_asyncFreeRtos_FreeRtosAdapterLegacy
* \desc: To test Timeout Manager and Looper
*/
TEST_F(FreeRtosAdapterTest, testGetTimeoutManagerAndLooper)
{
#ifndef ASYNC_TIMEOUTMANAGER2_DISABLE
CutType::getTimeoutManager(1U);
#endif // ASYNC_TIMEOUTMANAGER2_DISABLE

#ifndef ASYNC_LOOPER_DISABLE
CutType::getLooper(1U);
#endif // ASYNC_LOOPER_DISABLE}
}

/**
* \refs: SMD_asyncFreeRtos_FreeRtosAdapterTimerTask
* \desc: To test user defined config for tasks
Expand Down
30 changes: 0 additions & 30 deletions libs/bsw/asyncFreeRtos/test/gtest/src/async/LegacyTest.cpp

This file was deleted.

14 changes: 0 additions & 14 deletions libs/bsw/commonTimeout/CMakeLists.txt

This file was deleted.

10 changes: 0 additions & 10 deletions libs/bsw/commonTimeout/doc/index.rst

This file was deleted.

68 changes: 0 additions & 68 deletions libs/bsw/commonTimeout/include/util/timeout/AbstractTimeout.h

This file was deleted.

Loading

0 comments on commit cb2cb55

Please sign in to comment.