added k60d100m project
[adk-bluetooth-test.git] / adk-stack / adapter / os_utils.h
blob59888492131ca8c4d4efcc7f473d47ace2889c55
2 #ifndef OS_UTILS_H
3 #define OS_UTILS_H
4 /*
5 #include <ctype.h>
6 #include <string.h>
7 #include <stdlib.h>
8 */
9 #include <mqx.h>
10 #include <bsp.h>
12 #include "lwevent.h"
13 #include "lwmsgq.h"
14 #include "mutex.h"
15 #include "lwsem.h"
16 _mqx_uint _lwmsgq_deinit(pointer location);
18 #include "dbg.h"
20 #if _DEBUG == 1
21 //#define OS_DEBUG
22 #endif
24 /* build */
25 typedef int ssize_t;
26 typedef void * HANDLE;
27 typedef int BOOL;
28 //gcc4
29 #define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
30 #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
32 //-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
33 #define container_of(ptr, type, member) ({ \
34 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
35 (type *)( (char *)__mptr - offsetof(type,member) );})
38 #define INT_DISABLE() _int_disable()
39 #define INT_ENABLE() _int_enable()
41 /* building ***************************************************/
43 /* os function */
44 #if MQX_USE_UNCACHED_MEM && PSP_HAS_DATA_CACHE
45 #define os_mem_alloc_uncached(n) _mem_alloc_system_uncached(n)
46 #define os_mem_alloc_uncached_zero(n) _mem_alloc_system_zero_uncached(n)
47 #define os_mem_alloc_uncached_align(n,a) _mem_alloc_align_uncached(n,a)
48 #else
49 #define os_mem_alloc_uncached(n) _mem_alloc_system(n)
50 #define os_mem_alloc_uncached_zero(n) _mem_alloc_system_zero(n)
51 #define os_mem_alloc_uncached_align(n,a) _mem_alloc_align(n,a)
52 #endif /* PSP_HAS_DATA_CACHE */
54 #define os_mem_alloc(n) _mem_alloc_system(n)
55 #define os_mem_alloc_zero(n) _mem_alloc_system_zero(n)
56 #define os_mem_free(ptr) _mem_free(ptr)
57 #define os_mem_zero(ptr,n) _mem_zero(ptr,n)
58 #define os_mem_copy(src,dst,n) _mem_copy(src,dst,n)
60 #define os_memcpy memcpy
61 #define os_memset memset
63 //#define os_malloc _mem_alloc_system
64 static inline void * os_malloc(unsigned int y)
66 int align_len = (y & 3) ? y + (4 - (y & 3)) : y;
67 if(y == 0) {
68 printf("os_malloc size 0\n");
69 // ??? dbgPrintf("SDP: Failed to allocate flattened result array (%ub)\n", sg_length(resultSoFar));
70 //align_len = 4; // align_len
71 return NULL;
73 return /*_mem_alloc_system*/_mem_alloc_system_zero(align_len);
76 //#define os_free _mem_free
77 static inline void os_free(void * x)
79 if(x == NULL)
80 printf("os_free NULL pointer\n");
81 else
82 _mem_free(x);
85 #define os_zalloc os_mem_alloc_zero
86 static inline void * os_realloc(void * x, unsigned int y)
88 int align_len = (y & 3) ? y + (4 - (y & 3)) : y;
89 if(x == NULL) {
90 printf("os_realloc NULL pointer\n");
91 return NULL;
93 void * addr = _mem_alloc_system(align_len);
94 if(addr)
95 memcpy(addr, x, y);
96 _mem_free(x);
97 return addr;
100 #define malloc(x) \
101 os_malloc(x)
103 #define free(x) \
104 os_free(x)
106 #define realloc(x,y) \
107 os_realloc(x,y)
110 /* misc */
113 /* debug message */
114 #define __stringify_1(x...) #x
115 #define __stringify(x...) __stringify_1(x)
117 #define halt() do { for(;;); } while (0)
118 #define ASSERT(x) do { if (!(x)) { /*dbgPrintf*/printf("%s:%d ASSERT failed: %s\n", __FILE__, __LINE__, #x); halt(); } } while (0)
120 #if defined(OS_DEBUG)
121 #define pr_debug(fmt, ...) \
122 printf(pr_fmt(fmt), ##__VA_ARGS__)
123 #define pr_warning(fmt, ...) \
124 printf(pr_fmt(fmt), ##__VA_ARGS__)
125 #define pr_warn pr_warning
126 #define os_printf(fmt, ...) \
127 printf(pr_fmt(fmt), ##__VA_ARGS__)
128 #else
129 #define pr_debug(fmt, ...)
130 #define pr_warning(fmt, ...)
131 #define pr_warn
132 #define os_printf(fmt, ...)
133 #endif
135 #ifndef pr_fmt
136 #define pr_fmt(fmt) fmt
137 #endif
139 #define pr_err(fmt, ...) \
140 printf(pr_fmt(fmt), ##__VA_ARGS__)
142 #define USHRT_MAX ((u16)(~0U))
143 #define SHRT_MAX ((s16)(USHRT_MAX>>1))
144 #define SHRT_MIN ((s16)(-SHRT_MAX - 1))
145 #define INT_MAX ((int)(~0U>>1))
146 #define INT_MIN (-INT_MAX - 1)
147 #define UINT_MAX (~0U)
148 #define LONG_MAX ((long)(~0UL>>1))
149 #define LONG_MIN (-LONG_MAX - 1)
150 #define ULONG_MAX (~0UL)
151 #define LLONG_MAX ((long long)(~0ULL>>1))
152 #define LLONG_MIN (-LLONG_MAX - 1)
153 #define ULLONG_MAX (~0ULL)
155 #ifndef min
156 #define min(x, y) (x < y ? x : y)
157 #endif
158 #ifndef max
159 #define max(x, y) (x > y ? x : y)
160 #endif
162 #define ULONG_MAX (~0UL)
163 #define LONG_MAX ((long)(~0UL>>1))
165 /* building ***************************************************/
166 #if 0
167 static inline uint8_t ffs(unsigned int val)
169 int i;
170 for(i = 0; i < 32; i++) {
171 if(val & (1<< i))
172 break;
175 if(i < 32)
176 return i + 1;
177 else
178 return 0;
180 #endif
182 static inline int
183 test_bit(unsigned int bit, volatile unsigned long *p)
185 //unsigned long flags;
186 unsigned int res;
187 unsigned long mask = 1UL << (bit & 31);
189 p += bit >> 5;
191 res = *p;
193 return (res & mask) != 0;
196 static inline void set_bit(unsigned int bit, volatile unsigned long *p)
198 //unsigned long flags;
199 unsigned long mask = 1UL << (bit & 31);
201 p += bit >> 5;
203 *p |= mask;
206 static inline void clear_bit(unsigned int bit, volatile unsigned long *p)
208 //unsigned long flags;
209 unsigned long mask = 1UL << (bit & 31);
211 p += bit >> 5;
213 *p &= ~mask;
216 static inline void change_bit(unsigned int bit, volatile unsigned long *p)
218 //unsigned long flags;
219 unsigned long mask = 1UL << (bit & 31);
221 p += bit >> 5;
223 *p ^= mask;
226 static inline int
227 test_and_set_bit(unsigned int bit, volatile unsigned long *p)
229 //unsigned long flags;
230 unsigned int res;
231 unsigned long mask = 1UL << (bit & 31);
233 p += bit >> 5;
235 res = *p;
236 *p = res | mask;
238 return (res & mask) != 0;
241 static inline int
242 test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
244 //unsigned long flags;
245 unsigned int res;
246 unsigned long mask = 1UL << (bit & 31);
248 p += bit >> 5;
250 res = *p;
251 *p = res & ~mask;
253 return (res & mask) != 0;
256 static inline int
257 test_and_change_bit(unsigned int bit, volatile unsigned long *p)
259 //unsigned long flags;
260 unsigned int res;
261 unsigned long mask = 1UL << (bit & 31);
263 p += bit >> 5;
265 res = *p;
266 *p = res ^ mask;
268 return (res & mask) != 0;
272 //#define FIXED_USE_DYNAMIC
273 //#define DEBUG_FIXED_MEM
275 #define MAX_FIXED_MEM_BLOCKS 32 /* only support 32 blocks */
277 typedef struct _fixed_mem {
278 unsigned short mem_blocks;
279 unsigned short mem_bsize; /* size of blocks for fixed mem , little than 64K */
280 // only for debug
281 #ifdef DEBUG_FIXED_MEM
282 unsigned int allocated_blocks;
283 #endif
285 unsigned long mem_map[MAX_FIXED_MEM_BLOCKS/sizeof(unsigned long)];
286 unsigned char mem_ptr[1];
287 } fixed_mem_t;
290 typedef void * fixed_mem_id_t;
293 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) /* + __must_be_array(arr) */)
297 static inline fixed_mem_id_t os_alloc_fixed_mem(unsigned int blocksize, unsigned int count)
299 fixed_mem_id_t fmem_id;
300 int align_len = blocksize + (4 - (blocksize & 3));
302 ASSERT((count > 0) && (count <= MAX_FIXED_MEM_BLOCKS));
304 #ifdef FIXED_USE_DYNAMIC
305 fmem_id = (fixed_mem_id_t)os_mem_alloc_zero(offsetof(fixed_mem_t, mem_ptr) + 0);
306 #else
307 fmem_id = (fixed_mem_id_t)os_mem_alloc_zero(offsetof(fixed_mem_t, mem_ptr) + (align_len * count));
308 #endif
309 ((fixed_mem_t *)fmem_id)->mem_blocks = count;
310 ((fixed_mem_t *)fmem_id)->mem_bsize = align_len;
312 #ifdef DEBUG_FIXED_MEM
313 ((fixed_mem_t *)fmem_id)->allocated_blocks = 0;
314 #endif
316 return fmem_id;
319 static inline void * os_get_fixed(fixed_mem_id_t fid)
321 void * result_fixed = NULL;
322 #ifdef FIXED_USE_DYNAMIC
323 result_fixed == os_mem_alloc( ((fixed_mem_t *)fid)->mem_bsize);
324 #else
325 int i,j;
326 INT_DISABLE();
327 j = ((fixed_mem_t *)fid)->mem_blocks;
328 for(i = 0; i < j; i++) {
329 if(!test_bit(i, ((fixed_mem_t *)fid)->mem_map)) {
330 break;
334 if(i < ((fixed_mem_t *)fid)->mem_blocks) {
335 set_bit(i, ((fixed_mem_t *)fid)->mem_map);
336 result_fixed = (void *) ((int) (((fixed_mem_t *)fid)->mem_ptr) + i * ((fixed_mem_t *)fid)->mem_bsize);
338 else {
339 // todo
340 // if i >= mem_blocks then realloc the fixmem and alloc it.
341 result_fixed = NULL;
343 #endif
344 #ifdef DEBUG_FIXED_MEM
345 printf("get fixed 0x%x, num %d, %d\n",result_fixed, ++(((fixed_mem_t *)fid)->allocated_blocks),((fixed_mem_t *)fid)->mem_bsize);
346 #endif
347 INT_ENABLE();
348 return result_fixed;
351 static inline void os_put_fixed (void * data, fixed_mem_id_t fid)
353 #ifdef DEBUG_FIXED_MEM
354 printf("put fixed 0x%x num %d\n",(int)data,--(((fixed_mem_t *)fid)->allocated_blocks));
355 #endif
356 #ifdef FIXED_USE_DYNAMIC
357 os_mem_free(data);
358 #else
359 int i ;
360 INT_DISABLE();
361 i = ((int) data - (int) (((fixed_mem_t *)fid)->mem_ptr)) / ((fixed_mem_t *)fid)->mem_bsize;
363 ASSERT ((i >= 0) && (i < MAX_FIXED_MEM_BLOCKS ) && test_bit(i, ((fixed_mem_t *)fid)->mem_map));
364 clear_bit(i, ((fixed_mem_t *)fid)->mem_map);
365 INT_ENABLE();
366 #endif
368 static inline void os_free_fixed_mem (fixed_mem_id_t fid)
370 os_mem_free(fid);
375 /* os ,task, sem,mutex, event */
376 /**HEADER********************************************************************
378 * Copyright (c) 2013 Freescale Semiconductor;
379 * All Rights Reserved
382 ***************************************************************************
384 * THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESSED OR
385 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
386 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
387 * IN NO EVENT SHALL FREESCALE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
388 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
389 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
390 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
391 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
392 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
393 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
394 * THE POSSIBILITY OF SUCH DAMAGE.
396 **************************************************************************
398 * $FileName: osadapter_mqx.c$
399 * $Version :
400 * $Date :
402 * Comments:
404 * @brief The file includes the implementation of MQX of OS adapter.
405 *****************************************************************************/
406 typedef void (* TASK_START)( void *);
407 typedef void (* OSA_INT_ISR_FPTR)(void *);
408 typedef void* OS_Event_handle;
409 typedef void* OS_MsgQ_handle;
410 typedef void* OS_GPIO_handle;
411 typedef void* OS_Mutex_handle;
412 typedef void* OS_Sem_handle;
415 #define OS_TASK_OK (0)
416 #define OS_TASK_ERROR (-1)
417 #define OS_EVENT_OK (0)
418 #define OS_EVENT_ERROR (-1)
419 #define OS_EVENT_TIMEOUT (-2)
420 #define OS_MSGQ_OK (0)
421 #define OS_MSGQ_ERROR (-1)
422 #define OS_GPIO_OK (0)
423 #define OS_GPIO_ERROR (-1)
424 #define OS_MUTEX_OK (0)
425 #define OS_MUTEX_ERROR (-1)
426 #define OS_SEM_OK (0)
427 #define OS_SEM_ERROR (-1)
428 #define OS_SEM_TIMEOUT (-2)
430 /* Block the reading task if msgq is empty */
431 #define OS_MSGQ_RECEIVE_BLOCK_ON_EMPTY (0x04)
432 static inline uint32_t OS_Task_create(TASK_START pstart, void* param, uint32_t pri, uint32_t stack_size, char* task_name, void* opt)
434 _task_id task_id;
435 TASK_TEMPLATE_STRUCT task_template;
437 task_template.TASK_TEMPLATE_INDEX = 0;
438 task_template.TASK_ADDRESS = (TASK_FPTR)pstart;
439 task_template.TASK_STACKSIZE = stack_size;
440 task_template.TASK_PRIORITY = pri;
441 task_template.TASK_NAME = task_name;
442 if (opt != NULL)
444 task_template.TASK_ATTRIBUTES = *((uint32_t*)opt);
446 else
448 task_template.TASK_ATTRIBUTES = 0;
451 task_template.CREATION_PARAMETER = (uint32_t)param;
452 task_template.DEFAULT_TIME_SLICE = 0;
454 task_id = _task_create_blocked(0, 0, (uint32_t)&task_template);
456 if (task_id == MQX_NULL_TASK_ID) {
457 return (uint32_t)OS_TASK_ERROR;
460 _task_ready(_task_get_td(task_id));
461 return (uint32_t)task_id;
464 static inline uint32_t OS_Task_delete(uint32_t task_id)
466 uint32_t ret;
467 ret = _task_destroy((_task_id)task_id);
468 if (ret != MQX_OK)
469 return (uint32_t)OS_TASK_ERROR;
470 else
471 return (uint32_t)OS_TASK_OK;
474 static inline uint32_t OS_Task_suspend(uint32_t task_id)
476 task_id = task_id;
477 _task_block();
478 return (uint32_t)OS_TASK_OK;
481 static inline uint32_t OS_Task_resume(uint32_t task_id)
483 _task_ready(_task_get_td(task_id));
484 return (uint32_t)OS_TASK_OK;
487 static inline void OS_Task_yield()
489 _sched_yield();
490 //_time_delay_ticks(2);
491 //_time_delay(1);
494 static inline OS_Event_handle OS_Event_create(uint32_t flag)
496 LWEVENT_STRUCT *event;
497 event = (LWEVENT_STRUCT*)_mem_alloc_system_zero(sizeof(LWEVENT_STRUCT));
498 if (event == NULL)
500 return NULL;
503 if (_lwevent_create(event, flag) != MQX_OK)
505 _mem_free((void*)event);
506 return NULL;
508 return (OS_Event_handle)event;
511 static inline uint32_t OS_Event_destroy(OS_Event_handle handle)
513 LWEVENT_STRUCT *event = (LWEVENT_STRUCT*)handle;
514 if(_lwevent_destroy(event) != MQX_OK)
516 _mem_free((void*)event);
517 return (uint32_t)OS_EVENT_ERROR;
519 _mem_free((void*)event);
520 return OS_EVENT_OK;
523 static inline uint32_t OS_Event_check_bit(OS_Event_handle handle, uint32_t bitmask)
525 LWEVENT_STRUCT *event = (LWEVENT_STRUCT*)handle;
526 if((event->VALUE & bitmask) != 0)
527 return 1;
528 else
529 return 0;
532 static inline uint32_t OS_Event_clear(OS_Event_handle handle, uint32_t bitmask)
534 LWEVENT_STRUCT *event = (LWEVENT_STRUCT*)handle;
535 if(_lwevent_clear(event, bitmask) != MQX_OK)
537 return (uint32_t)OS_EVENT_ERROR;
539 return (uint32_t)OS_EVENT_OK;
542 static inline uint32_t OS_Event_set(OS_Event_handle handle, uint32_t bitmask)
544 LWEVENT_STRUCT *event = (LWEVENT_STRUCT*)handle;
545 if(_lwevent_set(event, bitmask) != MQX_OK)
547 return (uint32_t)OS_EVENT_ERROR;
549 return (uint32_t)OS_EVENT_OK;
552 static inline uint32_t OS_Event_wait(OS_Event_handle handle, uint32_t bitmask, uint32_t flag, uint32_t timeout)
554 LWEVENT_STRUCT *event = (LWEVENT_STRUCT*)handle;
555 uint32_t ret;
557 ret = _lwevent_wait_ticks(event, bitmask, flag, timeout * _time_get_ticks_per_sec() / 1000);
558 //printf("os 0x%x\n", ret);
559 if(LWEVENT_WAIT_TIMEOUT == ret)
561 return (uint32_t)OS_EVENT_TIMEOUT;
563 else if(MQX_OK == ret)
565 return (uint32_t)OS_EVENT_OK;
567 return (uint32_t)OS_EVENT_ERROR;
570 static inline uint32_t OS_Event_status(OS_Event_handle handle)
572 LWEVENT_STRUCT *event = (LWEVENT_STRUCT*)handle;
573 return event->VALUE;
576 static inline OS_MsgQ_handle OS_MsgQ_create(uint32_t max_msg_number, uint32_t msg_size)
578 void* msgq;
579 uint32_t size = sizeof(LWMSGQ_STRUCT) + max_msg_number * msg_size * 4;
581 msgq = _mem_alloc_system_zero(size);
582 if (msgq == NULL)
584 return NULL;
587 if (_lwmsgq_init(msgq, max_msg_number, msg_size) != MQX_OK)
589 _mem_free(msgq);
590 return NULL;
593 return (OS_MsgQ_handle)msgq;
596 static inline uint32_t OS_MsgQ_send(OS_MsgQ_handle msgq, void* msg, uint32_t flag)
598 if (MQX_OK != _lwmsgq_send(msgq, (uint32_t *) msg, flag))
600 return (uint32_t)OS_MSGQ_ERROR;
602 return (uint32_t)OS_MSGQ_OK;
605 static inline uint32_t OS_MsgQ_recv(OS_MsgQ_handle msgq, void* msg, uint32_t flag, uint32_t timeout)
607 if (MQX_OK != _lwmsgq_receive(msgq, (uint32_t *) msg, flag, timeout, NULL))
609 return (uint32_t)OS_MSGQ_ERROR;
611 return (uint32_t)OS_MSGQ_OK;
614 static inline uint32_t OS_MsgQ_Is_Empty(OS_MsgQ_handle msgq, void* msg)
616 uint32_t ret;
617 ret = LWMSGQ_IS_EMPTY(msgq);
618 if(!ret)
620 if (MQX_OK != _lwmsgq_receive(msgq, (uint32_t *) msg, OS_MSGQ_RECEIVE_BLOCK_ON_EMPTY, 1, NULL))
622 return (uint32_t)OS_MSGQ_ERROR;
625 return ret;
628 static inline uint32_t OS_MsgQ_destroy(OS_MsgQ_handle msgq)
630 _lwmsgq_deinit(msgq);
631 _mem_free(msgq);
632 return (uint32_t)OS_MSGQ_OK;
635 static inline OS_Mutex_handle OS_Mutex_create()
637 MUTEX_STRUCT_PTR mutex = NULL;
638 mutex = _mem_alloc_system_zero(sizeof(MUTEX_STRUCT));
639 if (mutex == NULL)
641 return NULL;
643 if (_mutex_init(mutex, NULL) != MQX_OK)
645 _mem_free(mutex);
646 return NULL;
648 return (OS_Mutex_handle)mutex;
651 static inline uint32_t OS_Mutex_lock(OS_Mutex_handle mutex)
653 if (_mutex_lock((MUTEX_STRUCT_PTR)mutex) != MQX_OK)
654 return (uint32_t)OS_MUTEX_ERROR;
655 else
656 return (uint32_t)OS_MUTEX_OK;
659 static inline uint32_t OS_Mutex_unlock(OS_Mutex_handle mutex)
661 if (_mutex_unlock((MUTEX_STRUCT_PTR)mutex) != MQX_OK)
662 return (uint32_t)OS_MUTEX_ERROR;
663 else
664 return (uint32_t)OS_MUTEX_OK;
667 static inline uint32_t OS_Mutex_destroy(OS_Mutex_handle mutex)
669 _mutex_destroy((MUTEX_STRUCT_PTR)mutex);
670 _mem_free(mutex);
671 return OS_MUTEX_OK;
674 static inline OS_Sem_handle OS_Sem_create(uint32_t initial_number)
676 LWSEM_STRUCT_PTR sem = NULL;
677 sem = (LWSEM_STRUCT_PTR)_mem_alloc_system_zero(sizeof(LWSEM_STRUCT));
678 if (sem == NULL)
680 return NULL;
682 if (_lwsem_create(sem, initial_number) != MQX_OK)
684 _mem_free(sem);
685 return NULL;
687 return (OS_Sem_handle)sem;
690 static inline uint32_t OS_Sem_wait(OS_Sem_handle sem, uint32_t timeout)
692 uint32_t result = _lwsem_wait_ticks((LWSEM_STRUCT_PTR)sem, timeout);
693 if (result == MQX_LWSEM_WAIT_TIMEOUT)
695 return (uint32_t)OS_SEM_TIMEOUT;
697 else if (result == MQX_OK)
699 return (uint32_t)OS_SEM_OK;
701 else
703 return (uint32_t)OS_SEM_ERROR;
707 static inline uint32_t OS_Sem_post(OS_Sem_handle sem)
709 uint32_t result = _lwsem_post((LWSEM_STRUCT_PTR)sem);
710 if (result == MQX_OK)
712 return (uint32_t)OS_SEM_OK;
714 else
716 return (uint32_t)OS_SEM_ERROR;
720 static inline uint32_t OS_Sem_destroy(OS_Sem_handle sem)
722 uint32_t result = _lwsem_destroy((LWSEM_STRUCT_PTR)sem);
723 _mem_free(sem);
724 if (result == MQX_OK)
726 return (uint32_t)OS_SEM_OK;
728 else
730 return (uint32_t)OS_SEM_ERROR;
734 void OS_Time_delay(register uint32_t milliseconds)
736 _time_delay(milliseconds);
737 return ;
740 #endif /* OS_UTILS_H */