From 4905a6b91c8ea9c4d34200ea5608bd9f842a9cc0 Mon Sep 17 00:00:00 2001 From: Kevin Schoedel <67607049+kpschoedel@users.noreply.github.com> Date: Mon, 4 Oct 2021 14:23:51 -0400 Subject: [PATCH] System::Clock cleanup (#10153) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### 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. --- .../platform/internal/GenericPlatformManagerImpl.cpp | 2 +- src/system/SystemClock.h | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/include/platform/internal/GenericPlatformManagerImpl.cpp b/src/include/platform/internal/GenericPlatformManagerImpl.cpp index 00f9767abb0e53..3be68fd23586d9 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl.cpp +++ b/src/include/platform/internal/GenericPlatformManagerImpl.cpp @@ -257,7 +257,7 @@ void GenericPlatformManagerImpl::_DispatchEvent(const ChipDeviceEvent // TODO: make this configurable #if CHIP_PROGRESS_LOGGING - uint32_t delta = (static_cast(System::SystemClock().GetMonotonicMicroseconds() - startUS) / 1000); + uint32_t delta = static_cast((System::SystemClock().GetMonotonicMicroseconds() - startUS) / 1000); if (delta > 100) { ChipLogError(DeviceLayer, "Long dispatch time: %" PRIu32 " ms, for event type %d", delta, event->Type); diff --git a/src/system/SystemClock.h b/src/system/SystemClock.h index 647f7c9b3af8e1..f9c12bf5e371de 100644 --- a/src/system/SystemClock.h +++ b/src/system/SystemClock.h @@ -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. *