krnl
1
Loading...
Searching...
No Matches
examples
oldexamples
old-may-not_work
myfirst
myfirst.ino
Go to the documentation of this file.
1
#include <
krnl.h
>
2
3
struct
k_t
*
pTaskInfo
;
4
5
char
stak
[100];
6
7
void
code
(
void
)
8
{
9
int
r;
10
11
while
(1) {
12
digitalWrite(13,HIGH);
13
k_sleep
(300);
14
digitalWrite(13,LOW);
15
k_sleep
(300);
16
}
17
}
18
19
void
setup
()
20
{
21
Serial.begin(9600);
22
pinMode(13,OUTPUT);
23
24
k_init
(1,0,0);
25
26
pTaskInfo
=
k_crt_task
(
code
,11,
stak
,100);
27
28
k_start
(1);
// krnl runs with 1 msec heartbeat
29
/* NOTE: legal time values:
30
1-10 : 1-10 milliseconds
31
19,20,30,40...10000: 10,20... milliseconds
32
if you try negative or 11,54 etc it will not start
33
*/
34
}
35
36
void
loop
()
37
{
// never used
38
}
39
40
41
42
stak
char stak[100]
Definition
k02.ino:12
k_sleep
int k_sleep(int time)
let task sleep for a number of milliseconds
Definition
krnl.c:445
k_crt_task
struct k_t * k_crt_task(void(*pTask)(void), char prio, char *pStk, int stkSize)
create a task - only to be called before k_start creates a task and put it in the active Q
Definition
krnl.c:328
k_init
int k_init(int nrTask, int nrSem, int nrMsg)
Definition
krnl.c:1108
k_start
int k_start()
Definition
krnl.c:1149
krnl.h
setup
void setup()
Definition
myfirst.ino:19
pTaskInfo
struct k_t * pTaskInfo
Definition
myfirst.ino:3
code
void code(void)
Definition
myfirst.ino:7
loop
void loop()
Definition
myfirst.ino:36
k_t
Definition
krnl.h:323
Generated by
1.15.0