os_port.h File Reference

RTOS abstraction layer. More...

#include "os_port_config.h"
#include "compiler_port.h"

Go to the source code of this file.

Macros

#define ENABLED   1
 
#define DISABLED   0
 
#define PTR_OFFSET(addr, offset)   ((void *) ((uint8_t *) (addr) + (offset)))
 
#define timeCompare(t1, t2)   ((int32_t) ((t1) - (t2)))
 
#define FALSE   0
 
#define TRUE   1
 
#define LSB(x)   ((x) & 0xFF)
 
#define MSB(x)   (((x) >> 8) & 0xFF)
 
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define MAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define arraysize(a)   (sizeof(a) / sizeof(a[0]))
 
#define INFINITE_DELAY   ((uint_t) -1)
 
#define MAX_DELAY   (INFINITE_DELAY / 2)
 
#define OS_INVALID_HANDLE   NULL
 
#define usleep(delay)   {volatile uint32_t n = delay * 4; while(n > 0) n--;}
 
#define sleep(delay)   {volatile uint32_t n = delay * 4000; while(n > 0) n--;}
 

Detailed Description

RTOS abstraction layer.

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file os_port.h.

Macro Definition Documentation

◆ arraysize

#define arraysize (   a)    (sizeof(a) / sizeof(a[0]))

Definition at line 68 of file os_port.h.

◆ DISABLED

#define DISABLED   0

Definition at line 36 of file os_port.h.

◆ ENABLED

#define ENABLED   1

Definition at line 35 of file os_port.h.

◆ FALSE

#define FALSE   0

Definition at line 44 of file os_port.h.

◆ INFINITE_DELAY

#define INFINITE_DELAY   ((uint_t) -1)

Definition at line 72 of file os_port.h.

◆ LSB

#define LSB (   x)    ((x) & 0xFF)

Definition at line 52 of file os_port.h.

◆ MAX

#define MAX (   a,
  b 
)    ((a) > (b) ? (a) : (b))

Definition at line 64 of file os_port.h.

◆ MAX_DELAY

#define MAX_DELAY   (INFINITE_DELAY / 2)

Definition at line 74 of file os_port.h.

◆ MIN

#define MIN (   a,
  b 
)    ((a) < (b) ? (a) : (b))

Definition at line 60 of file os_port.h.

◆ MSB

#define MSB (   x)    (((x) >> 8) & 0xFF)

Definition at line 56 of file os_port.h.

◆ OS_INVALID_HANDLE

#define OS_INVALID_HANDLE   NULL

Definition at line 77 of file os_port.h.

◆ PTR_OFFSET

#define PTR_OFFSET (   addr,
  offset 
)    ((void *) ((uint8_t *) (addr) + (offset)))

Definition at line 38 of file os_port.h.

◆ sleep

#define sleep (   delay)    {volatile uint32_t n = delay * 4000; while(n > 0) n--;}

Definition at line 126 of file os_port.h.

◆ timeCompare

#define timeCompare (   t1,
  t2 
)    ((int32_t) ((t1) - (t2)))

Definition at line 40 of file os_port.h.

◆ TRUE

#define TRUE   1

Definition at line 48 of file os_port.h.

◆ usleep

#define usleep (   delay)    {volatile uint32_t n = delay * 4; while(n > 0) n--;}

Definition at line 122 of file os_port.h.