1234567891011121314151617181920212223242526272829303132 |
- #ifdef UA_ARCHITECTURE_FREERTOSLWIP
- #include <open62541/types.h>
- #include <task.h>
- UA_DateTime UA_DateTime_now(void) {
- UA_DateTime microSeconds = ((UA_DateTime)xTaskGetTickCount()) * (1000000 / configTICK_RATE_HZ);
- return ((microSeconds / 1000000) * UA_DATETIME_SEC) + ((microSeconds % 1000000) * UA_DATETIME_USEC) + UA_DATETIME_UNIX_EPOCH;
- }
- UA_Int64 UA_DateTime_localTimeUtcOffset(void) {
- return 0;
- }
- UA_DateTime UA_DateTime_nowMonotonic(void) {
- return (((UA_DateTime)xTaskGetTickCount()) * 1000 / configTICK_RATE_HZ) * UA_DATETIME_MSEC;
- }
- #endif
|