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