Skip to content

Commit c67ba6c

Browse files
author
Amanda Butler
authored
Merge pull request #792 from SenRamakri/sen_KernelDocUpdate
Kernel documentation updated with new additions to Kernel namespace
2 parents 1494fdb + f95cf43 commit c67ba6c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

docs/api/rtos/Kernel.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
## Kernel interface functions
22

3-
The Kernel namespace implements functions to read RTOS information. Currently it implements one function to read the current RTOS kernel millisecond tick count.
3+
The Kernel namespace implements interfaces to attach a function to some kernel events and also to read the kernel tick count.
44

55
### Kernel namespace reference
66

77
[![View code](https://www.mbed.com/embed/?type=library)](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/namespacertos_1_1_kernel.html)
88

99
### `get_ms_count()` example
1010

11-
Kernel implements one function named `get_ms_count()` 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:
11+
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

1313
```
1414
void send_data()
@@ -23,4 +23,17 @@ void send_data()
2323
//calculate millisecs elapsed
2424
uint64_t elapsed_ms = later - now;
2525
}
26+
2627
```
28+
29+
### `attach_idle_hook()` example
30+
31+
The function `attach_idle_hook()` can be used to attach a function to be called by the RTOS idle task. The below code snippet demostrates the usage.
32+
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)
34+
35+
### `attach_thread_terminate_hook()` example
36+
37+
The function `attach_thread_terminate_hook()` can be used to attach a function to be called when a thread terminates.
38+
39+
[![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)

0 commit comments

Comments
 (0)