Skip to content

Commit

Permalink
updated c++ wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
rajszym committed Nov 20, 2018
1 parent 6c54169 commit 5aa87d4
Show file tree
Hide file tree
Showing 20 changed files with 89 additions and 102 deletions.
1 change: 1 addition & 0 deletions StateOS/README
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Features:
- modified context structures
- added dynamic tasks
- added create/destroy functions to c++ wrapper
- updated c++ wrapper
---------
6.3
- merged test branch
Expand Down
10 changes: 5 additions & 5 deletions StateOS/kernel/inc/osbarrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: osbarrier.h
@author Rajmund Szymanski
@date 16.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -34,10 +34,6 @@

#include "oskernel.h"

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : barrier
Expand All @@ -54,6 +50,10 @@ struct __bar
unsigned limit; // limit of tasks blocked on the barrier object
};

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : _BAR_INIT
Expand Down
10 changes: 5 additions & 5 deletions StateOS/kernel/inc/osconditionvariable.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: osconditionvariable.h
@author Rajmund Szymanski
@date 16.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -35,10 +35,6 @@
#include "oskernel.h"
#include "osmutex.h"

#ifdef __cplusplus
extern "C" {
#endif

/* -------------------------------------------------------------------------- */

#define cndOne ( false ) // notify one task
Expand All @@ -58,6 +54,10 @@ struct __cnd
obj_t obj; // object header
};

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : _CND_INIT
Expand Down
10 changes: 5 additions & 5 deletions StateOS/kernel/inc/osevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: osevent.h
@author Rajmund Szymanski
@date 16.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -34,10 +34,6 @@

#include "oskernel.h"

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : event
Expand All @@ -51,6 +47,10 @@ struct __evt
obj_t obj; // object header
};

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : _EVT_INIT
Expand Down
10 changes: 4 additions & 6 deletions StateOS/kernel/inc/oseventqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@

#include "oskernel.h"

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : event queue
Expand All @@ -59,14 +55,16 @@ struct __evq
};

#ifdef __cplusplus
}
template<unsigned limit_>
struct evq_T { evq_t evq; unsigned buf[limit_]; };
extern "C" {
#else
struct evq_T { evq_t evq; unsigned buf[]; };
#endif

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : _EVQ_INIT
Expand Down
10 changes: 5 additions & 5 deletions StateOS/kernel/inc/osfastmutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: osfastmutex.h
@author Rajmund Szymanski
@date 16.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -34,10 +34,6 @@

#include "oskernel.h"

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : fast mutex (error checking)
Expand All @@ -55,6 +51,10 @@ struct __mut
tsk_t * owner; // mutex owner
};

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : _MUT_INIT
Expand Down
10 changes: 5 additions & 5 deletions StateOS/kernel/inc/osflag.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: osflag.h
@author Rajmund Szymanski
@date 16.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -34,10 +34,6 @@

#include "oskernel.h"

#ifdef __cplusplus
extern "C" {
#endif

/* -------------------------------------------------------------------------- */

#define flgAny 0
Expand Down Expand Up @@ -66,6 +62,10 @@ struct __flg
unsigned flags; // pending flags
};

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : _FLG_INIT
Expand Down
10 changes: 4 additions & 6 deletions StateOS/kernel/inc/osjobqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
#include "oskernel.h"
#include "osmailboxqueue.h"

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : job queue
Expand All @@ -60,14 +56,16 @@ struct __job
};

#ifdef __cplusplus
}
template<unsigned limit_>
struct job_T { job_t job; fun_t *buf[limit_]; };
extern "C" {
#else
struct job_T { job_t job; fun_t *buf[]; };
#endif

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : _JOB_INIT
Expand Down
10 changes: 5 additions & 5 deletions StateOS/kernel/inc/oslist.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: oslist.h
@author Rajmund Szymanski
@date 16.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -34,10 +34,6 @@

#include "oskernel.h"

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : queue
Expand All @@ -51,6 +47,10 @@ struct __que
que_t * next; // next object in the queue
};

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : _QUE_INIT
Expand Down
10 changes: 4 additions & 6 deletions StateOS/kernel/inc/osmailboxqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@

#include "oskernel.h"

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : mailbox queue
Expand All @@ -60,14 +56,16 @@ struct __box
};

#ifdef __cplusplus
}
template<unsigned limit_, unsigned size_>
struct box_T { box_t box; char buf[limit_ * size_]; };
extern "C" {
#else
struct box_T { box_t box; char buf[]; };
#endif

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : _BOX_INIT
Expand Down
10 changes: 4 additions & 6 deletions StateOS/kernel/inc/osmemorypool.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
#include "oskernel.h"
#include "oslist.h"

#ifdef __cplusplus
extern "C" {
#endif

/* -------------------------------------------------------------------------- */

#define MEM_SIZE( size ) \
Expand All @@ -62,14 +58,16 @@ struct __mem
};

#ifdef __cplusplus
}
template<unsigned limit_, unsigned size_>
struct mem_T { mem_t mem; que_t buf[limit_ * (1 + MEM_SIZE(size_))]; };
extern "C" {
#else
struct mem_T { mem_t mem; que_t buf[]; };
#endif

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : _MEM_INIT
Expand Down
10 changes: 4 additions & 6 deletions StateOS/kernel/inc/osmessagebuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@

#include "oskernel.h"

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : message buffer
Expand All @@ -59,14 +55,16 @@ struct __msg
};

#ifdef __cplusplus
}
template<unsigned limit_>
struct msg_T { msg_t msg; char buf[limit_]; };
extern "C" {
#else
struct msg_T { msg_t msg; char buf[]; };
#endif

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : _MSG_INIT
Expand Down
10 changes: 5 additions & 5 deletions StateOS/kernel/inc/osmutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@file StateOS: osmutex.h
@author Rajmund Szymanski
@date 16.11.2018
@date 19.11.2018
@brief This file contains definitions for StateOS.
******************************************************************************
Expand Down Expand Up @@ -34,10 +34,6 @@

#include "oskernel.h"

#ifdef __cplusplus
extern "C" {
#endif

/* -------------------------------------------------------------------------- */

/////// mutex type
Expand Down Expand Up @@ -84,6 +80,10 @@ struct __mtx
mtx_t * list; // list of mutexes held by owner
};

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* Name : _MTX_INIT
Expand Down
Loading

0 comments on commit 5aa87d4

Please sign in to comment.