diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-29 13:28:35 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-29 13:28:35 +0000 |
commit | 61f841306aaa11b1471db1deb00470ea48f646fd (patch) | |
tree | 0f69b278240b26d0dd4e20da5fe6de2a2b840992 /os/kernel/src | |
parent | 0cb6bc9b9d260beb05fcc9e2ec4d72f0ba621b71 (diff) | |
download | ChibiOS-61f841306aaa11b1471db1deb00470ea48f646fd.tar.gz ChibiOS-61f841306aaa11b1471db1deb00470ea48f646fd.tar.bz2 ChibiOS-61f841306aaa11b1471db1deb00470ea48f646fd.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6037 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src')
-rw-r--r-- | os/kernel/src/chrt.c | 16 | ||||
-rw-r--r-- | os/kernel/src/chsys.c | 4 | ||||
-rw-r--r-- | os/kernel/src/chvt.c | 4 |
3 files changed, 13 insertions, 11 deletions
diff --git a/os/kernel/src/chrt.c b/os/kernel/src/chrt.c index a63ce9e32..0a477de39 100644 --- a/os/kernel/src/chrt.c +++ b/os/kernel/src/chrt.c @@ -131,7 +131,7 @@ void _rt_init(void) { * @special
*/
bool chRTIsCounterWithin(rtcnt_t start, rtcnt_t end) {
- rtcnt_t now = chRTGetCounterValueX();
+ rtcnt_t now = chSysGetRealtimeCounterX();
return end > start ? (now >= start) && (now < end) :
(now >= start) || (now < end);
@@ -148,7 +148,7 @@ bool chRTIsCounterWithin(rtcnt_t start, rtcnt_t end) { * @special
*/
void chRTPolledDelay(rtcnt_t cycles) {
- rtcnt_t start = chRTGetCounterValueX();
+ rtcnt_t start = chSysGetRealtimeCounterX();
rtcnt_t end = start + cycles;
while (chRTIsCounterWithin(start, end))
;
@@ -163,9 +163,10 @@ void chRTPolledDelay(rtcnt_t cycles) { */
void chRTTimeMeasurementObjectInit(time_measurement_t *tmp) {
- tmp->last = (rtcnt_t)0;
- tmp->worst = (rtcnt_t)0;
- tmp->best = (rtcnt_t)-1;
+ tmp->best = (rtcnt_t)-1;
+ tmp->worst = (rtcnt_t)0;
+ tmp->cumulative = (rtcnt_t)0;
+ tmp->last = (rtcnt_t)0;
}
/**
@@ -179,7 +180,7 @@ void chRTTimeMeasurementObjectInit(time_measurement_t *tmp) { */
NOINLINE void chRTTimeMeasurementStartX(time_measurement_t *tmp) {
- tmp->last = chRTGetCounterValueX();
+ tmp->last = chSysGetRealtimeCounterX();
}
/**
@@ -193,8 +194,9 @@ NOINLINE void chRTTimeMeasurementStartX(time_measurement_t *tmp) { */
NOINLINE void chRTTimeMeasurementStopX(time_measurement_t *tmp) {
- rtcnt_t now = chRTGetCounterValueX();
+ rtcnt_t now = chSysGetRealtimeCounterX();
tmp->last = now - tmp->last - measurement_offset;
+ tmp->cumulative += tmp->last;
if (tmp->last > tmp->worst)
tmp->worst = tmp->last;
else if (tmp->last < tmp->best)
diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c index 91277dc60..91761b66b 100644 --- a/os/kernel/src/chsys.c +++ b/os/kernel/src/chsys.c @@ -211,7 +211,7 @@ void chSysTimerHandlerI(void) { * @return The previous system status, the encoding of this
* status word is architecture-dependent and opaque.
*
- * @special
+ * @xclass
*/
syssts_t chSysGetAndLockX(void) {
@@ -230,7 +230,7 @@ syssts_t chSysGetAndLockX(void) { *
* @param[in] sts the system status to be restored.
*
- * @special
+ * @xclass
*/
void chSysRestoreLockX(syssts_t sts) {
diff --git a/os/kernel/src/chvt.c b/os/kernel/src/chvt.c index e5d6d1aa3..3e6028f9c 100644 --- a/os/kernel/src/chvt.c +++ b/os/kernel/src/chvt.c @@ -88,9 +88,9 @@ void _vt_init(void) { * @retval true current time within the specified time window.
* @retval false current time not within the specified time window.
*
- * @special
+ * @xclass
*/
-bool chVTIsTimeWithin(systime_t time, systime_t start, systime_t end) {
+bool chVTIsTimeWithinX(systime_t time, systime_t start, systime_t end) {
return end > start ? (time >= start) && (time < end) :
(time >= start) || (time < end);
|