diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-04-10 15:51:50 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-04-13 13:08:55 +0200 |
commit | bcf536a50a0563b854773cb45bc0fd7b19cd5c51 (patch) | |
tree | bf613e7459c487dc8cc64ba28e2ff5cbc3a08d70 /cpukit/score/src/coretodset.c | |
parent | a1d6f7a405328f8eb5a7d86bdf509db77e74b683 (diff) |
score: Split _Watchdog_Adjust()
Split _Watchdog_Adjust() into _Watchdog_Adjust_backward() and
_Watchdog_Adjust_forward(). Remove Watchdog_Adjust_directions,
_Watchdog_Adjust_seconds() and _Watchdog_Adjust_ticks(). This avoids to
check the same condition again.
Update #2307.
Diffstat (limited to 'cpukit/score/src/coretodset.c')
-rw-r--r-- | cpukit/score/src/coretodset.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cpukit/score/src/coretodset.c b/cpukit/score/src/coretodset.c index 6006e66c2f..8c4ef8b135 100644 --- a/cpukit/score/src/coretodset.c +++ b/cpukit/score/src/coretodset.c @@ -31,15 +31,17 @@ void _TOD_Set_with_timestamp( Watchdog_Interval seconds_next = _Timestamp_Get_seconds( tod_as_timestamp ); Watchdog_Interval seconds_now; ISR_lock_Context lock_context; + Chain_Control *header; _Thread_Disable_dispatch(); seconds_now = _TOD_Seconds_since_epoch(); + header = &_Watchdog_Seconds_chain; if ( seconds_next < seconds_now ) - _Watchdog_Adjust_seconds( WATCHDOG_BACKWARD, seconds_now - seconds_next ); + _Watchdog_Adjust_backward( header, seconds_now - seconds_next ); else - _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, seconds_next - seconds_now ); + _Watchdog_Adjust_forward( header, seconds_next - seconds_now ); _TOD_Acquire( tod, &lock_context ); tod->now = *tod_as_timestamp; |