Line data Source code
1 : /* SPDX-FileCopyrightText: Copyright 2026 Cozens Software Solutions Limited
2 : * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0 OR LicenseRef-PolyForm-Internal-Use-1.0.0 OR LicenseRef-COSOSO-Commercial
3 : */
4 :
5 : #include "SolidSyslogVxWorks64Sleep.h"
6 :
7 : #include <stdint.h>
8 :
9 : #include "vxWorks.h"
10 :
11 : #include "sysLib.h"
12 : #include "taskLib.h"
13 :
14 : enum
15 : {
16 : MILLISECONDS_PER_SECOND = 1000
17 : };
18 :
19 4 : void SolidSyslogVxWorks64_Sleep(uint32_t milliseconds)
20 : {
21 4 : int64_t ticks = (((int64_t) milliseconds * (int64_t) sysClkRateGet()) + (MILLISECONDS_PER_SECOND - 1)) /
22 : MILLISECONDS_PER_SECOND;
23 4 : (void) taskDelay((int) ticks);
24 4 : }
|