Loading...
Searching...
No Matches
os.h File Reference

mynewt-core error types More...

Detailed Description

mynewt-core error types

Definition in file os.h.

#include <assert.h>
#include <stdint.h>
#include "irq.h"
#include "os/os_types.h"
#include "os/os_error.h"
#include "os/endian.h"
#include "os/os_callout.h"
#include "os/os_cputime.h"
#include "os/os_dev.h"
#include "os/os_eventq.h"
#include "os/os_mbuf.h"
#include "os/os_mempool.h"
#include "os/os_mutex.h"
#include "os/os_sem.h"
#include "os/os_task.h"
#include "os/os_time.h"
#include "os/os_trace_api.h"
#include "os/queue.h"
+ Include dependency graph for os.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef uint32_t os_sr_t
 CPU status register.
 

Functions

static uint32_t os_hw_enter_critical (void)
 Disable ISRs.
 
static void os_hw_exit_critical (uint32_t ctx)
 Restores ISR context.
 
static bool os_hw_is_in_critical (void)
 Check if is in critical section.
 

MyNewt os/%.h required macros

PLEASE NOTE: Following macro definitions where copied directly from apache/mynewt-core and are under the copyright specified in the header.

#define min(a, b)
 
#define max(a, b)
 
#define OS_ALIGN(__n, __a)
 
#define OS_ALIGNMENT   (4)
 

Entering and exiting critical section defines

#define OS_ENTER_CRITICAL(_sr)
 
#define OS_EXIT_CRITICAL(_sr)
 
#define OS_ASSERT_CRITICAL()
 

Macro Definition Documentation

◆ max

#define max ( a,
b )
Value:
((a)>(b)?(a):(b))

Definition at line 43 of file os.h.

◆ min

#define min ( a,
b )
Value:
((a)<(b)?(a):(b))

Definition at line 39 of file os.h.

◆ OS_ALIGN

#define OS_ALIGN ( __n,
__a )
Value:
( \
(((__n) & ((__a) - 1)) == 0) ? \
(__n) : \
((__n) + ((__a) - ((__n) & ((__a) - 1)))) \
)

Definition at line 46 of file os.h.

◆ OS_ALIGNMENT

#define OS_ALIGNMENT   (4)

Definition at line 51 of file os.h.

◆ OS_ASSERT_CRITICAL

#define OS_ASSERT_CRITICAL ( )
Value:
#define assert(cond)
abort the program if assertion is false
Definition assert.h:143
static bool os_hw_is_in_critical(void)
Check if is in critical section.
Definition os.h:94

Definition at line 65 of file os.h.

◆ OS_ENTER_CRITICAL

#define OS_ENTER_CRITICAL ( _sr)
Value:
static uint32_t os_hw_enter_critical(void)
Disable ISRs.
Definition os.h:73

Definition at line 63 of file os.h.

◆ OS_EXIT_CRITICAL

#define OS_EXIT_CRITICAL ( _sr)
Value:
static void os_hw_exit_critical(uint32_t ctx)
Restores ISR context.
Definition os.h:84

Definition at line 64 of file os.h.

Typedef Documentation

◆ os_sr_t

typedef uint32_t os_sr_t

CPU status register.

Definition at line 57 of file os.h.

Function Documentation

◆ os_hw_enter_critical()

static uint32_t os_hw_enter_critical ( void )
inlinestatic

Disable ISRs.

Returns
current isr context

Definition at line 73 of file os.h.

◆ os_hw_exit_critical()

static void os_hw_exit_critical ( uint32_t ctx)
inlinestatic

Restores ISR context.

Parameters
[in]ctxISR context to restore.

Definition at line 84 of file os.h.

◆ os_hw_is_in_critical()

static bool os_hw_is_in_critical ( void )
inlinestatic

Check if is in critical section.

Returns
true, if in critical section, false otherwise

Definition at line 94 of file os.h.