• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 FuZhou Lockzhiner Electronic Co., Ltd. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**@defgroup los_config System configuration items
17  * @ingroup kernel
18  */
19 
20 #ifndef _TARGET_CONFIG_H
21 #define _TARGET_CONFIG_H
22 
23 #include "link.h"
24 #include "soc.h"
25 
26 #ifdef __cplusplus
27 #if __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30 #endif /* __cplusplus */
31 
32 /*=============================================================================
33                                         System clock module configuration
34 =============================================================================*/
35 #define OS_SYS_CLOCK                                        96000000UL
36 #define LOSCFG_BASE_CORE_TICK_PER_SECOND                    (1000UL)
37 #define LOSCFG_BASE_CORE_TICK_HW_TIME                       0
38 #define LOSCFG_BASE_CORE_TICK_WTIMER                        0
39 #define LOSCFG_BASE_CORE_TICK_RESPONSE_MAX                  0xFFFFFFUL
40 
41 
42 /*=============================================================================
43                                         Hardware interrupt module configuration
44 =============================================================================*/
45 #define LOSCFG_PLATFORM_HWI                                 1
46 #define LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT                 1
47 #define LOSCFG_PLATFORM_HWI_LIMIT                           128
48 
49 
50 /*=============================================================================
51                                        Task module configuration
52 =============================================================================*/
53 #define LOSCFG_BASE_CORE_TSK_LIMIT                          63
54 #define LOSCFG_BASE_CORE_TSK_IDLE_STACK_SIZE                (0x1000U)
55 #define LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE             (0x1000U)
56 #define LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE                 (0x200U)
57 #define LOSCFG_BASE_CORE_TIMESLICE                          1
58 #define LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT                  20000
59 
60 
61 /*=============================================================================
62                                        Semaphore module configuration
63 =============================================================================*/
64 #define LOSCFG_BASE_IPC_SEM                                 1
65 #define LOSCFG_BASE_IPC_SEM_LIMIT                           48
66 
67 
68 /*=============================================================================
69                                        Mutex module configuration
70 =============================================================================*/
71 #define LOSCFG_BASE_IPC_MUX                                 1
72 #define LOSCFG_BASE_IPC_MUX_LIMIT                           48
73 
74 
75 /*=============================================================================
76                                        Queue module configuration
77 =============================================================================*/
78 #define LOSCFG_BASE_IPC_QUEUE                               1
79 #define LOSCFG_BASE_IPC_QUEUE_LIMIT                         48
80 
81 
82 /*=============================================================================
83                                        Software timer module configuration
84 =============================================================================*/
85 #define LOSCFG_BASE_CORE_SWTMR                              1
86 #define LOSCFG_BASE_CORE_SWTMR_ALIGN                        0
87 #define LOSCFG_BASE_CORE_SWTMR_LIMIT                        48
88 
89 
90 /*=============================================================================
91                                        Memory module configuration
92 =============================================================================*/
93 #define LOSCFG_MEM_MUL_POOL                                 1
94 #define OS_SYS_MEM_NUM                                      20
95 
96 
97 /*=============================================================================
98                                        Exception module configuration
99 =============================================================================*/
100 #define LOSCFG_PLATFORM_EXC                                 1
101 
102 
103 /* =============================================================================
104                                        printf module configuration
105 ============================================================================= */
106 #define LOSCFG_KERNEL_PRINTF                                1
107 #define LOSCFG_BASE_CORE_SCHED_SLEEP                        1
108 #define LOSCFG_BASE_CORE_TSK_MONITOR                        1
109 #define LOSCFG_BASE_CORE_CPUP                               1
110 #define LOSCFG_BASE_CORE_EXC_TSK_SWITCH                     1
111 #define LOSCFG_SYS_EXTERNAL_HEAP                            1
112 #define LOSCFG_MEM_FREE_BY_TASKID                           1
113 #define LOSCFG_BASE_MEM_NODE_INTEGRITY_CHECK                1
114 #define LOSCFG_MEM_LEAKCHECK                                1
115 #define LOSCFG_HAL_TRACE_PRINTF                             1
116 #define HAL_TRACE_DEBUG                                     8
117 
118 /*=============================================================================
119                                        Memory module configuration
120 =============================================================================*/
121 extern unsigned int _heap_start;
122 #define LOSCFG_SYS_HEAP_ADDR                                ((unsigned char *)(&_heap_start))
123 #define LOSCFG_SYS_HEAP_SIZE                                (PSRAM_SIZE - SYS_STACK_SIZE)
124 
125 
126 /*=============================================================================
127                                        Hardware interrupt configuration
128 =============================================================================*/
129 #define LOSCFG_PLATFORM_HWI_WITH_ARG                        1
130 
131 
132 /*=============================================================================
133                                        Section configuration
134 =============================================================================*/
135 
136 
137 #define LOSCFG_ARCH_HWI_VECTOR_ALIGN                        0x200
138 
139 
140 #ifdef __cplusplus
141 #if __cplusplus
142 }
143 #endif /* __cplusplus */
144 #endif /* __cplusplus */
145 
146 #endif /* _TARGET_CONFIG_H */
147