Versie 0.2 Het versturen via de NRF werkt nog niet helemaal omdat er per 4 bytes verstuurd moet worden. Wordt gefixt d.m.v. dynamic stuff!

Dependencies:   BufferedSerial

Dependents:   rtos_basic rtos_basic

Fork of mbed-rtos by mbed official

Committer:
mbed_official
Date:
Thu Nov 06 13:00:11 2014 +0000
Revision:
49:77c8e4604045
Child:
59:28712e303960
Synchronized with git revision 7b90c2ba137baaf9769219e0e8a7b8e8d1299c4f

Full URL: https://github.com/mbedmicro/mbed/commit/7b90c2ba137baaf9769219e0e8a7b8e8d1299c4f/

This target is not yet tested, so it can't be released as part of the official
SDK build for now.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 49:77c8e4604045 1 /*----------------------------------------------------------------------------
mbed_official 49:77c8e4604045 2 * RL-ARM - RTX
mbed_official 49:77c8e4604045 3 *----------------------------------------------------------------------------
mbed_official 49:77c8e4604045 4 * Name: RT_TYPEDEF.H
mbed_official 49:77c8e4604045 5 * Purpose: Type Definitions
mbed_official 49:77c8e4604045 6 * Rev.: V4.60
mbed_official 49:77c8e4604045 7 *----------------------------------------------------------------------------
mbed_official 49:77c8e4604045 8 *
mbed_official 49:77c8e4604045 9 * Copyright (c) 1999-2009 KEIL, 2009-2012 ARM Germany GmbH
mbed_official 49:77c8e4604045 10 * All rights reserved.
mbed_official 49:77c8e4604045 11 * Redistribution and use in source and binary forms, with or without
mbed_official 49:77c8e4604045 12 * modification, are permitted provided that the following conditions are met:
mbed_official 49:77c8e4604045 13 * - Redistributions of source code must retain the above copyright
mbed_official 49:77c8e4604045 14 * notice, this list of conditions and the following disclaimer.
mbed_official 49:77c8e4604045 15 * - Redistributions in binary form must reproduce the above copyright
mbed_official 49:77c8e4604045 16 * notice, this list of conditions and the following disclaimer in the
mbed_official 49:77c8e4604045 17 * documentation and/or other materials provided with the distribution.
mbed_official 49:77c8e4604045 18 * - Neither the name of ARM nor the names of its contributors may be used
mbed_official 49:77c8e4604045 19 * to endorse or promote products derived from this software without
mbed_official 49:77c8e4604045 20 * specific prior written permission.
mbed_official 49:77c8e4604045 21 *
mbed_official 49:77c8e4604045 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 49:77c8e4604045 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 49:77c8e4604045 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
mbed_official 49:77c8e4604045 25 * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
mbed_official 49:77c8e4604045 26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
mbed_official 49:77c8e4604045 27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
mbed_official 49:77c8e4604045 28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
mbed_official 49:77c8e4604045 29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
mbed_official 49:77c8e4604045 30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
mbed_official 49:77c8e4604045 31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
mbed_official 49:77c8e4604045 32 * POSSIBILITY OF SUCH DAMAGE.
mbed_official 49:77c8e4604045 33 *---------------------------------------------------------------------------*/
mbed_official 49:77c8e4604045 34 #ifndef RT_TYPE_DEF_H
mbed_official 49:77c8e4604045 35 #define RT_TYPE_DEF_H
mbed_official 49:77c8e4604045 36
mbed_official 49:77c8e4604045 37 #include "os_tcb.h"
mbed_official 49:77c8e4604045 38
mbed_official 49:77c8e4604045 39 typedef U32 OS_TID;
mbed_official 49:77c8e4604045 40 typedef void *OS_ID;
mbed_official 49:77c8e4604045 41 typedef U32 OS_RESULT;
mbed_official 49:77c8e4604045 42
mbed_official 49:77c8e4604045 43 #define TCB_STACKF 32 /* 'stack_frame' offset */
mbed_official 49:77c8e4604045 44 #define TCB_TSTACK 36 /* 'tsk_stack' offset */
mbed_official 49:77c8e4604045 45
mbed_official 49:77c8e4604045 46 typedef struct OS_PSFE { /* Post Service Fifo Entry */
mbed_official 49:77c8e4604045 47 void *id; /* Object Identification */
mbed_official 49:77c8e4604045 48 U32 arg; /* Object Argument */
mbed_official 49:77c8e4604045 49 } *P_PSFE;
mbed_official 49:77c8e4604045 50
mbed_official 49:77c8e4604045 51 typedef struct OS_PSQ { /* Post Service Queue */
mbed_official 49:77c8e4604045 52 U8 first; /* FIFO Head Index */
mbed_official 49:77c8e4604045 53 U8 last; /* FIFO Tail Index */
mbed_official 49:77c8e4604045 54 U8 count; /* Number of stored items in FIFO */
mbed_official 49:77c8e4604045 55 U8 size; /* FIFO Size */
mbed_official 49:77c8e4604045 56 struct OS_PSFE q[1]; /* FIFO Content */
mbed_official 49:77c8e4604045 57 } *P_PSQ;
mbed_official 49:77c8e4604045 58
mbed_official 49:77c8e4604045 59 typedef struct OS_TSK {
mbed_official 49:77c8e4604045 60 P_TCB run; /* Current running task */
mbed_official 49:77c8e4604045 61 P_TCB new_tsk; /* Scheduled task to run */
mbed_official 49:77c8e4604045 62 } *P_TSK;
mbed_official 49:77c8e4604045 63
mbed_official 49:77c8e4604045 64 typedef struct OS_ROBIN { /* Round Robin Control */
mbed_official 49:77c8e4604045 65 P_TCB task; /* Round Robin task */
mbed_official 49:77c8e4604045 66 U16 time; /* Round Robin switch time */
mbed_official 49:77c8e4604045 67 U16 tout; /* Round Robin timeout */
mbed_official 49:77c8e4604045 68 } *P_ROBIN;
mbed_official 49:77c8e4604045 69
mbed_official 49:77c8e4604045 70 typedef struct OS_XCB {
mbed_official 49:77c8e4604045 71 U8 cb_type; /* Control Block Type */
mbed_official 49:77c8e4604045 72 struct OS_TCB *p_lnk; /* Link pointer for ready/sem. wait list */
mbed_official 49:77c8e4604045 73 struct OS_TCB *p_rlnk; /* Link pointer for sem./mbx lst backwards */
mbed_official 49:77c8e4604045 74 struct OS_TCB *p_dlnk; /* Link pointer for delay list */
mbed_official 49:77c8e4604045 75 struct OS_TCB *p_blnk; /* Link pointer for delay list backwards */
mbed_official 49:77c8e4604045 76 U16 delta_time; /* Time until time out */
mbed_official 49:77c8e4604045 77 } *P_XCB;
mbed_official 49:77c8e4604045 78
mbed_official 49:77c8e4604045 79 typedef struct OS_MCB {
mbed_official 49:77c8e4604045 80 U8 cb_type; /* Control Block Type */
mbed_official 49:77c8e4604045 81 U8 state; /* State flag variable */
mbed_official 49:77c8e4604045 82 U8 isr_st; /* State flag variable for isr functions */
mbed_official 49:77c8e4604045 83 struct OS_TCB *p_lnk; /* Chain of tasks waiting for message */
mbed_official 49:77c8e4604045 84 U16 first; /* Index of the message list begin */
mbed_official 49:77c8e4604045 85 U16 last; /* Index of the message list end */
mbed_official 49:77c8e4604045 86 U16 count; /* Actual number of stored messages */
mbed_official 49:77c8e4604045 87 U16 size; /* Maximum number of stored messages */
mbed_official 49:77c8e4604045 88 void *msg[1]; /* FIFO for Message pointers 1st element */
mbed_official 49:77c8e4604045 89 } *P_MCB;
mbed_official 49:77c8e4604045 90
mbed_official 49:77c8e4604045 91 typedef struct OS_SCB {
mbed_official 49:77c8e4604045 92 U8 cb_type; /* Control Block Type */
mbed_official 49:77c8e4604045 93 U8 mask; /* Semaphore token mask */
mbed_official 49:77c8e4604045 94 U16 tokens; /* Semaphore tokens */
mbed_official 49:77c8e4604045 95 struct OS_TCB *p_lnk; /* Chain of tasks waiting for tokens */
mbed_official 49:77c8e4604045 96 } *P_SCB;
mbed_official 49:77c8e4604045 97
mbed_official 49:77c8e4604045 98 typedef struct OS_MUCB {
mbed_official 49:77c8e4604045 99 U8 cb_type; /* Control Block Type */
mbed_official 49:77c8e4604045 100 U8 prio; /* Owner task default priority */
mbed_official 49:77c8e4604045 101 U16 level; /* Call nesting level */
mbed_official 49:77c8e4604045 102 struct OS_TCB *p_lnk; /* Chain of tasks waiting for mutex */
mbed_official 49:77c8e4604045 103 struct OS_TCB *owner; /* Mutex owner task */
mbed_official 49:77c8e4604045 104 } *P_MUCB;
mbed_official 49:77c8e4604045 105
mbed_official 49:77c8e4604045 106 typedef struct OS_XTMR {
mbed_official 49:77c8e4604045 107 struct OS_TMR *next;
mbed_official 49:77c8e4604045 108 U16 tcnt;
mbed_official 49:77c8e4604045 109 } *P_XTMR;
mbed_official 49:77c8e4604045 110
mbed_official 49:77c8e4604045 111 typedef struct OS_TMR {
mbed_official 49:77c8e4604045 112 struct OS_TMR *next; /* Link pointer to Next timer */
mbed_official 49:77c8e4604045 113 U16 tcnt; /* Timer delay count */
mbed_official 49:77c8e4604045 114 U16 info; /* User defined call info */
mbed_official 49:77c8e4604045 115 } *P_TMR;
mbed_official 49:77c8e4604045 116
mbed_official 49:77c8e4604045 117 typedef struct OS_BM {
mbed_official 49:77c8e4604045 118 void *free; /* Pointer to first free memory block */
mbed_official 49:77c8e4604045 119 void *end; /* Pointer to memory block end */
mbed_official 49:77c8e4604045 120 U32 blk_size; /* Memory block size */
mbed_official 49:77c8e4604045 121 } *P_BM;
mbed_official 49:77c8e4604045 122
mbed_official 49:77c8e4604045 123 /* Definitions */
mbed_official 49:77c8e4604045 124 #define __TRUE 1
mbed_official 49:77c8e4604045 125 #define __FALSE 0
mbed_official 49:77c8e4604045 126 #define NULL ((void *) 0)
mbed_official 49:77c8e4604045 127
mbed_official 49:77c8e4604045 128 #endif