mirror of https://github.com/rusefi/ChibiOS.git
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6053 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
2c0ef77243
commit
16044c7aea
|
@ -359,7 +359,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_SYSTEM_STATE_CHECK) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK TRUE
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -370,7 +370,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_ENABLE_CHECKS TRUE
|
||||
#define CH_DBG_ENABLE_CHECKS FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -382,7 +382,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_ENABLE_ASSERTS TRUE
|
||||
#define CH_DBG_ENABLE_ASSERTS FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -393,7 +393,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_ENABLE_TRACE TRUE
|
||||
#define CH_DBG_ENABLE_TRACE FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -407,7 +407,7 @@
|
|||
* @p panic_msg variable set to @p NULL.
|
||||
*/
|
||||
#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_ENABLE_STACK_CHECK TRUE
|
||||
#define CH_DBG_ENABLE_STACK_CHECK FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -419,7 +419,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__)
|
||||
#define CH_DBG_FILL_THREADS TRUE
|
||||
#define CH_DBG_FILL_THREADS FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -63,8 +63,9 @@
|
|||
typedef struct {
|
||||
rtcnt_t best; /**< @brief Best measurement. */
|
||||
rtcnt_t worst; /**< @brief Worst measurement. */
|
||||
rtcnt_t cumulative; /**< @brief Cumulative measurement. */
|
||||
rtcnt_t last; /**< @brief Last measurement. */
|
||||
ucnt_t n; /**< @brief Number of measurements. */
|
||||
rttime_t cumulative; /**< @brief Cumulative measurement. */
|
||||
} time_measurement_t;
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -60,8 +60,9 @@ static inline void tm_stop(time_measurement_t *tmp,
|
|||
rtcnt_t now,
|
||||
rtcnt_t offset) {
|
||||
|
||||
tmp->n++;
|
||||
tmp->last = now - tmp->last - offset;
|
||||
tmp->cumulative += tmp->last;
|
||||
tmp->cumulative += (rttime_t)tmp->last;
|
||||
if (tmp->last > tmp->worst)
|
||||
tmp->worst = tmp->last;
|
||||
else if (tmp->last < tmp->best)
|
||||
|
@ -101,8 +102,9 @@ void chTMObjectInit(time_measurement_t *tmp) {
|
|||
|
||||
tmp->best = (rtcnt_t)-1;
|
||||
tmp->worst = (rtcnt_t)0;
|
||||
tmp->cumulative = (rtcnt_t)0;
|
||||
tmp->last = (rtcnt_t)0;
|
||||
tmp->n = (ucnt_t)0;
|
||||
tmp->cumulative = (rttime_t)0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
typedef bool bool_t; /**< Fast boolean type. */
|
||||
typedef uint32_t systime_t; /**< System time. */
|
||||
typedef uint32_t rtcnt_t; /**< Realtime counter. */
|
||||
typedef uint64_t rttime_t; /**< Time accumulator. */
|
||||
typedef uint32_t syssts_t; /**< System status word. */
|
||||
typedef uint8_t tmode_t; /**< Thread flags. */
|
||||
typedef uint8_t tstate_t; /**< Thread state. */
|
||||
|
|
Loading…
Reference in New Issue