Skip to content

Commit 3934019

Browse files
committed
Set link to example code (examples RTOS)
1 parent ae7fdc7 commit 3934019

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

docs/api/rtos/Kernel.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,11 @@ The Kernel namespace implements interfaces to attach a function to some kernel e
1010

1111
The function `get_ms_count()` can be used to read the current RTOS kernel millisecond tick count. The below code snippet demonstrates use of the `get_ms_count()` function to calculate the elapsed time:
1212

13-
```
14-
void send_data()
15-
{
16-
// 64-bit time doesn't wrap for half a billion years, at least
17-
uint64_t now = Kernel::get_ms_count();
18-
//do some operations
19-
// ...
13+
[![View code](https://www.mbed.com/embed/?url=https://github.com/ARMmbed/mbed-os-examples-docs_only/blob/master/APIs_RTOS/Kernel_get_ms_count)](https://github.com/ARMmbed/mbed-os-examples-docs_only/blob/master/APIs_RTOS/Kernel_get_ms_count/main.cpp)
2014

21-
uint64_t later = Kernel::get_ms_count();
22-
23-
//calculate millisecs elapsed
24-
uint64_t elapsed_ms = later - now;
25-
}
26-
27-
```
2815

2916
## Kernel hooks example
3017

3118
You can use the function `attach_idle_hook()` to attach a function to be called by the RTOS idle task. You can use the function `attach_thread_terminate_hook()` to attach a function to be called when a thread terminates. The below code snippet demostrates the usage of these hooks.
3219

33-
[![View Example](https://www.mbed.com/embed/?url=https://github.com/ARMmbed/mbed-os-example-kernel-hooks)](https://github.com/ARMmbed/mbed-os-example-kernel-hooks/blob/master/main.cpp)
20+
[![View code](https://www.mbed.com/embed/?url=https://github.com/ARMmbed/mbed-os-examples-docs_only/blob/master/APIs_RTOS/Kernel_hooks)](https://github.com/ARMmbed/mbed-os-examples-docs_only/blob/master/APIs_RTOS/Kernel_hooks/main.cpp)

docs/api/rtos/Queue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (evt.status == osEventMessage) {
2828

2929
This example shows `Queue` and [MemoryPool](memorypool.html) managing measurements.
3030

31-
[![View code](https://www.mbed.com/embed/?url=https://os.mbed.com/teams/mbed_example/code/rtos_queue/)](https://os.mbed.com/teams/mbed_example/code/rtos_queue/file/bbbae4aa4768/main.cpp)
31+
[![View code](https://www.mbed.com/embed/?url=https://github.com/ARMmbed/mbed-os-examples-docs_only/blob/master/APIs_RTOS/Queue)](https://github.com/ARMmbed/mbed-os-examples-docs_only/blob/master/APIs_RTOS/Queue/main.cpp)
3232

3333
## Related content
3434

0 commit comments

Comments
 (0)