my version

Dependents:   aps_so_c2

Fork of mbed-rtos by mbed official

Committer:
feupos
Date:
Sat Nov 18 18:27:08 2017 +0000
Revision:
127:bf4dda6a6a1b
Parent:
123:58563e6cba1e
ok

Who changed what in which revision?

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