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