Alan Ffrench / Mbed 2 deprecated Experiment_2_5

Dependencies:   mbed

Committer:
alanffrench
Date:
Wed Jul 29 18:51:38 2020 +0000
Revision:
0:52468b19aa21
Threads

Who changed what in which revision?

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