-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkernel.h
61 lines (45 loc) · 2.56 KB
/
kernel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*/////////////////////////////////////////////////////////////////////////////
// OS Zero v0.0 //
// Simplest cooperative multitasking kernel intended to smallest //
// 8bit microcontrollers. Implemented by STVD and CXSTM8 compiler //
;/ (C) Simplest System Solutions (canceled) //
// is a personal logo of independent developer Vyacheslav Azarov //
// License bellow. Email: [email protected] Skipe: slavaza63 //
//////////////////////////////////////////////////////////////////////////// */
#ifndef _KERNEL_H_
#define _KERNEL_H_
#include <stdbool.h>
#include <stddef.h>
/*/////////////////////////////////////////////////////////////////////////////
// Definitions what depend on application reqirements //
//////////////////////////////////////////////////////////////////////////// */
#include <iostm8l152x.h>
#define PENDING_QUEUE_LIMIT 4
#define __reset() // You simple code to integrity saving before restart
/*/////////////////////////////////////////////////////////////////////////////
// Thread control functions what implement horizontal iterations //
//////////////////////////////////////////////////////////////////////////// */
void yield(void);
#define await(condition) while (!(condition)) yield()
volatile extern void * self;
bool spawn(void * stack, void (* start)(void));
bool alive(void * stack);
void die(void);
/*/////////////////////////////////////////////////////////////////////////////
// System timebase functions and countdown timers //
//////////////////////////////////////////////////////////////////////////// */
extern volatile unsigned int msec;
unsigned long millis(void);
void delay(unsigned long ms);
/*/////////////////////////////////////////////////////////////////////////////
// Global system control of functionflity //
//////////////////////////////////////////////////////////////////////////// */
void start(void);
void reset(void);
/*_KERNEL_H_*/
#endif
/*/////////////////////////////////////////////////////////////////////////////
// LICENSE //
// Nothing can prevent you to use these materials in any of your purposes //
// in case of mention of the author and his logo in your projects. //
//////////////////////////////////////////////////////////////////////////// */