Line data Source code
1 : /********************************************************************************
2 : * Copyright (c) 2024 Accenture
3 : *
4 : * This program and the accompanying materials are made available under the
5 : * terms of the Apache License Version 2.0 which is available at
6 : * https://www.apache.org/licenses/LICENSE-2.0
7 : *
8 : * SPDX-License-Identifier: Apache-2.0
9 : ********************************************************************************/
10 :
11 : #include "async/AsyncBinding.h"
12 :
13 : namespace async
14 : {
15 : using AdapterType = AsyncBindingType::AdapterType;
16 :
17 1 : void execute(ContextType const context, RunnableType& runnable)
18 : {
19 1 : AdapterType::execute(context, runnable);
20 1 : }
21 :
22 1 : void schedule(
23 : ContextType const context,
24 : RunnableType& runnable,
25 : TimeoutType& timeout,
26 : uint32_t const delay,
27 : TimeUnitType const unit)
28 : {
29 1 : AdapterType::schedule(context, runnable, timeout, delay, unit);
30 1 : }
31 :
32 1 : void scheduleAtFixedRate(
33 : ContextType const context,
34 : RunnableType& runnable,
35 : TimeoutType& timeout,
36 : uint32_t const period,
37 : TimeUnitType const unit)
38 : {
39 1 : AdapterType::scheduleAtFixedRate(context, runnable, timeout, period, unit);
40 1 : }
41 :
42 1 : void suspend(ContextType context) { AdapterType::suspend(context); }
43 :
44 1 : void resume(ContextType context) { AdapterType::resume(context); }
45 :
46 : } // namespace async
47 :
48 : extern "C"
49 : {
50 1 : void vApplicationIdleHook() { ::async::AdapterType::callIdleTaskFunction(); }
51 :
52 1 : void vApplicationGetIdleTaskMemory(
53 : StaticTask_t** const ppxIdleTaskTCBBuffer,
54 : StackType_t** const ppxIdleTaskStackBuffer,
55 : uint32_t* const pulIdleTaskStackSize)
56 : {
57 1 : ::async::AdapterType::getTaskMemory<::async::AdapterType::TASK_IDLE>(
58 : ppxIdleTaskTCBBuffer, ppxIdleTaskStackBuffer, pulIdleTaskStackSize);
59 1 : }
60 :
61 1 : void vApplicationGetTimerTaskMemory(
62 : StaticTask_t** const ppxTimerTaskTCBBuffer,
63 : StackType_t** const ppxTimerTaskStackBuffer,
64 : uint32_t* const pulTimerTaskStackSize)
65 : {
66 1 : ::async::AdapterType::getTaskMemory<::async::AdapterType::TASK_TIMER>(
67 : ppxTimerTaskTCBBuffer, ppxTimerTaskStackBuffer, pulTimerTaskStackSize);
68 1 : }
69 :
70 : } // extern "C"
|