Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: blinky_max32630fthr
features/mbedtls/inc/mbedtls/platform_time.h@3:1198227e6421, 2016-12-16 (annotated)
- Committer:
- switches
- Date:
- Fri Dec 16 16:27:57 2016 +0000
- Revision:
- 3:1198227e6421
- Parent:
- 0:5c4d7b2438d3
Changed ADC scale for MAX32625 platforms to 1.2V full scale to match MAX32630 platforms
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
switches | 0:5c4d7b2438d3 | 1 | /** |
switches | 0:5c4d7b2438d3 | 2 | * \file platform_time.h |
switches | 0:5c4d7b2438d3 | 3 | * |
switches | 0:5c4d7b2438d3 | 4 | * \brief mbed TLS Platform time abstraction |
switches | 0:5c4d7b2438d3 | 5 | * |
switches | 0:5c4d7b2438d3 | 6 | * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved |
switches | 0:5c4d7b2438d3 | 7 | * SPDX-License-Identifier: Apache-2.0 |
switches | 0:5c4d7b2438d3 | 8 | * |
switches | 0:5c4d7b2438d3 | 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
switches | 0:5c4d7b2438d3 | 10 | * not use this file except in compliance with the License. |
switches | 0:5c4d7b2438d3 | 11 | * You may obtain a copy of the License at |
switches | 0:5c4d7b2438d3 | 12 | * |
switches | 0:5c4d7b2438d3 | 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
switches | 0:5c4d7b2438d3 | 14 | * |
switches | 0:5c4d7b2438d3 | 15 | * Unless required by applicable law or agreed to in writing, software |
switches | 0:5c4d7b2438d3 | 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
switches | 0:5c4d7b2438d3 | 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
switches | 0:5c4d7b2438d3 | 18 | * See the License for the specific language governing permissions and |
switches | 0:5c4d7b2438d3 | 19 | * limitations under the License. |
switches | 0:5c4d7b2438d3 | 20 | * |
switches | 0:5c4d7b2438d3 | 21 | * This file is part of mbed TLS (https://tls.mbed.org) |
switches | 0:5c4d7b2438d3 | 22 | */ |
switches | 0:5c4d7b2438d3 | 23 | #ifndef MBEDTLS_PLATFORM_TIME_H |
switches | 0:5c4d7b2438d3 | 24 | #define MBEDTLS_PLATFORM_TIME_H |
switches | 0:5c4d7b2438d3 | 25 | |
switches | 0:5c4d7b2438d3 | 26 | #if !defined(MBEDTLS_CONFIG_FILE) |
switches | 0:5c4d7b2438d3 | 27 | #include "config.h" |
switches | 0:5c4d7b2438d3 | 28 | #else |
switches | 0:5c4d7b2438d3 | 29 | #include MBEDTLS_CONFIG_FILE |
switches | 0:5c4d7b2438d3 | 30 | #endif |
switches | 0:5c4d7b2438d3 | 31 | |
switches | 0:5c4d7b2438d3 | 32 | #ifdef __cplusplus |
switches | 0:5c4d7b2438d3 | 33 | extern "C" { |
switches | 0:5c4d7b2438d3 | 34 | #endif |
switches | 0:5c4d7b2438d3 | 35 | |
switches | 0:5c4d7b2438d3 | 36 | /** |
switches | 0:5c4d7b2438d3 | 37 | * \name SECTION: Module settings |
switches | 0:5c4d7b2438d3 | 38 | * |
switches | 0:5c4d7b2438d3 | 39 | * The configuration options you can set for this module are in this section. |
switches | 0:5c4d7b2438d3 | 40 | * Either change them in config.h or define them on the compiler command line. |
switches | 0:5c4d7b2438d3 | 41 | * \{ |
switches | 0:5c4d7b2438d3 | 42 | */ |
switches | 0:5c4d7b2438d3 | 43 | |
switches | 0:5c4d7b2438d3 | 44 | /* |
switches | 0:5c4d7b2438d3 | 45 | * The time_t datatype |
switches | 0:5c4d7b2438d3 | 46 | */ |
switches | 0:5c4d7b2438d3 | 47 | #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) |
switches | 0:5c4d7b2438d3 | 48 | typedef MBEDTLS_PLATFORM_TIME_TYPE_MACRO mbedtls_time_t; |
switches | 0:5c4d7b2438d3 | 49 | #else |
switches | 0:5c4d7b2438d3 | 50 | /* For time_t */ |
switches | 0:5c4d7b2438d3 | 51 | #include <time.h> |
switches | 0:5c4d7b2438d3 | 52 | typedef time_t mbedtls_time_t; |
switches | 0:5c4d7b2438d3 | 53 | #endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */ |
switches | 0:5c4d7b2438d3 | 54 | |
switches | 0:5c4d7b2438d3 | 55 | /* |
switches | 0:5c4d7b2438d3 | 56 | * The function pointers for time |
switches | 0:5c4d7b2438d3 | 57 | */ |
switches | 0:5c4d7b2438d3 | 58 | #if defined(MBEDTLS_PLATFORM_TIME_ALT) |
switches | 0:5c4d7b2438d3 | 59 | extern mbedtls_time_t (*mbedtls_time)( mbedtls_time_t* time ); |
switches | 0:5c4d7b2438d3 | 60 | |
switches | 0:5c4d7b2438d3 | 61 | /** |
switches | 0:5c4d7b2438d3 | 62 | * \brief Set your own time function pointer |
switches | 0:5c4d7b2438d3 | 63 | * |
switches | 0:5c4d7b2438d3 | 64 | * \param time_func the time function implementation |
switches | 0:5c4d7b2438d3 | 65 | * |
switches | 0:5c4d7b2438d3 | 66 | * \return 0 |
switches | 0:5c4d7b2438d3 | 67 | */ |
switches | 0:5c4d7b2438d3 | 68 | int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* time ) ); |
switches | 0:5c4d7b2438d3 | 69 | #else |
switches | 0:5c4d7b2438d3 | 70 | #if defined(MBEDTLS_PLATFORM_TIME_MACRO) |
switches | 0:5c4d7b2438d3 | 71 | #define mbedtls_time MBEDTLS_PLATFORM_TIME_MACRO |
switches | 0:5c4d7b2438d3 | 72 | #else |
switches | 0:5c4d7b2438d3 | 73 | #define mbedtls_time time |
switches | 0:5c4d7b2438d3 | 74 | #endif /* MBEDTLS_PLATFORM_TIME_MACRO */ |
switches | 0:5c4d7b2438d3 | 75 | #endif /* MBEDTLS_PLATFORM_TIME_ALT */ |
switches | 0:5c4d7b2438d3 | 76 | |
switches | 0:5c4d7b2438d3 | 77 | #ifdef __cplusplus |
switches | 0:5c4d7b2438d3 | 78 | } |
switches | 0:5c4d7b2438d3 | 79 | #endif |
switches | 0:5c4d7b2438d3 | 80 | |
switches | 0:5c4d7b2438d3 | 81 | #endif /* platform_time.h */ |