1 /* 2 * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. 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 <stdbool.h> 24 #include "gd32f4xx.h" 25 26 27 #ifdef __cplusplus 28 #if __cplusplus 29 extern "C" { 30 #endif /* __cplusplus */ 31 #endif /* __cplusplus */ 32 33 /*============================================================================= 34 System clock module configuration 35 =============================================================================*/ 36 #define OS_SYS_CLOCK SystemCoreClock 37 #define LOSCFG_BASE_CORE_TICK_PER_SECOND (1000UL) 38 #define LOSCFG_BASE_CORE_TICK_HW_TIME 0 39 #define LOSCFG_BASE_CORE_TICK_WTIMER 0 40 #define LOSCFG_BASE_CORE_TICK_RESPONSE_MAX SysTick_LOAD_RELOAD_Msk 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 90 48 #define LOSCFG_PLATFORM_HWI_WITH_ARG 1 49 /*============================================================================= 50 Task module configuration 51 =============================================================================*/ 52 #define LOSCFG_BASE_CORE_TSK_LIMIT 24 53 #define LOSCFG_BASE_CORE_TSK_IDLE_STACK_SIZE (0x1000U) 54 #define LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE (0x1600U) 55 #define LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE (0x130U) 56 #define LOSCFG_BASE_CORE_TIMESLICE 1 57 #define LOSCFG_BASE_CORE_TIMESLICE_TIMEOUT 10 58 /*============================================================================= 59 Semaphore module configuration 60 =============================================================================*/ 61 #define LOSCFG_BASE_IPC_SEM 1 62 #define LOSCFG_BASE_IPC_SEM_LIMIT 48 63 /*============================================================================= 64 Mutex module configuration 65 =============================================================================*/ 66 #define LOSCFG_BASE_IPC_MUX 1 67 #define LOSCFG_BASE_IPC_MUX_LIMIT 200 68 /*============================================================================= 69 Queue module configuration 70 =============================================================================*/ 71 #define LOSCFG_BASE_IPC_QUEUE 1 72 #define LOSCFG_BASE_IPC_QUEUE_LIMIT 24 73 /*============================================================================= 74 Software timer module configuration 75 =============================================================================*/ 76 #define LOSCFG_BASE_CORE_SWTMR 1 77 #define LOSCFG_BASE_CORE_SWTMR_ALIGN 0 78 #define LOSCFG_BASE_CORE_SWTMR_LIMIT 48 79 /*============================================================================= 80 Memory module configuration 81 =============================================================================*/ 82 #define LOSCFG_MEM_MUL_POOL 1 83 #define OS_SYS_MEM_NUM 20 84 #define LOSCFG_KERNEL_PRINTF 1 85 86 #define LOSCFG_BASE_CORE_SCHED_SLEEP 1 87 88 #define LOSCFG_SYS_EXTERNAL_HEAP 1 89 #define LOSCFG_SYS_HEAP_ADDR (void *)0xC0000000 90 #define LOSCFG_SYS_HEAP_SIZE 0x800000UL // 8M bytes 91 92 #ifdef __cplusplus 93 #if __cplusplus 94 } 95 #endif /* __cplusplus */ 96 #endif /* __cplusplus */ 97 98 #endif /* _TARGET_CONFIG_H */ 99