Skip to content

Commit

Permalink
System::Clock cleanup (#10153)
Browse files Browse the repository at this point in the history
#### Problem

Followups from PR #10056 Indirect access for System::Clock functions

Fixes #10146 Remove GetMonotonicMicroseconds() call
Fixes #10145 remove.
Fixes #10144 The static cast should have the / 1000 within it

#### Change overview

- Removes the global backward-compatibility wrappers for `GetMonotonic…()`.
- Correctly parenthesize the #10146 cast.

#### Testing

CI. No changes to functionality intended.
  • Loading branch information
kpschoedel authored and pull[bot] committed Nov 12, 2021
1 parent f84c994 commit 1164968
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void GenericPlatformManagerImpl<ImplClass>::_DispatchEvent(const ChipDeviceEvent

// TODO: make this configurable
#if CHIP_PROGRESS_LOGGING
uint32_t delta = (static_cast<uint32_t>(System::SystemClock().GetMonotonicMicroseconds() - startUS) / 1000);
uint32_t delta = static_cast<uint32_t>((System::SystemClock().GetMonotonicMicroseconds() - startUS) / 1000);
if (delta > 100)
{
ChipLogError(DeviceLayer, "Long dispatch time: %" PRIu32 " ms, for event type %d", delta, event->Type);
Expand Down
10 changes: 0 additions & 10 deletions src/system/SystemClock.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,6 @@ namespace Clock {
using MonotonicMicroseconds = ClockBase::MonotonicMicroseconds;
using MonotonicMilliseconds = ClockBase::MonotonicMicroseconds;

// DO NOT USE - Temporary backward compatibility functions. TODO: remove.
inline MonotonicMicroseconds GetMonotonicMicroseconds()
{
return SystemClock().GetMonotonicMicroseconds();
}
inline MonotonicMilliseconds GetMonotonicMilliseconds()
{
return SystemClock().GetMonotonicMilliseconds();
}

/**
* Compares two time values and returns true if the first value is earlier than the second value.
*
Expand Down

0 comments on commit 1164968

Please sign in to comment.