mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-10-23 04:41:32 +00:00
First iteration that seems to work
This commit is contained in:
commit
8d1823d0b6
205 files changed
+41989
No files matched your search
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "ZephyrRTCClock.h"
|
||||
#include <zephyr/kernel.h>
|
||||
|
||||
namespace mesh {
|
||||
|
||||
uint32_t ZephyrRTCClock::getCurrentTime()
|
||||
{
|
||||
uint32_t uptime_sec = (uint32_t)(k_uptime_get() / 1000);
|
||||
return epoch_offset + uptime_sec;
|
||||
}
|
||||
|
||||
void ZephyrRTCClock::setCurrentTime(uint32_t time)
|
||||
{
|
||||
uint32_t uptime_sec = (uint32_t)(k_uptime_get() / 1000);
|
||||
epoch_offset = time - uptime_sec;
|
||||
}
|
||||
|
||||
} /* namespace mesh */
|
||||
Reference in new issue
Block a user