A metronome using the FRDM K64F board

Committer:
ram54288
Date:
Sun May 14 18:40:18 2017 +0000
Revision:
0:a7a43371b306
Initial commit

Who changed what in which revision?

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