From 4e35a12a2a84afa813bf619df3bbb8146b98a973 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 20 Aug 2011 14:25:49 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3243 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/src/chthreads.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'os/kernel') diff --git a/os/kernel/src/chthreads.c b/os/kernel/src/chthreads.c index 19accdb55..46039561b 100644 --- a/os/kernel/src/chthreads.c +++ b/os/kernel/src/chthreads.c @@ -80,9 +80,6 @@ Thread *_thread_init(Thread *tp, tprio_t prio) { #if CH_USE_EVENTS tp->p_epending = 0; #endif -#if CH_USE_NESTED_LOCKS - tp->p_locks = 0; -#endif #if CH_DBG_THREADS_PROFILING tp->p_time = 0; #endif -- cgit v1.2.3 From 2d55ac3059fcca69cc9736db310b4521064c2b23 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 22 Aug 2011 17:18:52 +0000 Subject: Documentation improvements and code comments reformatting. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3248 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/ch.h | 5 +++ os/kernel/include/chevents.h | 8 +++-- os/kernel/include/chmemcore.h | 4 +++ os/kernel/include/chqueues.h | 20 ++++++------ os/kernel/include/chschd.h | 30 ++++++++++++----- os/kernel/include/chthreads.h | 76 ++++++++++++++++++++----------------------- os/kernel/include/chvt.h | 33 +++++++++++-------- 7 files changed, 102 insertions(+), 74 deletions(-) (limited to 'os/kernel') diff --git a/os/kernel/include/ch.h b/os/kernel/include/ch.h index db96d4338..35b01af2c 100644 --- a/os/kernel/include/ch.h +++ b/os/kernel/include/ch.h @@ -42,6 +42,10 @@ */ #define CH_KERNEL_VERSION "2.3.3unstable" +/** + * @name Kernel version + * @{ + */ /** * @brief Kernel version major number. */ @@ -56,6 +60,7 @@ * @brief Kernel version patch number. */ #define CH_KERNEL_PATCH 3 +/** @} */ /* * Common values. diff --git a/os/kernel/include/chevents.h b/os/kernel/include/chevents.h index e808caec3..f4314aeb2 100644 --- a/os/kernel/include/chevents.h +++ b/os/kernel/include/chevents.h @@ -78,10 +78,14 @@ typedef void (*evhandler_t)(eventid_t); */ #define EVENTSOURCE_DECL(name) EventSource name = _EVENTSOURCE_DATA(name) -/** All events allowed mask.*/ +/** + * @brief All events allowed mask. + */ #define ALL_EVENTS ((eventmask_t)-1) -/** Returns the event mask from the event identifier.*/ +/** + * @brief Returns an event mask from an event identifier. + */ #define EVENT_MASK(eid) ((eventmask_t)(1 << (eid))) /** diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index cf608c4e8..5f72a3585 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -36,6 +36,9 @@ */ typedef void *(*memgetfunc_t)(size_t size); +/** + * @name Alignment support macros + */ /** * @brief Alignment size constant. */ @@ -61,6 +64,7 @@ typedef void *(*memgetfunc_t)(size_t size); * the type @p align_t. */ #define MEM_IS_ALIGNED(p) (((size_t)(p) & MEM_ALIGN_MASK) == 0) +/** @} */ #if CH_USE_MEMCORE || defined(__DOXYGEN__) diff --git a/os/kernel/include/chqueues.h b/os/kernel/include/chqueues.h index a2df59dad..fa217710b 100644 --- a/os/kernel/include/chqueues.h +++ b/os/kernel/include/chqueues.h @@ -31,16 +31,16 @@ #if CH_USE_QUEUES || defined(__DOXYGEN__) -/** @brief Returned by the queue functions if the operation is successful.*/ -#define Q_OK RDY_OK -/** @brief Returned by the queue functions if a timeout occurs.*/ -#define Q_TIMEOUT RDY_TIMEOUT -/** @brief Returned by the queue functions if the queue has been reset.*/ -#define Q_RESET RDY_RESET -/** @brief Returned by the queue functions if the queue is empty.*/ -#define Q_EMPTY -3 -/** @brief Returned by the queue functions if the queue is full.*/ -#define Q_FULL -4 +/** + * @name Queue functions returned status value + * @{ + */ +#define Q_OK RDY_OK /**< @brief Operation successful. */ +#define Q_TIMEOUT RDY_TIMEOUT /**< @brief Timeout condition. */ +#define Q_RESET RDY_RESET /**< @brief Queue has been reset. */ +#define Q_EMPTY -3 /**< @brief Queue empty. */ +#define Q_FULL -4 /**< @brief Queue full, */ +/** @} */ /** * @brief Type of a generic I/O queue structure. diff --git a/os/kernel/include/chschd.h b/os/kernel/include/chschd.h index 0e933e8ba..27f6b9222 100644 --- a/os/kernel/include/chschd.h +++ b/os/kernel/include/chschd.h @@ -29,22 +29,35 @@ #ifndef _CHSCHD_H_ #define _CHSCHD_H_ -/** @brief Default thread wakeup low level message.*/ -#define RDY_OK 0 -/** @brief Low level message sent to a thread awakened by a timeout.*/ -#define RDY_TIMEOUT -1 -/** @brief Low level message sent to a thread awakened by a reset operation.*/ -#define RDY_RESET -2 +/** + * @name Wakeup status codes + * @{ + */ +#define RDY_OK 0 /**< @brief Normal wakeup message. */ +#define RDY_TIMEOUT -1 /**< @brief Wakeup caused by a timeout + condition. */ +#define RDY_RESET -2 /**< @brief Wakeup caused by a reset + condition. */ +/** @} */ +/** + * @name Priority constants + * @{ + */ #define NOPRIO 0 /**< @brief Ready list header priority. */ #define IDLEPRIO 1 /**< @brief Idle thread priority. */ #define LOWPRIO 2 /**< @brief Lowest user priority. */ #define NORMALPRIO 64 /**< @brief Normal user priority. */ #define HIGHPRIO 127 /**< @brief Highest user priority. */ #define ABSPRIO 255 /**< @brief Greatest possible priority. */ +/** @} */ /** - * @brief Zero time specification for some syscalls with a timeout + * @name Special time constants + * @{ + */ +/** + * @brief Zero time specification for some functions with a timeout * specification. * @note Not all functions accept @p TIME_IMMEDIATE as timeout parameter, * see the specific function documentation. @@ -52,10 +65,11 @@ #define TIME_IMMEDIATE ((systime_t)0) /** - * @brief Infinite time specification for all the syscalls with a timeout + * @brief Infinite time specification for all functions with a timeout * specification. */ #define TIME_INFINITE ((systime_t)-1) +/** @} */ /** * @brief Returns the priority of the first thread on the given ready list. diff --git a/os/kernel/include/chthreads.h b/os/kernel/include/chthreads.h index a0a668df4..eb3d8bb14 100644 --- a/os/kernel/include/chthreads.h +++ b/os/kernel/include/chthreads.h @@ -29,6 +29,42 @@ #ifndef _CHTHREADS_H_ #define _CHTHREADS_H_ +/** + * @name Thread states + * @{ + */ +#define THD_STATE_READY 0 /**< @brief Waiting on the ready list. */ +#define THD_STATE_CURRENT 1 /**< @brief Currently running. */ +#define THD_STATE_SUSPENDED 2 /**< @brief Created in suspended state. */ +#define THD_STATE_WTSEM 3 /**< @brief Waiting on a semaphore. */ +#define THD_STATE_WTMTX 4 /**< @brief Waiting on a mutex. */ +#define THD_STATE_WTCOND 5 /**< @brief Waiting on a condition + variable. */ +#define THD_STATE_SLEEPING 6 /**< @brief Waiting in @p chThdSleep() + or @p chThdSleepUntil(). */ +#define THD_STATE_WTEXIT 7 /**< @brief Waiting in @p chThdWait(). */ +#define THD_STATE_WTOREVT 8 /**< @brief Waiting for an event. */ +#define THD_STATE_WTANDEVT 9 /**< @brief Waiting for several events. */ +#define THD_STATE_SNDMSGQ 10 /**< @brief Sending a message, in queue.*/ +#define THD_STATE_SNDMSG 11 /**< @brief Sent a message, waiting + answer. */ +#define THD_STATE_WTMSG 12 /**< @brief Waiting for a message. */ +#define THD_STATE_WTQUEUE 13 /**< @brief Waiting on an I/O queue. */ +#define THD_STATE_FINAL 14 /**< @brief Thread terminated. */ +/** @} */ + +/** + * @name Thread flags and attributes + * @{ + */ +#define THD_MEM_MODE_MASK 3 /**< @brief Thread memory mode mask. */ +#define THD_MEM_MODE_STATIC 0 /**< @brief Static thread. */ +#define THD_MEM_MODE_HEAP 1 /**< @brief Thread allocated from Heap. */ +#define THD_MEM_MODE_MEMPOOL 2 /**< @brief Thread allocated from Memory + Pool. */ +#define THD_TERMINATE 4 /**< @brief Termination requested flag. */ +/** @} */ + /** * @extends ThreadsQueue * @@ -163,46 +199,6 @@ struct Thread { #endif }; -/** @brief Thread state: Ready to run, waiting on the ready list.*/ -#define THD_STATE_READY 0 -/** @brief Thread state: Currently running.*/ -#define THD_STATE_CURRENT 1 -/** @brief Thread state: Thread created in suspended state.*/ -#define THD_STATE_SUSPENDED 2 -/** @brief Thread state: Waiting on a semaphore.*/ -#define THD_STATE_WTSEM 3 -/** @brief Thread state: Waiting on a mutex.*/ -#define THD_STATE_WTMTX 4 -/** @brief Thread state: Waiting in @p chCondWait().*/ -#define THD_STATE_WTCOND 5 -/** @brief Thread state: Waiting in @p chThdSleep() or @p chThdSleepUntil().*/ -#define THD_STATE_SLEEPING 6 -/** @brief Thread state: Waiting in @p chThdWait().*/ -#define THD_STATE_WTEXIT 7 -/** @brief Thread state: Waiting in @p chEvtWaitXXX().*/ -#define THD_STATE_WTOREVT 8 -/** @brief Thread state: Waiting in @p chEvtWaitAllTimeout().*/ -#define THD_STATE_WTANDEVT 9 -/** @brief Thread state: Waiting in @p chMsgSend() (queued).*/ -#define THD_STATE_SNDMSGQ 10 -/** @brief Thread state: Waiting in @p chMsgSend() (not queued).*/ -#define THD_STATE_SNDMSG 11 -/** @brief Thread state: Waiting in @p chMsgWait().*/ -#define THD_STATE_WTMSG 12 -/** @brief Thread state: Waiting on an I/O queue.*/ -#define THD_STATE_WTQUEUE 13 -/** @brief Thread state: After termination.*/ -#define THD_STATE_FINAL 14 - -/* - * Various flags into the thread p_flags field. - */ -#define THD_MEM_MODE_MASK 3 /**< @brief Thread memory mode mask. */ -#define THD_MEM_MODE_STATIC 0 /**< @brief Thread memory mode: static. */ -#define THD_MEM_MODE_HEAP 1 /**< @brief Thread memory mode: heap. */ -#define THD_MEM_MODE_MEMPOOL 2 /**< @brief Thread memory mode: pool. */ -#define THD_TERMINATE 4 /**< @brief Termination requested. */ - /** * @brief Thread function. */ diff --git a/os/kernel/include/chvt.h b/os/kernel/include/chvt.h index e75e966d5..fe4ba11df 100644 --- a/os/kernel/include/chvt.h +++ b/os/kernel/include/chvt.h @@ -29,6 +29,10 @@ #ifndef _CHVT_H_ #define _CHVT_H_ +/** + * @name Time conversion utilities + * @{ + */ /** * @brief Time conversion utility. * @details Converts from seconds to system ticks number. @@ -49,6 +53,7 @@ * @note The result is rounded upward to the next tick boundary. */ #define US2ST(usec) ((systime_t)(((((usec) - 1L) * CH_FREQUENCY) / 1000000L) + 1L)) +/** @} */ /** * @brief Virtual Timer callback function. @@ -115,20 +120,6 @@ extern VTList vtlist; } \ } -/* - * Virtual Timers APIs. - */ -#ifdef __cplusplus -extern "C" { -#endif - void _vt_init(void); - void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par); - void chVTResetI(VirtualTimer *vtp); - bool_t chTimeIsWithin(systime_t start, systime_t end); -#ifdef __cplusplus -} -#endif - /** * @brief Returns TRUE if the speciified timer is armed. * @@ -149,6 +140,20 @@ extern "C" { */ #define chTimeNow() (vtlist.vt_systime) +/* + * Virtual Timers APIs. + */ +#ifdef __cplusplus +extern "C" { +#endif + void _vt_init(void); + void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par); + void chVTResetI(VirtualTimer *vtp); + bool_t chTimeIsWithin(systime_t start, systime_t end); +#ifdef __cplusplus +} +#endif + #endif /* _CHVT_H_ */ /** @} */ -- cgit v1.2.3 From c9be79def630f153b0b2d28e905939c15743f989 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 23 Aug 2011 10:09:08 +0000 Subject: Kernel documentation fixes and improvements. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3251 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chbsem.h | 5 +++++ os/kernel/include/chdebug.h | 11 ++++++++++- os/kernel/include/chevents.h | 5 +++++ os/kernel/include/chfiles.h | 7 +++++++ os/kernel/include/chioch.h | 26 ++++++++++++++++++++++---- os/kernel/include/chmboxes.h | 5 +++++ os/kernel/include/chmsg.h | 5 +++++ os/kernel/include/chmtx.h | 5 +++++ os/kernel/include/chqueues.h | 35 +++++++++++++++++++++++++---------- os/kernel/include/chregistry.h | 6 +++++- os/kernel/include/chschd.h | 5 +++++ os/kernel/include/chsem.h | 5 +++++ os/kernel/include/chstreams.h | 5 +++++ os/kernel/include/chsys.h | 13 +++++++++++++ os/kernel/include/chthreads.h | 14 ++++++++++---- os/kernel/include/chvt.h | 11 ++++++++--- os/kernel/src/chmsg.c | 2 +- 17 files changed, 141 insertions(+), 24 deletions(-) (limited to 'os/kernel') diff --git a/os/kernel/include/chbsem.h b/os/kernel/include/chbsem.h index e0e1ca865..2d8815c3c 100644 --- a/os/kernel/include/chbsem.h +++ b/os/kernel/include/chbsem.h @@ -84,6 +84,10 @@ typedef struct { #define BSEMAPHORE_DECL(name, taken) \ BinarySemaphore name = _BSEMAPHORE_DATA(name, taken) +/** + * @name Macro Functions + * @{ + */ /** * @brief Initializes a binary semaphore. * @@ -238,6 +242,7 @@ typedef struct { * @iclass */ #define chBSemGetStateI(bsp) ((bsp)->bs_sem.s_cnt > 0 ? FALSE : TRUE) +/** @} */ #endif /* CH_USE_SEMAPHORES */ diff --git a/os/kernel/include/chdebug.h b/os/kernel/include/chdebug.h index f3bf6b026..d11eb2eb2 100644 --- a/os/kernel/include/chdebug.h +++ b/os/kernel/include/chdebug.h @@ -132,7 +132,10 @@ extern ch_trace_buffer_t dbg_trace_buffer; /*===========================================================================*/ #if CH_DBG_ENABLE_CHECKS || defined(__DOXYGEN__) - +/** + * @name Macro Functions + * @{ + */ /** * @brief Function parameter check. * @details If the condition check fails then the kernel panics and halts. @@ -150,6 +153,7 @@ extern ch_trace_buffer_t dbg_trace_buffer; chDbgPanic(__QUOTE_THIS(func)"()"); \ } #endif /* !defined(chDbgCheck) */ +/** @} */ #else /* !CH_DBG_ENABLE_CHECKS */ #define chDbgCheck(c, func) { \ (void)(c), (void)__QUOTE_THIS(func)"()"; \ @@ -161,6 +165,10 @@ extern ch_trace_buffer_t dbg_trace_buffer; /*===========================================================================*/ #if CH_DBG_ENABLE_ASSERTS || defined(__DOXYGEN__) +/** + * @name Macro Functions + * @{ + */ /** * @brief Condition assertion. * @details If the condition check fails then the kernel panics with the @@ -184,6 +192,7 @@ extern ch_trace_buffer_t dbg_trace_buffer; chDbgPanic(m); \ } #endif /* !defined(chDbgAssert) */ +/** @} */ #else /* !CH_DBG_ENABLE_ASSERTS */ #define chDbgAssert(c, m, r) {(void)(c);} #endif /* !CH_DBG_ENABLE_ASSERTS */ diff --git a/os/kernel/include/chevents.h b/os/kernel/include/chevents.h index f4314aeb2..de89118b4 100644 --- a/os/kernel/include/chevents.h +++ b/os/kernel/include/chevents.h @@ -88,6 +88,10 @@ typedef void (*evhandler_t)(eventid_t); */ #define EVENT_MASK(eid) ((eventmask_t)(1 << (eid))) +/** + * @name Macro Functions + * @{ + */ /** * @brief Registers an Event Listener on an Event Source. * @note Multiple Event Listeners can use the same event identifier, the @@ -151,6 +155,7 @@ typedef void (*evhandler_t)(eventid_t); * @iclass */ #define chEvtBroadcastI(esp) chEvtBroadcastFlagsI(esp, 0) +/** @} */ #ifdef __cplusplus extern "C" { diff --git a/os/kernel/include/chfiles.h b/os/kernel/include/chfiles.h index ff3f8274e..69a63965e 100644 --- a/os/kernel/include/chfiles.h +++ b/os/kernel/include/chfiles.h @@ -74,6 +74,8 @@ typedef uint32_t fileoffset_t; _base_sequential_stream_data /** + * @extends BaseSequentialStreamVMT + * * @brief @p BaseFileStream virtual methods table. */ struct BaseFilelStreamVMT { @@ -92,6 +94,10 @@ typedef struct { _base_file_stream_data } BaseFileStream; +/** + * @name Macro Functions (BaseFileStream) + * @{ + */ /** * @brief Base file Stream close. * @details The function closes a file stream. @@ -138,6 +144,7 @@ typedef struct { * @api */ #define chFileStreamSeek ((ip)->vmt->lseek(ip, offset)) +/** @} */ #endif /* _CHFILES_H_ */ diff --git a/os/kernel/include/chioch.h b/os/kernel/include/chioch.h index 02757c7e9..3361926e3 100644 --- a/os/kernel/include/chioch.h +++ b/os/kernel/include/chioch.h @@ -67,6 +67,8 @@ _base_sequential_stream_data /** + * @extends BaseSequentialStreamVMT + * * @brief @p BaseChannel virtual methods table. */ struct BaseChannelVMT { \ @@ -86,6 +88,10 @@ typedef struct { _base_channel_data } BaseChannel; +/** + * @name Macro Functions (BaseChannel) + * @{ + */ /** * @brief Channel output check. * @details This function verifies if a subsequent put/write operation would @@ -227,9 +233,13 @@ typedef struct { */ #define chIOReadTimeout(ip, bp, n, time) \ ((ip)->vmt->readt(ip, bp, n, time)) +/** @} */ -#if CH_USE_EVENTS - +#if CH_USE_EVENTS || defined(__DOXYGEN__) +/** + * @name I/O status flags + * @{ + */ /** @brief No pending conditions.*/ #define IO_NO_ERROR 0 /** @brief Connection happened.*/ @@ -242,6 +252,7 @@ typedef struct { #define IO_OUTPUT_EMPTY 8 /** @brief Transmission end.*/ #define IO_TRANSMISSION_END 16 +/** @} */ /** * @brief Type of an I/O condition flags mask. @@ -267,6 +278,8 @@ typedef uint_fast16_t ioflags_t; ioflags_t flags; /** + * @extends BaseChannelVMT + * * @brief @p BaseAsynchronousChannel virtual methods table. */ struct BaseAsynchronousChannelVMT { @@ -286,6 +299,10 @@ typedef struct { _base_asynchronous_channel_data } BaseAsynchronousChannel; +/** + * @name Macro Functions (BaseAsynchronousChannel) + * @{ + */ /** * @brief Returns the I/O condition event source. * @details The event source is broadcasted when an I/O condition happens. @@ -299,7 +316,7 @@ typedef struct { #define chIOGetEventSource(ip) (&((ip)->event)) /** - * @brief Adds condition flags to the channel's mask. + * @brief Adds status flags to the channel's mask. * @details This function is usually called from the I/O ISTs in order to * notify I/O conditions such as data events, errors, signal * changes etc. @@ -316,7 +333,7 @@ typedef struct { } /** - * @brief Returns and clears the errors mask associated to the channel. + * @brief Returns and clears the status flags associated to the channel. * * @param[in] ip pointer to a @p BaseAsynchronousChannel or derived * class @@ -326,6 +343,7 @@ typedef struct { * @api */ #define chIOGetAndClearFlags(ip) ((ip)->vmt->getflags(ip)) +/** @} */ /** * @brief Default implementation of the @p getflags virtual method. diff --git a/os/kernel/include/chmboxes.h b/os/kernel/include/chmboxes.h index 4a1706302..60cb7a5c1 100644 --- a/os/kernel/include/chmboxes.h +++ b/os/kernel/include/chmboxes.h @@ -72,6 +72,10 @@ extern "C" { } #endif +/** + * @name Macro Functions + * @{ + */ /** * @brief Returns the mailbox buffer size. * @@ -120,6 +124,7 @@ extern "C" { * @iclass */ #define chMBPeekI(mbp) (*(mbp)->mb_rdptr) +/** @} */ /** * @brief Data part of a static mailbox initializer. diff --git a/os/kernel/include/chmsg.h b/os/kernel/include/chmsg.h index 1803c719d..2bae02dea 100644 --- a/os/kernel/include/chmsg.h +++ b/os/kernel/include/chmsg.h @@ -31,6 +31,10 @@ #if CH_USE_MESSAGES || defined(__DOXYGEN__) +/** + * @name Macro Functions + * @{ + */ /** * @brief Evaluates to TRUE if the thread has pending messages. * @@ -74,6 +78,7 @@ * @sclass */ #define chMsgReleaseS(tp, msg) chSchWakeupS(tp, msg) +/** @} */ #ifdef __cplusplus extern "C" { diff --git a/os/kernel/include/chmtx.h b/os/kernel/include/chmtx.h index 9f2d5a0d3..831d48a89 100644 --- a/os/kernel/include/chmtx.h +++ b/os/kernel/include/chmtx.h @@ -76,6 +76,10 @@ extern "C" { */ #define MUTEX_DECL(name) Mutex name = _MUTEX_DATA(name) +/** + * @name Macro Functions + * @{ + */ /** * @brief Returns @p TRUE if the mutex queue contains at least a waiting * thread. @@ -83,6 +87,7 @@ extern "C" { * @sclass */ #define chMtxQueueNotEmptyS(mp) notempty(&(mp)->m_queue) +/** @} */ #endif /* CH_USE_MUTEXES */ diff --git a/os/kernel/include/chqueues.h b/os/kernel/include/chqueues.h index fa217710b..4917ac837 100644 --- a/os/kernel/include/chqueues.h +++ b/os/kernel/include/chqueues.h @@ -70,6 +70,10 @@ struct GenericQueue { qnotify_t q_notify; /**< @brief Data notification callback. */ }; +/** + * @name Macro Functions + * @{ + */ /** * @brief Returns the queue's buffer size. * @@ -90,7 +94,8 @@ struct GenericQueue { * * @iclass */ -#define chQSpaceI(qp) ((size_t)((qp)->q_counter)) +#define chQSpaceI(qp) ((qp)->q_counter) +/** @} */ /** * @extends GenericQueue @@ -105,6 +110,10 @@ struct GenericQueue { */ typedef GenericQueue InputQueue; +/** + * @name Macro Functions + * @{ + */ /** * @brief Returns the filled space into an input queue. * @@ -165,6 +174,7 @@ typedef GenericQueue InputQueue; * @api */ #define chIQGet(iqp) chIQGetTimeout(iqp, TIME_INFINITE) +/** @} */ /** * @brief Data part of a static input queue initializer. @@ -212,15 +222,19 @@ typedef GenericQueue InputQueue; */ typedef GenericQueue OutputQueue; - /** - * @brief Returns the filled space into an output queue. - * - * @param[in] oqp pointer to an @p OutputQueue structure - * @return The number of full bytes in the queue. - * @retval 0 if the queue is empty. - * - * @iclass - */ +/** + * @name Macro Functions + * @{ + */ +/** + * @brief Returns the filled space into an output queue. + * + * @param[in] oqp pointer to an @p OutputQueue structure + * @return The number of full bytes in the queue. + * @retval 0 if the queue is empty. + * + * @iclass + */ #define chOQGetFullI(oqp) (chQSizeI(oqp) - chQSpaceI(oqp)) /** @@ -274,6 +288,7 @@ typedef GenericQueue OutputQueue; * @api */ #define chOQPut(oqp, b) chOQPutTimeout(oqp, b, TIME_INFINITE) + /** @} */ /** * @brief Data part of a static output queue initializer. diff --git a/os/kernel/include/chregistry.h b/os/kernel/include/chregistry.h index 0967f699e..8f7ebd4b9 100644 --- a/os/kernel/include/chregistry.h +++ b/os/kernel/include/chregistry.h @@ -30,6 +30,10 @@ #define _CHREGISTRY_H_ #if CH_USE_REGISTRY || defined(__DOXYGEN__) +/** + * @name Macro Functions + * @{ + */ /** * @brief Sets the current thread name. * @pre This function only stores the pointer to the name if the option @@ -52,13 +56,13 @@ * @retval NULL if the thread name has not been set. */ #define chRegGetThreadName(tp) ((tp)->p_name) +/** @} */ #else /* !CH_USE_REGISTRY */ #define chRegSetThreadName(p) #define chRegGetThreadName(tp) NULL #endif /* !CH_USE_REGISTRY */ #if CH_USE_REGISTRY || defined(__DOXYGEN__) - /** * @brief Removes a thread from the registry list. * @note This macro is not meant for use in application code. diff --git a/os/kernel/include/chschd.h b/os/kernel/include/chschd.h index 27f6b9222..0e490c26a 100644 --- a/os/kernel/include/chschd.h +++ b/os/kernel/include/chschd.h @@ -161,6 +161,10 @@ extern "C" { } #endif +/** + * @name Macro Functions + * @{ + */ /** * @brief Determines if the current thread must reschedule. * @details This function returns @p TRUE if there is a ready thread with @@ -223,6 +227,7 @@ extern "C" { chSchDoReschedule(); \ } #endif /* CH_TIME_QUANTUM == 0 */ +/** @} */ #endif /* _CHSCHD_H_ */ diff --git a/os/kernel/include/chsem.h b/os/kernel/include/chsem.h index 04e079466..5f1c37a0a 100644 --- a/os/kernel/include/chsem.h +++ b/os/kernel/include/chsem.h @@ -82,6 +82,10 @@ extern "C" { */ #define SEMAPHORE_DECL(name, n) Semaphore name = _SEMAPHORE_DATA(name, n) +/** + * @name Macro Functions + * @{ + */ /** * @brief Decreases the semaphore counter. * @details This macro can be used when the counter is known to be positive. @@ -105,6 +109,7 @@ extern "C" { * @iclass */ #define chSemGetCounterI(sp) ((sp)->s_cnt) +/** @} */ #endif /* CH_USE_SEMAPHORES */ diff --git a/os/kernel/include/chstreams.h b/os/kernel/include/chstreams.h index 0bd763366..57883601d 100644 --- a/os/kernel/include/chstreams.h +++ b/os/kernel/include/chstreams.h @@ -73,6 +73,10 @@ typedef struct { _base_sequential_stream_data } BaseSequentialStream; +/** + * @name Macro Functions (BaseSequentialStream) + * @{ + */ /** * @brief Sequential Stream write. * @details The function writes data from a buffer to a stream. @@ -103,6 +107,7 @@ typedef struct { * @api */ #define chSequentialStreamRead(ip, bp, n) ((ip)->vmt->read(ip, bp, n)) +/** @} */ #endif /* _CHSTREAMS_H_ */ diff --git a/os/kernel/include/chsys.h b/os/kernel/include/chsys.h index f807182ac..b69736a1d 100644 --- a/os/kernel/include/chsys.h +++ b/os/kernel/include/chsys.h @@ -29,6 +29,10 @@ #ifndef _CHSYS_H_ #define _CHSYS_H_ +/** + * @name Macro Functions + * @{ + */ #if !CH_NO_IDLE_THREAD || defined(__DOXYGEN__) /** * @brief Returns a pointer to the idle thread. @@ -177,7 +181,11 @@ dbg_check_unlock_from_isr(); \ port_unlock_from_isr(); \ } +/** @} */ +/** + * @name ISRs abstraction macros + */ /** * @brief IRQ handler enter code. * @note Usually IRQ handlers functions are also declared naked. @@ -211,7 +219,11 @@ * @special */ #define CH_IRQ_HANDLER(id) PORT_IRQ_HANDLER(id) +/** @} */ +/** + * @name Fast ISRs abstraction macros + */ /** * @brief Standard fast IRQ handler declaration. * @note @p id can be a function name or a vector number depending on the @@ -221,6 +233,7 @@ * @special */ #define CH_FAST_IRQ_HANDLER(id) PORT_FAST_IRQ_HANDLER(id) +/** @} */ #ifdef __cplusplus extern "C" { diff --git a/os/kernel/include/chthreads.h b/os/kernel/include/chthreads.h index eb3d8bb14..bd3f21296 100644 --- a/os/kernel/include/chthreads.h +++ b/os/kernel/include/chthreads.h @@ -59,9 +59,10 @@ */ #define THD_MEM_MODE_MASK 3 /**< @brief Thread memory mode mask. */ #define THD_MEM_MODE_STATIC 0 /**< @brief Static thread. */ -#define THD_MEM_MODE_HEAP 1 /**< @brief Thread allocated from Heap. */ -#define THD_MEM_MODE_MEMPOOL 2 /**< @brief Thread allocated from Memory - Pool. */ +#define THD_MEM_MODE_HEAP 1 /**< @brief Thread allocated from a + Memory Heap. */ +#define THD_MEM_MODE_MEMPOOL 2 /**< @brief Thread allocated from a + Memory Pool. */ #define THD_TERMINATE 4 /**< @brief Termination requested flag. */ /** @} */ @@ -204,6 +205,10 @@ struct Thread { */ typedef msg_t (*tfunc_t)(void *); +/** + * @name Macro Functions + * @{ + */ /** * @brief Returns a pointer to the current @p Thread. * @@ -258,7 +263,7 @@ typedef msg_t (*tfunc_t)(void *); #define chThdShouldTerminate() (currp->p_flags & THD_TERMINATE) /** - * @brief Resumes a thread created with @p chThdInit(). + * @brief Resumes a thread created with @p chThdCreateI(). * * @param[in] tp pointer to the thread * @@ -317,6 +322,7 @@ typedef msg_t (*tfunc_t)(void *); * @api */ #define chThdSleepMicroseconds(usec) chThdSleep(US2ST(usec)) +/** @} */ /* * Threads APIs. diff --git a/os/kernel/include/chvt.h b/os/kernel/include/chvt.h index fe4ba11df..0038e3d0a 100644 --- a/os/kernel/include/chvt.h +++ b/os/kernel/include/chvt.h @@ -34,21 +34,21 @@ * @{ */ /** - * @brief Time conversion utility. + * @brief Seconds to system ticks. * @details Converts from seconds to system ticks number. * @note The result is rounded upward to the next tick boundary. */ #define S2ST(sec) ((systime_t)((sec) * CH_FREQUENCY)) /** - * @brief Time conversion utility. + * @brief Milliseconds t0 system ticks. * @details Converts from milliseconds to system ticks number. * @note The result is rounded upward to the next tick boundary. */ #define MS2ST(msec) ((systime_t)(((((msec) - 1L) * CH_FREQUENCY) / 1000L) + 1L)) /** - * @brief Time conversion utility. + * @brief Microseconds to system ticks. * @details Converts from microseconds to system ticks number. * @note The result is rounded upward to the next tick boundary. */ @@ -99,6 +99,10 @@ typedef struct { extern VTList vtlist; +/** + * @name Macro Functions + * @{ + */ /** * @brief Virtual timers ticker. * @@ -139,6 +143,7 @@ extern VTList vtlist; * @api */ #define chTimeNow() (vtlist.vt_systime) +/** @} */ /* * Virtual Timers APIs. diff --git a/os/kernel/src/chmsg.c b/os/kernel/src/chmsg.c index 5002a892a..403df1580 100644 --- a/os/kernel/src/chmsg.c +++ b/os/kernel/src/chmsg.c @@ -109,7 +109,7 @@ Thread *chMsgWait(void) { } /** - * @brief Releases the thread waiting on top of the messages queue. + * @brief Releases a sender thread specifying a response message. * @pre Invoke this function only after a message has been received * using @p chMsgWait(). * -- cgit v1.2.3