OS2

Dependents:   GYRO_MPU6050 Bluetooth_Powered_Multimeter_Using_STM32F429_and_RTOS fyp

Committer:
guilhemMBED
Date:
Mon Feb 03 13:41:14 2020 +0000
Revision:
0:a7c449cd2d5a
previous version;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
guilhemMBED 0:a7c449cd2d5a 1
guilhemMBED 0:a7c449cd2d5a 2 /** \addtogroup rtos */
guilhemMBED 0:a7c449cd2d5a 3 /** @{*/
guilhemMBED 0:a7c449cd2d5a 4 /*----------------------------------------------------------------------------
guilhemMBED 0:a7c449cd2d5a 5 * CMSIS-RTOS - RTX
guilhemMBED 0:a7c449cd2d5a 6 *----------------------------------------------------------------------------
guilhemMBED 0:a7c449cd2d5a 7 * Name: RT_TASK.H
guilhemMBED 0:a7c449cd2d5a 8 * Purpose: Task functions and system start up.
guilhemMBED 0:a7c449cd2d5a 9 * Rev.: V4.79
guilhemMBED 0:a7c449cd2d5a 10 *----------------------------------------------------------------------------
guilhemMBED 0:a7c449cd2d5a 11 *
guilhemMBED 0:a7c449cd2d5a 12 * Copyright (c) 1999-2009 KEIL, 2009-2015 ARM Germany GmbH
guilhemMBED 0:a7c449cd2d5a 13 * All rights reserved.
guilhemMBED 0:a7c449cd2d5a 14 * Redistribution and use in source and binary forms, with or without
guilhemMBED 0:a7c449cd2d5a 15 * modification, are permitted provided that the following conditions are met:
guilhemMBED 0:a7c449cd2d5a 16 * - Redistributions of source code must retain the above copyright
guilhemMBED 0:a7c449cd2d5a 17 * notice, this list of conditions and the following disclaimer.
guilhemMBED 0:a7c449cd2d5a 18 * - Redistributions in binary form must reproduce the above copyright
guilhemMBED 0:a7c449cd2d5a 19 * notice, this list of conditions and the following disclaimer in the
guilhemMBED 0:a7c449cd2d5a 20 * documentation and/or other materials provided with the distribution.
guilhemMBED 0:a7c449cd2d5a 21 * - Neither the name of ARM nor the names of its contributors may be used
guilhemMBED 0:a7c449cd2d5a 22 * to endorse or promote products derived from this software without
guilhemMBED 0:a7c449cd2d5a 23 * specific prior written permission.
guilhemMBED 0:a7c449cd2d5a 24 *
guilhemMBED 0:a7c449cd2d5a 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
guilhemMBED 0:a7c449cd2d5a 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
guilhemMBED 0:a7c449cd2d5a 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
guilhemMBED 0:a7c449cd2d5a 28 * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
guilhemMBED 0:a7c449cd2d5a 29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
guilhemMBED 0:a7c449cd2d5a 30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
guilhemMBED 0:a7c449cd2d5a 31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
guilhemMBED 0:a7c449cd2d5a 32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
guilhemMBED 0:a7c449cd2d5a 33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
guilhemMBED 0:a7c449cd2d5a 34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
guilhemMBED 0:a7c449cd2d5a 35 * POSSIBILITY OF SUCH DAMAGE.
guilhemMBED 0:a7c449cd2d5a 36 *---------------------------------------------------------------------------*/
guilhemMBED 0:a7c449cd2d5a 37
guilhemMBED 0:a7c449cd2d5a 38 /* Definitions */
guilhemMBED 0:a7c449cd2d5a 39
guilhemMBED 0:a7c449cd2d5a 40 #include "cmsis_os.h"
guilhemMBED 0:a7c449cd2d5a 41
guilhemMBED 0:a7c449cd2d5a 42 /* Values for 'state' */
guilhemMBED 0:a7c449cd2d5a 43 #define INACTIVE 0U
guilhemMBED 0:a7c449cd2d5a 44 #define READY 1U
guilhemMBED 0:a7c449cd2d5a 45 #define RUNNING 2U
guilhemMBED 0:a7c449cd2d5a 46 #define WAIT_DLY 3U
guilhemMBED 0:a7c449cd2d5a 47 #define WAIT_ITV 4U
guilhemMBED 0:a7c449cd2d5a 48 #define WAIT_OR 5U
guilhemMBED 0:a7c449cd2d5a 49 #define WAIT_AND 6U
guilhemMBED 0:a7c449cd2d5a 50 #define WAIT_SEM 7U
guilhemMBED 0:a7c449cd2d5a 51 #define WAIT_MBX 8U
guilhemMBED 0:a7c449cd2d5a 52 #define WAIT_MUT 9U
guilhemMBED 0:a7c449cd2d5a 53
guilhemMBED 0:a7c449cd2d5a 54 /* Return codes */
guilhemMBED 0:a7c449cd2d5a 55 #define OS_R_TMO 0x01U
guilhemMBED 0:a7c449cd2d5a 56 #define OS_R_EVT 0x02U
guilhemMBED 0:a7c449cd2d5a 57 #define OS_R_SEM 0x03U
guilhemMBED 0:a7c449cd2d5a 58 #define OS_R_MBX 0x04U
guilhemMBED 0:a7c449cd2d5a 59 #define OS_R_MUT 0x05U
guilhemMBED 0:a7c449cd2d5a 60
guilhemMBED 0:a7c449cd2d5a 61 #define OS_R_OK 0x00U
guilhemMBED 0:a7c449cd2d5a 62 #define OS_R_NOK 0xFFU
guilhemMBED 0:a7c449cd2d5a 63
guilhemMBED 0:a7c449cd2d5a 64 /* Variables */
guilhemMBED 0:a7c449cd2d5a 65 extern struct OS_TSK os_tsk;
guilhemMBED 0:a7c449cd2d5a 66 extern struct OS_TCB os_idle_TCB;
guilhemMBED 0:a7c449cd2d5a 67
guilhemMBED 0:a7c449cd2d5a 68 /* Functions */
guilhemMBED 0:a7c449cd2d5a 69 extern void rt_switch_req (P_TCB p_new);
guilhemMBED 0:a7c449cd2d5a 70 extern void rt_dispatch (P_TCB next_TCB);
guilhemMBED 0:a7c449cd2d5a 71 extern void rt_block (U16 timeout, U8 block_state);
guilhemMBED 0:a7c449cd2d5a 72 extern void rt_tsk_pass (void);
guilhemMBED 0:a7c449cd2d5a 73 extern OS_TID rt_tsk_self (void);
guilhemMBED 0:a7c449cd2d5a 74 extern OS_RESULT rt_tsk_prio (OS_TID task_id, U8 new_prio);
guilhemMBED 0:a7c449cd2d5a 75 extern OS_TID rt_tsk_create (FUNCP task, U32 prio_stksz, void *stk, void *argv);
guilhemMBED 0:a7c449cd2d5a 76 extern OS_RESULT rt_tsk_delete (OS_TID task_id);
guilhemMBED 0:a7c449cd2d5a 77 #ifdef __CMSIS_RTOS
guilhemMBED 0:a7c449cd2d5a 78 extern void rt_sys_init (void);
guilhemMBED 0:a7c449cd2d5a 79 extern void rt_sys_start (void);
guilhemMBED 0:a7c449cd2d5a 80 #else
guilhemMBED 0:a7c449cd2d5a 81 extern void rt_sys_init (FUNCP first_task, U32 prio_stksz, void *stk);
guilhemMBED 0:a7c449cd2d5a 82 #endif
guilhemMBED 0:a7c449cd2d5a 83
guilhemMBED 0:a7c449cd2d5a 84 /*----------------------------------------------------------------------------
guilhemMBED 0:a7c449cd2d5a 85 * end of file
guilhemMBED 0:a7c449cd2d5a 86 *---------------------------------------------------------------------------*/
guilhemMBED 0:a7c449cd2d5a 87
guilhemMBED 0:a7c449cd2d5a 88 /** @}*/