Skip to content

Commit

Permalink
Active Object: start documenting
Browse files Browse the repository at this point in the history
  • Loading branch information
polesskiy-dev committed Jul 30, 2023
1 parent 11db956 commit 5942a49
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Binary file modified main
Binary file not shown.
22 changes: 21 additions & 1 deletion src/active-object/active-object.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ void ACTIVE_OBJECT_BASE_Ctor(ACTIVE_OBJECT_BASE *const self, uint8_t id) {
self->id = id;
};

/**
* @def ACTIVE_OBJECT_T##_Ctor(ACTIVE_OBJECT_T *const self, STATE_T initialState, FIELDS_T fields)
*
* @brief Active Object constructor
*
* @param self Active Object
* @param initialState initial state
* @param fields User-defined fields, accommodates actual application data
*/

/**
* @brief Active object Template
*
* @param ACTIVE_OBJECT_T Active Object Type
* @param EVENT_T Event Type
* @param STATE_T State Type
* @param FIELDS_T Active Object field Type
* @param id ID value
* @param maxQueueCapacity Queue capacity value
*/
#define DECLARE_ACTIVE_OBJECT(ACTIVE_OBJECT_T, EVENT_T, STATE_T, FIELDS_T, id, maxQueueCapacity) \
\
DECLARE_QUEUE(EVENT_T, maxQueueCapacity); \
Expand Down Expand Up @@ -59,7 +79,7 @@ void ACTIVE_OBJECT_BASE_Ctor(ACTIVE_OBJECT_BASE *const self, uint8_t id) {
\
void transitionToNextState(ACTIVE_OBJECT_T *const self, STATE_T nextState) { \
self->state = nextState; \
}\
};\
/**
* Run it in Tasks()
* // TODO maybe add arg hasEmptyQueueCb() - to notify that MCU can go to sleep?
Expand Down

0 comments on commit 5942a49

Please sign in to comment.