NRF: receive, ntp, Data to Sd-card working

Dependencies:   F7_Ethernet mbed BSP_DISCO_F746NG Test_Mainboard SDFileSystem RF24

Committer:
lowlowry
Date:
Sun Jun 20 13:48:06 2021 +0000
Revision:
4:5ecb71f149bf
Parent:
0:d984976f1f1c
NRF: receive, ntp, Data to Sd-card working

Who changed what in which revision?

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