Ram Gandikota
/
IOTMetronome
FRDM K64F Metronome
pal/Test/Common/pal_rtos_test_utils.h@0:dbad57390bd1, 2017-05-14 (annotated)
- Committer:
- ram54288
- Date:
- Sun May 14 18:37:05 2017 +0000
- Revision:
- 0:dbad57390bd1
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ram54288 | 0:dbad57390bd1 | 1 | /* |
ram54288 | 0:dbad57390bd1 | 2 | * Copyright (c) 2016 ARM Limited. All rights reserved. |
ram54288 | 0:dbad57390bd1 | 3 | * SPDX-License-Identifier: Apache-2.0 |
ram54288 | 0:dbad57390bd1 | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
ram54288 | 0:dbad57390bd1 | 5 | * not use this file except in compliance with the License. |
ram54288 | 0:dbad57390bd1 | 6 | * You may obtain a copy of the License at |
ram54288 | 0:dbad57390bd1 | 7 | * |
ram54288 | 0:dbad57390bd1 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
ram54288 | 0:dbad57390bd1 | 9 | * |
ram54288 | 0:dbad57390bd1 | 10 | * Unless required by applicable law or agreed to in writing, software |
ram54288 | 0:dbad57390bd1 | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
ram54288 | 0:dbad57390bd1 | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
ram54288 | 0:dbad57390bd1 | 13 | * See the License for the specific language governing permissions and |
ram54288 | 0:dbad57390bd1 | 14 | * limitations under the License. |
ram54288 | 0:dbad57390bd1 | 15 | */ |
ram54288 | 0:dbad57390bd1 | 16 | |
ram54288 | 0:dbad57390bd1 | 17 | #ifndef _PAL_RTOS_TEST_UTILS_H |
ram54288 | 0:dbad57390bd1 | 18 | #define _PAL_RTOS_TEST_UTILS_H |
ram54288 | 0:dbad57390bd1 | 19 | |
ram54288 | 0:dbad57390bd1 | 20 | #include "pal_types.h" |
ram54288 | 0:dbad57390bd1 | 21 | #include "pal_rtos.h" |
ram54288 | 0:dbad57390bd1 | 22 | #include "pal_test_utils.h" |
ram54288 | 0:dbad57390bd1 | 23 | |
ram54288 | 0:dbad57390bd1 | 24 | #define THREAD_STACK_SIZE 1024*sizeof(uint32_t) |
ram54288 | 0:dbad57390bd1 | 25 | |
ram54288 | 0:dbad57390bd1 | 26 | typedef struct threadsArgument{ |
ram54288 | 0:dbad57390bd1 | 27 | uint32_t arg1; |
ram54288 | 0:dbad57390bd1 | 28 | uint32_t arg2; |
ram54288 | 0:dbad57390bd1 | 29 | uint32_t arg3; |
ram54288 | 0:dbad57390bd1 | 30 | uint32_t arg4; |
ram54288 | 0:dbad57390bd1 | 31 | uint32_t arg5; |
ram54288 | 0:dbad57390bd1 | 32 | uint32_t arg6; |
ram54288 | 0:dbad57390bd1 | 33 | uint32_t arg7; |
ram54288 | 0:dbad57390bd1 | 34 | }threadsArgument_t; |
ram54288 | 0:dbad57390bd1 | 35 | |
ram54288 | 0:dbad57390bd1 | 36 | |
ram54288 | 0:dbad57390bd1 | 37 | extern threadsArgument_t g_threadsArg; |
ram54288 | 0:dbad57390bd1 | 38 | |
ram54288 | 0:dbad57390bd1 | 39 | extern uint32_t g_threadStorage[20]; |
ram54288 | 0:dbad57390bd1 | 40 | |
ram54288 | 0:dbad57390bd1 | 41 | void palThreadFunc1(void const *argument); |
ram54288 | 0:dbad57390bd1 | 42 | void palThreadFunc2(void const *argument); |
ram54288 | 0:dbad57390bd1 | 43 | void palThreadFunc3(void const *argument); |
ram54288 | 0:dbad57390bd1 | 44 | void palThreadFunc4(void const *argument); |
ram54288 | 0:dbad57390bd1 | 45 | void palThreadFunc5(void const *argument); |
ram54288 | 0:dbad57390bd1 | 46 | void palThreadFunc6(void const *argument); |
ram54288 | 0:dbad57390bd1 | 47 | |
ram54288 | 0:dbad57390bd1 | 48 | |
ram54288 | 0:dbad57390bd1 | 49 | typedef struct timerArgument{ |
ram54288 | 0:dbad57390bd1 | 50 | uint32_t ticksBeforeTimer; |
ram54288 | 0:dbad57390bd1 | 51 | uint32_t ticksInFunc1; |
ram54288 | 0:dbad57390bd1 | 52 | uint32_t ticksInFunc2; |
ram54288 | 0:dbad57390bd1 | 53 | }timerArgument_t; |
ram54288 | 0:dbad57390bd1 | 54 | |
ram54288 | 0:dbad57390bd1 | 55 | extern timerArgument_t g_timerArgs; |
ram54288 | 0:dbad57390bd1 | 56 | |
ram54288 | 0:dbad57390bd1 | 57 | void palTimerFunc1(void const *argument); |
ram54288 | 0:dbad57390bd1 | 58 | void palTimerFunc2(void const *argument); |
ram54288 | 0:dbad57390bd1 | 59 | |
ram54288 | 0:dbad57390bd1 | 60 | |
ram54288 | 0:dbad57390bd1 | 61 | void palThreadFuncCustom1(void const *argument); |
ram54288 | 0:dbad57390bd1 | 62 | void palThreadFuncCustom2(void const *argument); |
ram54288 | 0:dbad57390bd1 | 63 | void palThreadFuncCustom3(void const *argument); |
ram54288 | 0:dbad57390bd1 | 64 | void palThreadFuncCustom4(void const *argument); |
ram54288 | 0:dbad57390bd1 | 65 | |
ram54288 | 0:dbad57390bd1 | 66 | |
ram54288 | 0:dbad57390bd1 | 67 | #define MEMORY_POOL1_BLOCK_SIZE 32 |
ram54288 | 0:dbad57390bd1 | 68 | #define MEMORY_POOL1_BLOCK_COUNT 5 |
ram54288 | 0:dbad57390bd1 | 69 | #define MEMORY_POOL2_BLOCK_SIZE 12 |
ram54288 | 0:dbad57390bd1 | 70 | #define MEMORY_POOL2_BLOCK_COUNT 4 |
ram54288 | 0:dbad57390bd1 | 71 | |
ram54288 | 0:dbad57390bd1 | 72 | extern palMutexID_t mutex1; |
ram54288 | 0:dbad57390bd1 | 73 | extern palMutexID_t mutex2; |
ram54288 | 0:dbad57390bd1 | 74 | |
ram54288 | 0:dbad57390bd1 | 75 | extern palSemaphoreID_t semaphore1; |
ram54288 | 0:dbad57390bd1 | 76 | |
ram54288 | 0:dbad57390bd1 | 77 | #endif //_PAL_RTOS_TEST_UTILS_H |