source: azure_iot_hub/trunk/azure_iothub/c-utility/inc/azure_c_shared_utility/tickcounter.h@ 389

Last change on this file since 389 was 389, checked in by coas-nagasima, 5 years ago

ビルドが通るよう更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 1.0 KB
Line 
1// Copyright (c) Microsoft. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4#ifndef TICKCOUNTER_H
5#define TICKCOUNTER_H
6
7#ifdef __cplusplus
8extern "C"
9{
10#endif /* __cplusplus */
11
12#include <stdint.h>
13
14#include "azure_c_shared_utility/umock_c_prod.h"
15
16#if defined(_WIN32) || defined(__MBED__)
17 typedef uint_fast64_t tickcounter_ms_t; // Use 64-bit because of 32-bit is going to roll over back to zero after roughly 49.7 days that is not good for IoT devices which need keep running for months
18#else
19 typedef uint_fast32_t tickcounter_ms_t;
20#endif
21
22 typedef struct TICK_COUNTER_INSTANCE_TAG *TICK_COUNTER_HANDLE;
23
24 MOCKABLE_FUNCTION(, TICK_COUNTER_HANDLE, tickcounter_create);
25 MOCKABLE_FUNCTION(, void, tickcounter_destroy, TICK_COUNTER_HANDLE, tick_counter);
26 MOCKABLE_FUNCTION(, int, tickcounter_get_current_ms, TICK_COUNTER_HANDLE, tick_counter, tickcounter_ms_t *, current_ms);
27
28#ifdef __cplusplus
29}
30#endif /* __cplusplus */
31
32#endif /* TICKCOUNTER_H */
Note: See TracBrowser for help on using the repository browser.