-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlwipTime.cpp
28 lines (23 loc) · 918 Bytes
/
lwipTime.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* \file
* \brief Definitions of time-related functions for lwIP
*
* \author Copyright (C) 2019 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
*
* \par License
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
* distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "lwip/sys.h"
#include "distortos/TickClock.hpp"
/*---------------------------------------------------------------------------------------------------------------------+
| global functions
+---------------------------------------------------------------------------------------------------------------------*/
u32_t sys_jiffies()
{
return distortos::TickClock::now().time_since_epoch().count();
}
u32_t sys_now()
{
return std::chrono::milliseconds{distortos::TickClock::now().time_since_epoch()}.count();
}