-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbugurt_config.h
79 lines (62 loc) · 2.82 KB
/
bugurt_config.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef BGRT_CONFIG_H
/*This is example config file*/
#define BGRT_CONFIG_H
/**================================================================*/
/** Don't edit this part of the file!!! */
/**================================================================*/
#define BGRT_SC_TBL(a) const bgrt_scsr_t a
#define BGRT_SC_TBL_READ(a) a
#define WEAK
#define NOP() __asm__("nop")
typedef unsigned char bgrt_stack_t;
/**================================================================*/
/** Edit this part carefully!!! */
/**================================================================*/
/* Max priority levels are defined by bgrt_map_t,*/
/* you must specify BGRT_BITS_IN_INDEX_T to show*/
/* how many levels you actually are going to use.*/
typedef unsigned char bgrt_map_t;
#define BGRT_BITS_IN_INDEX_T (8)
/* Even if bgrt_map_t is unsigned long long,*/
/* there will be only 64 priority levels available,*/
/* so unsigned char is always enough.*/
typedef unsigned char bgrt_prio_t;
/* Unsigned char is enough.*/
typedef unsigned char bgrt_flag_t;
/* unsigned char is enough.*/
typedef unsigned char bgrt_st_t;
/*For STM8 only 64Kib of stack space*/
/* may be available, so bgrt_cnt_t can be*/
/* unsigned char or unsigned short.*/
/* Unsigned short is enough.*/
#define BGRT_CONFIG_CNT_MAX (0xffff)
typedef unsigned short bgrt_cnt_t;
/* You can specify any unsigned type here. */
typedef unsigned short bgrt_tmr_t;
/* Unsigned char is enough.*/
/* There is no reason to make it bigger.*/
typedef unsigned char bgrt_bool_t;
/* Unsigned char is enough.*/
/* There is no reason to make it bigger.*/
typedef volatile unsigned char bgrt_syscall_t;
/*=================================================================*/
/** BuguRTOS behavior compilation flags, edit carefully!!! */
/*=================================================================*/
#define BGRT_CONFIG_HARD_RT
/*=================================================================*/
/* Project specific stuff, you are welcome to edit it!!! */
/*=================================================================*/
#define INT_TIM4_CHANGE 23
#define BGRT_SYSTEM_TIMER_VECTOR INT_TIM4_CHANGE
#include <stm8s.h>
#define BGRT_SYSTEM_TIMER_INTERRUPT_CLEAR() (TIM4_ClearITPendingBit(TIM4_IT_UPDATE))
//#define BGRT_STOP_SCHEDULER() (TIM4_IER = 0x00)
//#define BGRT_START_SCHEDULER() (TIM4_IER = 0x01)
#define BGRT_PROC_STACK_SIZE (160)
#define LOWEST (BGRT_BITS_IN_INDEX_T - 1)
/**================================================================*/
/** Don't edit this part of the file!!! */
/**================================================================*/
extern void kernel_preemt_hook(void);
#define BGRT_KERNEL_PREEMPT() kernel_preemt_hook()
#endif /*BGRT_CONFIG_H*/