Ethernet test for ECE 4180 and others to find your IP address and do a simple HTTP GET request over port 80.

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Committer:
mkersh3
Date:
Thu Apr 04 05:26:09 2013 +0000
Revision:
0:e7ca326e76ee
Ethernet Test for ECE4180 and others to find their IP Address and do a simple HTTP GET request over port 80.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mkersh3 0:e7ca326e76ee 1 /*----------------------------------------------------------------------------
mkersh3 0:e7ca326e76ee 2 * RL-ARM - RTX
mkersh3 0:e7ca326e76ee 3 *----------------------------------------------------------------------------
mkersh3 0:e7ca326e76ee 4 * Name: RT_TASK.C
mkersh3 0:e7ca326e76ee 5 * Purpose: Task functions and system start up.
mkersh3 0:e7ca326e76ee 6 * Rev.: V4.50
mkersh3 0:e7ca326e76ee 7 *----------------------------------------------------------------------------
mkersh3 0:e7ca326e76ee 8 *
mkersh3 0:e7ca326e76ee 9 * Copyright (c) 1999-2009 KEIL, 2009-2012 ARM Germany GmbH
mkersh3 0:e7ca326e76ee 10 * All rights reserved.
mkersh3 0:e7ca326e76ee 11 * Redistribution and use in source and binary forms, with or without
mkersh3 0:e7ca326e76ee 12 * modification, are permitted provided that the following conditions are met:
mkersh3 0:e7ca326e76ee 13 * - Redistributions of source code must retain the above copyright
mkersh3 0:e7ca326e76ee 14 * notice, this list of conditions and the following disclaimer.
mkersh3 0:e7ca326e76ee 15 * - Redistributions in binary form must reproduce the above copyright
mkersh3 0:e7ca326e76ee 16 * notice, this list of conditions and the following disclaimer in the
mkersh3 0:e7ca326e76ee 17 * documentation and/or other materials provided with the distribution.
mkersh3 0:e7ca326e76ee 18 * - Neither the name of ARM nor the names of its contributors may be used
mkersh3 0:e7ca326e76ee 19 * to endorse or promote products derived from this software without
mkersh3 0:e7ca326e76ee 20 * specific prior written permission.
mkersh3 0:e7ca326e76ee 21 *
mkersh3 0:e7ca326e76ee 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mkersh3 0:e7ca326e76ee 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mkersh3 0:e7ca326e76ee 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
mkersh3 0:e7ca326e76ee 25 * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
mkersh3 0:e7ca326e76ee 26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
mkersh3 0:e7ca326e76ee 27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
mkersh3 0:e7ca326e76ee 28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
mkersh3 0:e7ca326e76ee 29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
mkersh3 0:e7ca326e76ee 30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
mkersh3 0:e7ca326e76ee 31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
mkersh3 0:e7ca326e76ee 32 * POSSIBILITY OF SUCH DAMAGE.
mkersh3 0:e7ca326e76ee 33 *---------------------------------------------------------------------------*/
mkersh3 0:e7ca326e76ee 34
mkersh3 0:e7ca326e76ee 35 #include "rt_TypeDef.h"
mkersh3 0:e7ca326e76ee 36 #include "RTX_Config.h"
mkersh3 0:e7ca326e76ee 37 #include "rt_System.h"
mkersh3 0:e7ca326e76ee 38 #include "rt_Task.h"
mkersh3 0:e7ca326e76ee 39 #include "rt_List.h"
mkersh3 0:e7ca326e76ee 40 #include "rt_MemBox.h"
mkersh3 0:e7ca326e76ee 41 #include "rt_Robin.h"
mkersh3 0:e7ca326e76ee 42 #include "rt_HAL_CM.h"
mkersh3 0:e7ca326e76ee 43
mkersh3 0:e7ca326e76ee 44 /*----------------------------------------------------------------------------
mkersh3 0:e7ca326e76ee 45 * Global Variables
mkersh3 0:e7ca326e76ee 46 *---------------------------------------------------------------------------*/
mkersh3 0:e7ca326e76ee 47
mkersh3 0:e7ca326e76ee 48 /* Running and next task info. */
mkersh3 0:e7ca326e76ee 49 struct OS_TSK os_tsk;
mkersh3 0:e7ca326e76ee 50
mkersh3 0:e7ca326e76ee 51 /* Task Control Blocks of idle demon */
mkersh3 0:e7ca326e76ee 52 struct OS_TCB os_idle_TCB;
mkersh3 0:e7ca326e76ee 53
mkersh3 0:e7ca326e76ee 54
mkersh3 0:e7ca326e76ee 55 /*----------------------------------------------------------------------------
mkersh3 0:e7ca326e76ee 56 * Local Functions
mkersh3 0:e7ca326e76ee 57 *---------------------------------------------------------------------------*/
mkersh3 0:e7ca326e76ee 58
mkersh3 0:e7ca326e76ee 59 OS_TID rt_get_TID (void) {
mkersh3 0:e7ca326e76ee 60 U32 tid;
mkersh3 0:e7ca326e76ee 61
mkersh3 0:e7ca326e76ee 62 for (tid = 1; tid <= os_maxtaskrun; tid++) {
mkersh3 0:e7ca326e76ee 63 if (os_active_TCB[tid-1] == NULL) {
mkersh3 0:e7ca326e76ee 64 return ((OS_TID)tid);
mkersh3 0:e7ca326e76ee 65 }
mkersh3 0:e7ca326e76ee 66 }
mkersh3 0:e7ca326e76ee 67 return (0);
mkersh3 0:e7ca326e76ee 68 }
mkersh3 0:e7ca326e76ee 69
mkersh3 0:e7ca326e76ee 70 #if defined (__CC_ARM) && !defined (__MICROLIB)
mkersh3 0:e7ca326e76ee 71 /*--------------------------- __user_perthread_libspace ---------------------*/
mkersh3 0:e7ca326e76ee 72 extern void *__libspace_start;
mkersh3 0:e7ca326e76ee 73
mkersh3 0:e7ca326e76ee 74 void *__user_perthread_libspace (void) {
mkersh3 0:e7ca326e76ee 75 /* Provide a separate libspace for each task. */
mkersh3 0:e7ca326e76ee 76 if (os_tsk.run == NULL) {
mkersh3 0:e7ca326e76ee 77 /* RTX not running yet. */
mkersh3 0:e7ca326e76ee 78 return (&__libspace_start);
mkersh3 0:e7ca326e76ee 79 }
mkersh3 0:e7ca326e76ee 80 return (void *)(os_tsk.run->std_libspace);
mkersh3 0:e7ca326e76ee 81 }
mkersh3 0:e7ca326e76ee 82 #endif
mkersh3 0:e7ca326e76ee 83
mkersh3 0:e7ca326e76ee 84 /*--------------------------- rt_init_context -------------------------------*/
mkersh3 0:e7ca326e76ee 85
mkersh3 0:e7ca326e76ee 86 void rt_init_context (P_TCB p_TCB, U8 priority, FUNCP task_body) {
mkersh3 0:e7ca326e76ee 87 /* Initialize general part of the Task Control Block. */
mkersh3 0:e7ca326e76ee 88 p_TCB->cb_type = TCB;
mkersh3 0:e7ca326e76ee 89 p_TCB->state = READY;
mkersh3 0:e7ca326e76ee 90 p_TCB->prio = priority;
mkersh3 0:e7ca326e76ee 91 p_TCB->p_lnk = NULL;
mkersh3 0:e7ca326e76ee 92 p_TCB->p_rlnk = NULL;
mkersh3 0:e7ca326e76ee 93 p_TCB->p_dlnk = NULL;
mkersh3 0:e7ca326e76ee 94 p_TCB->p_blnk = NULL;
mkersh3 0:e7ca326e76ee 95 p_TCB->delta_time = 0;
mkersh3 0:e7ca326e76ee 96 p_TCB->interval_time = 0;
mkersh3 0:e7ca326e76ee 97 p_TCB->events = 0;
mkersh3 0:e7ca326e76ee 98 p_TCB->waits = 0;
mkersh3 0:e7ca326e76ee 99 p_TCB->stack_frame = 0;
mkersh3 0:e7ca326e76ee 100
mkersh3 0:e7ca326e76ee 101 rt_init_stack (p_TCB, task_body);
mkersh3 0:e7ca326e76ee 102 }
mkersh3 0:e7ca326e76ee 103
mkersh3 0:e7ca326e76ee 104
mkersh3 0:e7ca326e76ee 105 /*--------------------------- rt_switch_req ---------------------------------*/
mkersh3 0:e7ca326e76ee 106
mkersh3 0:e7ca326e76ee 107 void rt_switch_req (P_TCB p_new) {
mkersh3 0:e7ca326e76ee 108 /* Switch to next task (identified by "p_new"). */
mkersh3 0:e7ca326e76ee 109 os_tsk.new = p_new;
mkersh3 0:e7ca326e76ee 110 p_new->state = RUNNING;
mkersh3 0:e7ca326e76ee 111 DBG_TASK_SWITCH(p_new->task_id);
mkersh3 0:e7ca326e76ee 112 }
mkersh3 0:e7ca326e76ee 113
mkersh3 0:e7ca326e76ee 114
mkersh3 0:e7ca326e76ee 115 /*--------------------------- rt_dispatch -----------------------------------*/
mkersh3 0:e7ca326e76ee 116
mkersh3 0:e7ca326e76ee 117 void rt_dispatch (P_TCB next_TCB) {
mkersh3 0:e7ca326e76ee 118 /* Dispatch next task if any identified or dispatch highest ready task */
mkersh3 0:e7ca326e76ee 119 /* "next_TCB" identifies a task to run or has value NULL (=no next task) */
mkersh3 0:e7ca326e76ee 120 if (next_TCB == NULL) {
mkersh3 0:e7ca326e76ee 121 /* Running task was blocked: continue with highest ready task */
mkersh3 0:e7ca326e76ee 122 next_TCB = rt_get_first (&os_rdy);
mkersh3 0:e7ca326e76ee 123 rt_switch_req (next_TCB);
mkersh3 0:e7ca326e76ee 124 }
mkersh3 0:e7ca326e76ee 125 else {
mkersh3 0:e7ca326e76ee 126 /* Check which task continues */
mkersh3 0:e7ca326e76ee 127 if (next_TCB->prio > os_tsk.run->prio) {
mkersh3 0:e7ca326e76ee 128 /* preempt running task */
mkersh3 0:e7ca326e76ee 129 rt_put_rdy_first (os_tsk.run);
mkersh3 0:e7ca326e76ee 130 os_tsk.run->state = READY;
mkersh3 0:e7ca326e76ee 131 rt_switch_req (next_TCB);
mkersh3 0:e7ca326e76ee 132 }
mkersh3 0:e7ca326e76ee 133 else {
mkersh3 0:e7ca326e76ee 134 /* put next task into ready list, no task switch takes place */
mkersh3 0:e7ca326e76ee 135 next_TCB->state = READY;
mkersh3 0:e7ca326e76ee 136 rt_put_prio (&os_rdy, next_TCB);
mkersh3 0:e7ca326e76ee 137 }
mkersh3 0:e7ca326e76ee 138 }
mkersh3 0:e7ca326e76ee 139 }
mkersh3 0:e7ca326e76ee 140
mkersh3 0:e7ca326e76ee 141
mkersh3 0:e7ca326e76ee 142 /*--------------------------- rt_block --------------------------------------*/
mkersh3 0:e7ca326e76ee 143
mkersh3 0:e7ca326e76ee 144 void rt_block (U16 timeout, U8 block_state) {
mkersh3 0:e7ca326e76ee 145 /* Block running task and choose next ready task. */
mkersh3 0:e7ca326e76ee 146 /* "timeout" sets a time-out value or is 0xffff (=no time-out). */
mkersh3 0:e7ca326e76ee 147 /* "block_state" defines the appropriate task state */
mkersh3 0:e7ca326e76ee 148 P_TCB next_TCB;
mkersh3 0:e7ca326e76ee 149
mkersh3 0:e7ca326e76ee 150 if (timeout) {
mkersh3 0:e7ca326e76ee 151 if (timeout < 0xffff) {
mkersh3 0:e7ca326e76ee 152 rt_put_dly (os_tsk.run, timeout);
mkersh3 0:e7ca326e76ee 153 }
mkersh3 0:e7ca326e76ee 154 os_tsk.run->state = block_state;
mkersh3 0:e7ca326e76ee 155 next_TCB = rt_get_first (&os_rdy);
mkersh3 0:e7ca326e76ee 156 rt_switch_req (next_TCB);
mkersh3 0:e7ca326e76ee 157 }
mkersh3 0:e7ca326e76ee 158 }
mkersh3 0:e7ca326e76ee 159
mkersh3 0:e7ca326e76ee 160
mkersh3 0:e7ca326e76ee 161 /*--------------------------- rt_tsk_pass -----------------------------------*/
mkersh3 0:e7ca326e76ee 162
mkersh3 0:e7ca326e76ee 163 void rt_tsk_pass (void) {
mkersh3 0:e7ca326e76ee 164 /* Allow tasks of same priority level to run cooperatively.*/
mkersh3 0:e7ca326e76ee 165 P_TCB p_new;
mkersh3 0:e7ca326e76ee 166
mkersh3 0:e7ca326e76ee 167 p_new = rt_get_same_rdy_prio();
mkersh3 0:e7ca326e76ee 168 if (p_new != NULL) {
mkersh3 0:e7ca326e76ee 169 rt_put_prio ((P_XCB)&os_rdy, os_tsk.run);
mkersh3 0:e7ca326e76ee 170 os_tsk.run->state = READY;
mkersh3 0:e7ca326e76ee 171 rt_switch_req (p_new);
mkersh3 0:e7ca326e76ee 172 }
mkersh3 0:e7ca326e76ee 173 }
mkersh3 0:e7ca326e76ee 174
mkersh3 0:e7ca326e76ee 175
mkersh3 0:e7ca326e76ee 176 /*--------------------------- rt_tsk_self -----------------------------------*/
mkersh3 0:e7ca326e76ee 177
mkersh3 0:e7ca326e76ee 178 OS_TID rt_tsk_self (void) {
mkersh3 0:e7ca326e76ee 179 /* Return own task identifier value. */
mkersh3 0:e7ca326e76ee 180 if (os_tsk.run == NULL) {
mkersh3 0:e7ca326e76ee 181 return (0);
mkersh3 0:e7ca326e76ee 182 }
mkersh3 0:e7ca326e76ee 183 return (os_tsk.run->task_id);
mkersh3 0:e7ca326e76ee 184 }
mkersh3 0:e7ca326e76ee 185
mkersh3 0:e7ca326e76ee 186
mkersh3 0:e7ca326e76ee 187 /*--------------------------- rt_tsk_prio -----------------------------------*/
mkersh3 0:e7ca326e76ee 188
mkersh3 0:e7ca326e76ee 189 OS_RESULT rt_tsk_prio (OS_TID task_id, U8 new_prio) {
mkersh3 0:e7ca326e76ee 190 /* Change execution priority of a task to "new_prio". */
mkersh3 0:e7ca326e76ee 191 P_TCB p_task;
mkersh3 0:e7ca326e76ee 192
mkersh3 0:e7ca326e76ee 193 if (task_id == 0) {
mkersh3 0:e7ca326e76ee 194 /* Change execution priority of calling task. */
mkersh3 0:e7ca326e76ee 195 os_tsk.run->prio = new_prio;
mkersh3 0:e7ca326e76ee 196 run:if (rt_rdy_prio() > new_prio) {
mkersh3 0:e7ca326e76ee 197 rt_put_prio (&os_rdy, os_tsk.run);
mkersh3 0:e7ca326e76ee 198 os_tsk.run->state = READY;
mkersh3 0:e7ca326e76ee 199 rt_dispatch (NULL);
mkersh3 0:e7ca326e76ee 200 }
mkersh3 0:e7ca326e76ee 201 return (OS_R_OK);
mkersh3 0:e7ca326e76ee 202 }
mkersh3 0:e7ca326e76ee 203
mkersh3 0:e7ca326e76ee 204 /* Find the task in the "os_active_TCB" array. */
mkersh3 0:e7ca326e76ee 205 if (task_id > os_maxtaskrun || os_active_TCB[task_id-1] == NULL) {
mkersh3 0:e7ca326e76ee 206 /* Task with "task_id" not found or not started. */
mkersh3 0:e7ca326e76ee 207 return (OS_R_NOK);
mkersh3 0:e7ca326e76ee 208 }
mkersh3 0:e7ca326e76ee 209 p_task = os_active_TCB[task_id-1];
mkersh3 0:e7ca326e76ee 210 p_task->prio = new_prio;
mkersh3 0:e7ca326e76ee 211 if (p_task == os_tsk.run) {
mkersh3 0:e7ca326e76ee 212 goto run;
mkersh3 0:e7ca326e76ee 213 }
mkersh3 0:e7ca326e76ee 214 rt_resort_prio (p_task);
mkersh3 0:e7ca326e76ee 215 if (p_task->state == READY) {
mkersh3 0:e7ca326e76ee 216 /* Task enqueued in a ready list. */
mkersh3 0:e7ca326e76ee 217 p_task = rt_get_first (&os_rdy);
mkersh3 0:e7ca326e76ee 218 rt_dispatch (p_task);
mkersh3 0:e7ca326e76ee 219 }
mkersh3 0:e7ca326e76ee 220 return (OS_R_OK);
mkersh3 0:e7ca326e76ee 221 }
mkersh3 0:e7ca326e76ee 222
mkersh3 0:e7ca326e76ee 223 /*--------------------------- rt_tsk_delete ---------------------------------*/
mkersh3 0:e7ca326e76ee 224
mkersh3 0:e7ca326e76ee 225 OS_RESULT rt_tsk_delete (OS_TID task_id) {
mkersh3 0:e7ca326e76ee 226 /* Terminate the task identified with "task_id". */
mkersh3 0:e7ca326e76ee 227 P_TCB task_context;
mkersh3 0:e7ca326e76ee 228
mkersh3 0:e7ca326e76ee 229 if (task_id == 0 || task_id == os_tsk.run->task_id) {
mkersh3 0:e7ca326e76ee 230 /* Terminate itself. */
mkersh3 0:e7ca326e76ee 231 os_tsk.run->state = INACTIVE;
mkersh3 0:e7ca326e76ee 232 os_tsk.run->tsk_stack = rt_get_PSP ();
mkersh3 0:e7ca326e76ee 233 rt_stk_check ();
mkersh3 0:e7ca326e76ee 234 os_active_TCB[os_tsk.run->task_id-1] = NULL;
mkersh3 0:e7ca326e76ee 235
mkersh3 0:e7ca326e76ee 236 os_tsk.run->stack = NULL;
mkersh3 0:e7ca326e76ee 237 DBG_TASK_NOTIFY(os_tsk.run, __FALSE);
mkersh3 0:e7ca326e76ee 238 os_tsk.run = NULL;
mkersh3 0:e7ca326e76ee 239 rt_dispatch (NULL);
mkersh3 0:e7ca326e76ee 240 /* The program should never come to this point. */
mkersh3 0:e7ca326e76ee 241 }
mkersh3 0:e7ca326e76ee 242 else {
mkersh3 0:e7ca326e76ee 243 /* Find the task in the "os_active_TCB" array. */
mkersh3 0:e7ca326e76ee 244 if (task_id > os_maxtaskrun || os_active_TCB[task_id-1] == NULL) {
mkersh3 0:e7ca326e76ee 245 /* Task with "task_id" not found or not started. */
mkersh3 0:e7ca326e76ee 246 return (OS_R_NOK);
mkersh3 0:e7ca326e76ee 247 }
mkersh3 0:e7ca326e76ee 248 task_context = os_active_TCB[task_id-1];
mkersh3 0:e7ca326e76ee 249 rt_rmv_list (task_context);
mkersh3 0:e7ca326e76ee 250 rt_rmv_dly (task_context);
mkersh3 0:e7ca326e76ee 251 os_active_TCB[task_id-1] = NULL;
mkersh3 0:e7ca326e76ee 252
mkersh3 0:e7ca326e76ee 253 task_context->stack = NULL;
mkersh3 0:e7ca326e76ee 254 DBG_TASK_NOTIFY(task_context, __FALSE);
mkersh3 0:e7ca326e76ee 255 }
mkersh3 0:e7ca326e76ee 256 return (OS_R_OK);
mkersh3 0:e7ca326e76ee 257 }
mkersh3 0:e7ca326e76ee 258
mkersh3 0:e7ca326e76ee 259
mkersh3 0:e7ca326e76ee 260 /*--------------------------- rt_sys_init -----------------------------------*/
mkersh3 0:e7ca326e76ee 261 void rt_sys_init (void) {
mkersh3 0:e7ca326e76ee 262 /* Initialize system and start up task declared with "first_task". */
mkersh3 0:e7ca326e76ee 263 U32 i;
mkersh3 0:e7ca326e76ee 264
mkersh3 0:e7ca326e76ee 265 DBG_INIT();
mkersh3 0:e7ca326e76ee 266
mkersh3 0:e7ca326e76ee 267 /* Initialize dynamic memory and task TCB pointers to NULL. */
mkersh3 0:e7ca326e76ee 268 for (i = 0; i < os_maxtaskrun; i++) {
mkersh3 0:e7ca326e76ee 269 os_active_TCB[i] = NULL;
mkersh3 0:e7ca326e76ee 270 }
mkersh3 0:e7ca326e76ee 271
mkersh3 0:e7ca326e76ee 272 /* Set up TCB of idle demon */
mkersh3 0:e7ca326e76ee 273 os_idle_TCB.task_id = 255;
mkersh3 0:e7ca326e76ee 274 os_idle_TCB.priv_stack = idle_task_stack_size;
mkersh3 0:e7ca326e76ee 275 os_idle_TCB.stack = idle_task_stack;
mkersh3 0:e7ca326e76ee 276 rt_init_context (&os_idle_TCB, 0, os_idle_demon);
mkersh3 0:e7ca326e76ee 277
mkersh3 0:e7ca326e76ee 278 /* Set up ready list: initially empty */
mkersh3 0:e7ca326e76ee 279 os_rdy.cb_type = HCB;
mkersh3 0:e7ca326e76ee 280 os_rdy.p_lnk = NULL;
mkersh3 0:e7ca326e76ee 281 /* Set up delay list: initially empty */
mkersh3 0:e7ca326e76ee 282 os_dly.cb_type = HCB;
mkersh3 0:e7ca326e76ee 283 os_dly.p_dlnk = NULL;
mkersh3 0:e7ca326e76ee 284 os_dly.p_blnk = NULL;
mkersh3 0:e7ca326e76ee 285 os_dly.delta_time = 0;
mkersh3 0:e7ca326e76ee 286
mkersh3 0:e7ca326e76ee 287 /* Fix SP and systemvariables to assume idle task is running */
mkersh3 0:e7ca326e76ee 288 /* Transform main program into idle task by assuming idle TCB */
mkersh3 0:e7ca326e76ee 289 os_tsk.run = &os_idle_TCB;
mkersh3 0:e7ca326e76ee 290 os_tsk.run->state = RUNNING;
mkersh3 0:e7ca326e76ee 291
mkersh3 0:e7ca326e76ee 292 /* Initialize ps queue */
mkersh3 0:e7ca326e76ee 293 os_psq->first = 0;
mkersh3 0:e7ca326e76ee 294 os_psq->last = 0;
mkersh3 0:e7ca326e76ee 295 os_psq->size = os_fifo_size;
mkersh3 0:e7ca326e76ee 296
mkersh3 0:e7ca326e76ee 297 rt_init_robin ();
mkersh3 0:e7ca326e76ee 298
mkersh3 0:e7ca326e76ee 299 /* Intitialize SVC and PendSV */
mkersh3 0:e7ca326e76ee 300 rt_svc_init ();
mkersh3 0:e7ca326e76ee 301 }
mkersh3 0:e7ca326e76ee 302
mkersh3 0:e7ca326e76ee 303
mkersh3 0:e7ca326e76ee 304 /*--------------------------- rt_sys_start ----------------------------------*/
mkersh3 0:e7ca326e76ee 305 void rt_sys_start (void) {
mkersh3 0:e7ca326e76ee 306 /* Start system */
mkersh3 0:e7ca326e76ee 307
mkersh3 0:e7ca326e76ee 308 /* Intitialize and start system clock timer */
mkersh3 0:e7ca326e76ee 309 os_tick_irqn = os_tick_init ();
mkersh3 0:e7ca326e76ee 310 if (os_tick_irqn >= 0) {
mkersh3 0:e7ca326e76ee 311 OS_X_INIT(os_tick_irqn);
mkersh3 0:e7ca326e76ee 312 }
mkersh3 0:e7ca326e76ee 313 }
mkersh3 0:e7ca326e76ee 314
mkersh3 0:e7ca326e76ee 315 /*----------------------------------------------------------------------------
mkersh3 0:e7ca326e76ee 316 * end of file
mkersh3 0:e7ca326e76ee 317 *---------------------------------------------------------------------------*/