Skip to content

Commit

Permalink
[BEKEN] change the return type of InitClock_RealTime() and update some
Browse files Browse the repository at this point in the history
comments.
  • Loading branch information
yangtao365 authored and zhengyaohan committed Aug 12, 2022
1 parent 1d6f67c commit 2d01950
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
9 changes: 7 additions & 2 deletions src/platform/Beken/SystemTimeSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* @file
* Provides implementations of the CHIP System Layer platform
* time/clock functions that are suitable for use on the Ameba platform.
* time/clock functions that are suitable for use on the Beken platform.
*/
/* this file behaves like a config.h, comes first */
#include <platform/internal/CHIPDeviceLayerInternal.h>
Expand Down Expand Up @@ -73,7 +73,12 @@ CHIP_ERROR InitClock_RealTime()
baseTime =
Clock::Milliseconds64((static_cast<uint64_t>(CHIP_SYSTEM_CONFIG_VALID_REAL_TIME_THRESHOLD) * kMicrosecondsPerMillisecond));

return CHIP_NO_ERROR;
// Use CHIP_SYSTEM_CONFIG_VALID_REAL_TIME_THRESHOLD as the initial value of RealTime.
// Then the RealTime obtained from GetClock_RealTime will be always valid.
//
// TODO(19081): This is broken because it causes the platform to report
// that it does have wall clock time when it actually doesn't.
return System::SystemClock().SetClock_RealTime(baseTime);
}

} // namespace Clock
Expand Down
26 changes: 18 additions & 8 deletions src/platform/Beken/matter_pal.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
/**
****************************************************************************************
/*
*
* Copyright (c) 2022 Project CHIP Authors
*
* @file matter_pal.h
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* @brief This file contains matter_pal.
* @author zhengyaohan
* @date 2022-03-29
* http://www.apache.org/licenses/LICENSE-2.0
*
****************************************************************************************
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file
* This file contains matter_pal.
*/

#ifndef _MATTER_PAL_H_
Expand All @@ -34,5 +44,5 @@
#include "at_ble_common.h"
#include "ble.h"

#endif // _HOMEKIT_PAL_H_
#endif // _MATTER_PAL_H_
// eof

0 comments on commit 2d01950

Please sign in to comment.