Revise chtm.c to allow time chaining of same object
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@16311 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
c124680e97
commit
f77d00b0c9
|
@ -152,11 +152,13 @@ NOINLINE void chTMStopMeasurementX(time_measurement_t *tmp) {
|
||||||
NOINLINE void chTMChainMeasurementToX(time_measurement_t *tmp1,
|
NOINLINE void chTMChainMeasurementToX(time_measurement_t *tmp1,
|
||||||
time_measurement_t *tmp2) {
|
time_measurement_t *tmp2) {
|
||||||
|
|
||||||
/* Starts new measurement.*/
|
/* Get current time for measurement.*/
|
||||||
tmp2->last = chSysGetRealtimeCounterX();
|
rtcnt_t now = chSysGetRealtimeCounterX();
|
||||||
|
|
||||||
/* Stops previous measurement using the same time stamp.*/
|
/* Stop previous measurement using current time. Update chained only after
|
||||||
tm_stop(tmp1, tmp2->last, (rtcnt_t)0);
|
stop since the same measurement object may be used.*/
|
||||||
|
tm_stop(tmp1, now, (rtcnt_t)0);
|
||||||
|
tmp2->last = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CH_CFG_USE_TM == TRUE */
|
#endif /* CH_CFG_USE_TM == TRUE */
|
||||||
|
|
Loading…
Reference in New Issue