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.
kernel.h@4:357a34c10ef2, 2017-10-03 (annotated)
- Committer:
- rmaalmeida
- Date:
- Tue Oct 03 00:17:53 2017 +0000
- Revision:
- 4:357a34c10ef2
cooperative soft real time kernel added. using tick as timer interrupt
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| rmaalmeida | 4:357a34c10ef2 | 1 | #ifndef KERNEL_H_ |
| rmaalmeida | 4:357a34c10ef2 | 2 | #define KERNEL_H_ |
| rmaalmeida | 4:357a34c10ef2 | 3 | |
| rmaalmeida | 4:357a34c10ef2 | 4 | // c�digos de retorno |
| rmaalmeida | 4:357a34c10ef2 | 5 | #define SUCCESS 0 |
| rmaalmeida | 4:357a34c10ef2 | 6 | #define FAIL 1 |
| rmaalmeida | 4:357a34c10ef2 | 7 | #define REPEAT 2 |
| rmaalmeida | 4:357a34c10ef2 | 8 | #define POOL_SIZE 10 |
| rmaalmeida | 4:357a34c10ef2 | 9 | |
| rmaalmeida | 4:357a34c10ef2 | 10 | // declara��o de ponteiro de fun��o |
| rmaalmeida | 4:357a34c10ef2 | 11 | typedef char(*ptrFunc)(void); |
| rmaalmeida | 4:357a34c10ef2 | 12 | |
| rmaalmeida | 4:357a34c10ef2 | 13 | typedef struct { |
| rmaalmeida | 4:357a34c10ef2 | 14 | ptrFunc function; |
| rmaalmeida | 4:357a34c10ef2 | 15 | int period; |
| rmaalmeida | 4:357a34c10ef2 | 16 | //must be volatile to avoid optmizations on kernel waiting |
| rmaalmeida | 4:357a34c10ef2 | 17 | volatile int deadline; |
| rmaalmeida | 4:357a34c10ef2 | 18 | } process; |
| rmaalmeida | 4:357a34c10ef2 | 19 | |
| rmaalmeida | 4:357a34c10ef2 | 20 | // prot�tipos das fun��es do kernel |
| rmaalmeida | 4:357a34c10ef2 | 21 | void kernelInit(void); |
| rmaalmeida | 4:357a34c10ef2 | 22 | char kernelAddProc(process* func); |
| rmaalmeida | 4:357a34c10ef2 | 23 | void kernelLoop(void);// declara��o de ponteiro de fun��o |
| rmaalmeida | 4:357a34c10ef2 | 24 | void kernelTick(void); |
| rmaalmeida | 4:357a34c10ef2 | 25 | |
| rmaalmeida | 4:357a34c10ef2 | 26 | #endif |