/* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, 2011,2012,2013 Giovanni Di Sirio. This file is part of ChibiOS/RT. ChibiOS/RT 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 3 of the License, or (at your option) any later version. ChibiOS/RT 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, see . */ /** * @file tm.h * @brief Time Measurement driver header. * * @addtogroup TM * @{ */ #ifndef _TM_H_ #define _TM_H_ #if HAL_USE_TM || defined(__DOXYGEN__) /*===========================================================================*/ /* Driver constants. */ /*===========================================================================*/ /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ /*===========================================================================*/ /* Driver data structures and types. */ /*===========================================================================*/ /** * @brief Type of a Time Measurement object. * @note Start/stop of measurements is performed through the function * pointers in order to avoid inlining of those functions which * could compromise measurement accuracy. * @note The maximum measurable time period depends on the implementation * of the realtime counter in the HAL driver. * @note The measurement is not 100% cycle-accurate, it can be in excess * of few cycles depending on the compiler and target architecture. * @note Interrupts can affect measurement if the measurement is performed * with interrupts enabled. */ typedef struct TimeMeasurement TimeMeasurement; /** * @brief Time Measurement structure. */ struct TimeMeasurement { void (*start)(TimeMeasurement *tmp); /**< @brief Starts a measurement. */ void (*stop)(TimeMeasurement *tmp); /**< @brief Stops a measurement. */ halrtcnt_t last; /**< @brief Last measurement. */ halrtcnt_t worst; /**< @brief Worst measurement. */ halrtcnt_t best; /**< @brief Best measurement. */ }; /*===========================================================================*/ /* Driver macros. */ /*===========================================================================*/ /** * @brief Starts a measurement. * @pre The @p TimeMeasurement must be initialized. * @note This function can be invoked in any context. * * @param[in,out] tmp pointer to a @p TimeMeasurement structure * * @special */ #define tmStartMeasurement(tmp) (tmp)->start(tmp) /** * @brief Stops a measurement. * @pre The @p TimeMeasurement must be initialized. * @note This function can be invoked in any context. * * @param[in,out] tmp pointer to a @p TimeMeasurement structure * * @special */ #define tmStopMeasurement(tmp) (tmp)->stop(tmp) /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ #ifdef __cplusplus extern "C" { #endif void tmInit(void); void tmObjectInit(TimeMeasurement *tmp); #ifdef __cplusplus } #endif #endif /* HAL_USE_TM */ #endif /* _TM_H_ */ /** @} */ ' href='#n25'>25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
\subsection{How to contribute}
OpenWrt is constantly being improved.  We'd like as many people to contribute
to this as we can get. If you find a change useful, by all means try to get
it incorporated into the project. This should improve OpenWrt and it should
help carry your changes forward into future versions

This section tries to lay out a procedure to enable people to submit patches
in a way that is most effective for all concerned.

It is important to do all these steps repeatedly:

\begin{itemize}
	\item \textit{listen} to what other people think.
	\item \textit{talk} explaining what problem you are addressing and your
		proposed solution.
	\item \textit{do} write useful patches including documentation.
    \item \textit{test. test. test.}
\end{itemize}

\subsection{Where to listen and talk}

\begin{itemize}
	\item google to find things related to your problem
	\item Mailing lists: \href{http://lists.openwrt.org/}{http://lists.openwrt.org/}
	\item Wiki: check the wiki: \href{http://wiki.openwrt.org/OpenWrtDocs}{http://wiki.openwrt.org/OpenWrtDocs}
	\item Forum: \href{http://forum.openwrt.org/}{http://forum.openwrt.org/}
	\item IRC: \texttt{irc.freenode.net}, channels \texttt{\#openwrt} and 
		\texttt{\#openwrt-devel}
	\item TRAC: \href{https://dev.openwrt.org/}{https://dev.openwrt.org/} the issue/bug/change tracking system
\end{itemize}

It is often best to document what you are doing before you do it.  The process
of documentation often exposes possible improvements.  Keep your documentation
up to date.

\subsection{Patch Submission Process}
\begin{enumerate}
	\item Use git or svn to create a patch. Creating patches manually with 
		\textit{diff -urN} also works, but is usually unnecessary.
	\item Send a mail to openwrt-devel@lists.openwrt.org with the following contents:
	\begin{enumerate}
		\item \texttt{[PATCH] <short description>} in the Subject, followed by:
		\item (optional) a longer description of your patch in the message body
        \item \texttt{Signed-off-by: Your name <your@email.address>}
		\item Your actual patch, inline, not word wrapped or whitespace mangled. 
	\end{enumerate}
	\item Please read \href{http://kerneltrap.org/Linux/Email\_Clients\_and\_Patches}{http://kerneltrap.org/Linux/Email\_Clients\_and\_Patches}
		to find out how to make sure your email client doesn't destroy your patch.
	\item Please use your real name and email address in the \texttt{Signed-off-by}
		line, following the same guidelines as in the \href{http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/SubmittingPatches;h=681e2b36195c98ea5271b76383b3a574b190b04f;hb=HEAD}{Linux Kernel patch submission guidelines}
	\item Example of a properly formatted patch submission: \\
	\href{http://lists.openwrt.org/pipermail/openwrt-devel/2007-November/001334.html}{http://lists.openwrt.org/pipermail/openwrt-devel/2007-November/001334.html}
\end{enumerate}