Denislam Valeev
/
Nucleo_rtos_basic
1
mbed-os/rtos/Kernel.h@0:e056ac8fecf8, 2018-03-13 (annotated)
- Committer:
- valeyev
- Date:
- Tue Mar 13 07:17:50 2018 +0000
- Revision:
- 0:e056ac8fecf8
looking for...
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
valeyev | 0:e056ac8fecf8 | 1 | /* mbed Microcontroller Library |
valeyev | 0:e056ac8fecf8 | 2 | * Copyright (c) 2017 ARM Limited |
valeyev | 0:e056ac8fecf8 | 3 | * |
valeyev | 0:e056ac8fecf8 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
valeyev | 0:e056ac8fecf8 | 5 | * of this software and associated documentation files (the "Software"), to deal |
valeyev | 0:e056ac8fecf8 | 6 | * in the Software without restriction, including without limitation the rights |
valeyev | 0:e056ac8fecf8 | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
valeyev | 0:e056ac8fecf8 | 8 | * copies of the Software, and to permit persons to whom the Software is |
valeyev | 0:e056ac8fecf8 | 9 | * furnished to do so, subject to the following conditions: |
valeyev | 0:e056ac8fecf8 | 10 | * |
valeyev | 0:e056ac8fecf8 | 11 | * The above copyright notice and this permission notice shall be included in |
valeyev | 0:e056ac8fecf8 | 12 | * all copies or substantial portions of the Software. |
valeyev | 0:e056ac8fecf8 | 13 | * |
valeyev | 0:e056ac8fecf8 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
valeyev | 0:e056ac8fecf8 | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
valeyev | 0:e056ac8fecf8 | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
valeyev | 0:e056ac8fecf8 | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
valeyev | 0:e056ac8fecf8 | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
valeyev | 0:e056ac8fecf8 | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
valeyev | 0:e056ac8fecf8 | 20 | * SOFTWARE. |
valeyev | 0:e056ac8fecf8 | 21 | */ |
valeyev | 0:e056ac8fecf8 | 22 | #ifndef KERNEL_H |
valeyev | 0:e056ac8fecf8 | 23 | #define KERNEL_H |
valeyev | 0:e056ac8fecf8 | 24 | |
valeyev | 0:e056ac8fecf8 | 25 | #include <stdint.h> |
valeyev | 0:e056ac8fecf8 | 26 | |
valeyev | 0:e056ac8fecf8 | 27 | namespace rtos { |
valeyev | 0:e056ac8fecf8 | 28 | /** \addtogroup rtos */ |
valeyev | 0:e056ac8fecf8 | 29 | /** @{*/ |
valeyev | 0:e056ac8fecf8 | 30 | |
valeyev | 0:e056ac8fecf8 | 31 | /** Functions in the Kernel namespace control RTOS kernel information. */ |
valeyev | 0:e056ac8fecf8 | 32 | namespace Kernel { |
valeyev | 0:e056ac8fecf8 | 33 | |
valeyev | 0:e056ac8fecf8 | 34 | /** Read the current RTOS kernel millisecond tick count. |
valeyev | 0:e056ac8fecf8 | 35 | The tick count corresponds to the tick count used by the RTOS for timing |
valeyev | 0:e056ac8fecf8 | 36 | purposes. It increments monotonically from 0 at boot, hence effectively |
valeyev | 0:e056ac8fecf8 | 37 | never wraps. If the underlying RTOS only provides a 32-bit tick count, |
valeyev | 0:e056ac8fecf8 | 38 | this method expands it to 64 bits. |
valeyev | 0:e056ac8fecf8 | 39 | @return RTOS kernel current tick count |
valeyev | 0:e056ac8fecf8 | 40 | @note mbed OS always uses millisecond RTOS ticks, and this could only wrap |
valeyev | 0:e056ac8fecf8 | 41 | after half a billion years |
valeyev | 0:e056ac8fecf8 | 42 | @note You cannot call this function from ISR context. |
valeyev | 0:e056ac8fecf8 | 43 | */ |
valeyev | 0:e056ac8fecf8 | 44 | uint64_t get_ms_count(); |
valeyev | 0:e056ac8fecf8 | 45 | |
valeyev | 0:e056ac8fecf8 | 46 | } // namespace Kernel |
valeyev | 0:e056ac8fecf8 | 47 | |
valeyev | 0:e056ac8fecf8 | 48 | } // namespace rtos |
valeyev | 0:e056ac8fecf8 | 49 | #endif |
valeyev | 0:e056ac8fecf8 | 50 | |
valeyev | 0:e056ac8fecf8 | 51 | /** @}*/ |