Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into xidatong-arm32
This commit is contained in:
@@ -137,10 +137,10 @@ COMPILE_KERNEL:
|
||||
COMPILE_APP:
|
||||
@echo $(SRC_APP_DIR)
|
||||
@for dir in $(SRC_APP_DIR);do \
|
||||
$(MAKE) -C $$dir USE_APP_INCLUDEPATH=y; \
|
||||
$(MAKE) -C $$dir; \
|
||||
done
|
||||
@cp link.mk build/Makefile
|
||||
@$(MAKE) -C build COMPILE_TYPE="_app" TARGET=XiZi-$(BOARD)_app.elf LINK_FLAGS=APPLFLAGS
|
||||
@$(MAKE) -C build COMPILE_TYPE="_app" TARGET=XiZi-$(BOARD)_app.elf LINK_FLAGS=APPLFLAGS USE_APP_INCLUDEPATH=y
|
||||
@rm build/Makefile build/make.obj
|
||||
|
||||
show_info:
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
|
||||
static struct HardwareDev *g_spi_lora_dev;
|
||||
static BusType buspin;
|
||||
tRadioDriver *Radio = NONE;
|
||||
static tRadioDriver *Radio = NONE;
|
||||
void SX1276InitIo(void)
|
||||
{
|
||||
struct PinParam PinCfg;
|
||||
|
||||
@@ -4,6 +4,12 @@ export LFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl
|
||||
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
ifeq ($(CONFIG_LIB_MUSLLIB), y)
|
||||
export LFLAGS += -nostdlib -nostdinc -fno-builtin -nodefaultlibs
|
||||
export LIBCC := -lgcc
|
||||
export LINK_MUSLLIB := $(KERNEL_ROOT)/lib/musllib/libmusl.a
|
||||
endif
|
||||
|
||||
export CXXFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -Werror
|
||||
|
||||
export CROSS_COMPILE ?=/opt/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.1-20190425-1021/bin/riscv-none-embed-
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
|
||||
static struct HardwareDev *g_spi_lora_dev;
|
||||
static BusType buspin;
|
||||
tRadioDriver *Radio = NONE;
|
||||
static tRadioDriver *Radio = NONE;
|
||||
void SX1276InitIo(void)
|
||||
{
|
||||
struct PinParam PinCfg;
|
||||
|
||||
@@ -77,7 +77,7 @@ static x_err_t ReadRegs(struct HardwareDev* dev, uint8 len, uint8* buf)
|
||||
// not used in polling mode
|
||||
static void touch_pin_irqhandler(void* arg)
|
||||
{
|
||||
KPrintf("int hdr working.\n");
|
||||
//KPrintf("int hdr working.\n");
|
||||
if (!SemReleaseFlag)
|
||||
{
|
||||
KSemaphoreAbandon(touch_sem);
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# XiZi_IIoT Project Configuration
|
||||
#
|
||||
CONFIG_BOARD_GD32VF103RVSTAR=y
|
||||
CONFIG_ARCH_RISCV=y
|
||||
|
||||
#
|
||||
# gd32vf103-rvstar feature
|
||||
#
|
||||
CONFIG_BSP_USING_GPIO=y
|
||||
CONFIG_PIN_BUS_NAME="pin"
|
||||
CONFIG_PIN_DRIVER_NAME="pin_drv"
|
||||
CONFIG_PIN_DEVICE_NAME="pin_dev"
|
||||
CONFIG_BSP_USING_SYSCLOCK=y
|
||||
CONFIG_BSP_USING_UART=y
|
||||
CONFIG_BSP_USING_UART4=y
|
||||
CONFIG_SERIAL_BUS_NAME_4="uart4"
|
||||
CONFIG_SERIAL_DRV_NAME_4="uart4_drv"
|
||||
CONFIG_SERIAL_4_DEVICE_NAME_4="uart4_dev4"
|
||||
|
||||
#
|
||||
# Hardware feature
|
||||
#
|
||||
CONFIG_RESOURCES_SERIAL=y
|
||||
CONFIG_SERIAL_USING_DMA=y
|
||||
CONFIG_SERIAL_RB_BUFSZ=64
|
||||
CONFIG_RESOURCES_PIN=y
|
||||
|
||||
#
|
||||
# Kernel feature
|
||||
#
|
||||
|
||||
#
|
||||
# separate compile(choose none for compile once)
|
||||
#
|
||||
# CONFIG_SEPARATE_COMPILE is not set
|
||||
# CONFIG_COMPILER_APP is not set
|
||||
|
||||
# CONFIG_COMPILER_KERNEL is not set
|
||||
|
||||
#
|
||||
# Memory Management
|
||||
#
|
||||
# CONFIG_KERNEL_MEMBLOCK is not set
|
||||
CONFIG_MEM_ALIGN_SIZE=4
|
||||
# CONFIG_MEM_EXTERN_SRAM is not set
|
||||
CONFIG_MM_PAGE_SIZE=1024
|
||||
|
||||
#
|
||||
# Using small memory allocator
|
||||
#
|
||||
CONFIG_KERNEL_SMALL_MEM_ALLOC=y
|
||||
CONFIG_SMALL_NUMBER_32B=8
|
||||
CONFIG_SMALL_NUMBER_64B=4
|
||||
|
||||
#
|
||||
# Task feature
|
||||
#
|
||||
CONFIG_USER_APPLICATION=y
|
||||
# CONFIG_TASK_ISOLATION is not set
|
||||
|
||||
#
|
||||
# Inter-Task communication
|
||||
#
|
||||
# CONFIG_KERNEL_SEMAPHORE=y
|
||||
# CONFIG_KERNEL_MUTEX=y
|
||||
# CONFIG_KERNEL_EVENT is not set
|
||||
# CONFIG_KERNEL_MESSAGEQUEUE is not set
|
||||
# CONFIG_KERNEL_SOFTTIMER is not set
|
||||
CONFIG_SCHED_POLICY_RR_REMAINSLICE=y
|
||||
# CONFIG_SCHED_POLICY_RR is not set
|
||||
# CONFIG_SCHED_POLICY_FIFO is not set
|
||||
CONFIG_KTASK_PRIORITY_8=y
|
||||
CONFIG_KTASK_PRIORITY_MAX=8
|
||||
CONFIG_TICK_PER_SECOND=100
|
||||
CONFIG_KERNEL_STACK_OVERFLOW_CHECK=y
|
||||
CONFIG_IDLE_KTASK_STACKSIZE=512
|
||||
CONFIG_ZOMBIE_KTASK_STACKSIZE=512
|
||||
|
||||
#
|
||||
# Kernel Console
|
||||
#
|
||||
CONFIG_KERNEL_CONSOLE=y
|
||||
CONFIG_KERNEL_BANNER=y
|
||||
CONFIG_KERNEL_CONSOLEBUF_SIZE=128
|
||||
|
||||
#
|
||||
# Kernel Hook
|
||||
#
|
||||
# CONFIG_KERNEL_HOOK is not set
|
||||
|
||||
#
|
||||
# Command shell
|
||||
#
|
||||
CONFIG_TOOL_SHELL=y
|
||||
CONFIG_SHELL_TASK_PRIORITY=20
|
||||
CONFIG_SHELL_TASK_STACK_SIZE=2048
|
||||
|
||||
|
||||
# CONFIG_SHELL_ENTER_CRLF is not set
|
||||
|
||||
#
|
||||
# Set shell user control
|
||||
#
|
||||
CONFIG_SHELL_DEFAULT_USER="letter"
|
||||
CONFIG_SHELL_DEFAULT_USER_PASSWORD=""
|
||||
CONFIG_SHELL_LOCK_TIMEOUT=10000
|
||||
# CONFIG_SHELL_ENTER_CR_AND_LF is not set
|
||||
# CONFIG_SHELL_ENTER_CR is not set
|
||||
# CONFIG_SHELL_ENTER_LF is not set
|
||||
|
||||
#
|
||||
# Set shell config param
|
||||
#
|
||||
CONFIG_SHELL_MAX_NUMBER=5
|
||||
CONFIG_SHELL_PARAMETER_MAX_NUMBER=8
|
||||
CONFIG_SHELL_HISTORY_MAX_NUMBER=5
|
||||
CONFIG_SHELL_PRINT_BUFFER=128
|
||||
CONFIG_SHELL_HELP_SHOW_PERMISSION=y
|
||||
# CONFIG_SHELL_HELP_LIST_USER is not set
|
||||
CONFIG_SHELL_HELP_LIST_VAR=y
|
||||
# CONFIG_SHELL_HELP_LIST_KEY is not set
|
||||
|
||||
#
|
||||
# Kernel data structure Manage
|
||||
#
|
||||
CONFIG_KERNEL_QUEUEMANAGE=y
|
||||
# CONFIG_KERNEL_WORKQUEUE is not set
|
||||
CONFIG_WORKQUEUE_KTASK_STACKSIZE=256
|
||||
CONFIG_WORKQUEUE_KTASK_PRIORITY=23
|
||||
CONFIG_QUEUE_MAX=2
|
||||
# CONFIG_KERNEL_WAITQUEUE is not set
|
||||
# CONFIG_KERNEL_DATAQUEUE is not set
|
||||
# CONFIG_KERNEL_CIRCULAR_AREA is not set
|
||||
# CONFIG_KERNEL_AVL_TREE is not set
|
||||
|
||||
#
|
||||
# Kernel components init
|
||||
#
|
||||
CONFIG_KERNEL_COMPONENTS_INIT=y
|
||||
CONFIG_ENV_INIT_KTASK_STACK_SIZE=1024
|
||||
CONFIG_KERNEL_USER_MAIN=y
|
||||
CONFIG_NAME_NUM_MAX=32
|
||||
# CONFIG_KERNEL_DEBUG is not set
|
||||
# CONFIG_ARCH_SMP is not set
|
||||
|
||||
#
|
||||
# hash table config
|
||||
#
|
||||
CONFIG_ID_HTABLE_SIZE=1
|
||||
CONFIG_ID_NUM_MAX=4
|
||||
# CONFIG_KERNEL_TEST is not set
|
||||
|
||||
#
|
||||
# Kernel Lib
|
||||
#
|
||||
CONFIG_LIB=y
|
||||
CONFIG_LIB_POSIX=y
|
||||
CONFIG_LIB_NEWLIB=y
|
||||
# CONFIG_LIB_MUSLLIB is not set
|
||||
# CONFIG_LIB_OTHER is not set
|
||||
|
||||
#
|
||||
# C++ features
|
||||
#
|
||||
# CONFIG_LIB_CPLUSPLUS is not set
|
||||
|
||||
#
|
||||
# File system
|
||||
#
|
||||
CONFIG_FS_VFS=n
|
||||
# CONFIG_FS_CH376 is not set
|
||||
# CONFIG_FS_LWEXT4 is not set
|
||||
|
||||
#
|
||||
# APP_Framework
|
||||
#
|
||||
|
||||
#
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
CONFIG_ADD_XIZI_FETURES=y
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FETURES is not set
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONTROL_FRAMEWORK is not set
|
||||
|
||||
#
|
||||
# Security
|
||||
#
|
||||
# CONFIG_CRYPTO is not set
|
||||
# CONFIG_MBEDTLS is not set
|
||||
|
||||
#
|
||||
# Applications
|
||||
#
|
||||
|
||||
#
|
||||
# config stack size and priority of main task
|
||||
#
|
||||
CONFIG_MAIN_KTASK_STACK_SIZE=1024
|
||||
CONFIG_MAIN_KTASK_PRIORITY=16
|
||||
|
||||
#
|
||||
# ota app
|
||||
#
|
||||
# CONFIG_APPLICATION_OTA is not set
|
||||
|
||||
#
|
||||
# test app
|
||||
#
|
||||
# CONFIG_USER_TEST is not set
|
||||
|
||||
#
|
||||
# connection app
|
||||
#
|
||||
# CONFIG_APPLICATION_CONNECTION is not set
|
||||
|
||||
#
|
||||
# control app
|
||||
#
|
||||
|
||||
#
|
||||
# knowing app
|
||||
#
|
||||
# CONFIG_APPLICATION_KNOWING is not set
|
||||
|
||||
#
|
||||
# sensor app
|
||||
#
|
||||
# CONFIG_APPLICATION_SENSOR is not set
|
||||
# CONFIG_USING_EMBEDDED_DATABASE_APP is not set
|
||||
# CONFIG_APP_USING_WEBNET is not set
|
||||
|
||||
#
|
||||
# app lib
|
||||
#
|
||||
CONFIG_APP_SELECT_NEWLIB=y
|
||||
# CONFIG_APP_SELECT_OTHER_LIB is not set
|
||||
# CONFIG_LIB_USING_CJSON is not set
|
||||
# CONFIG_LIB_USING_QUEUE is not set
|
||||
# CONFIG_LIB_LV is not set
|
||||
|
||||
#
|
||||
# LVGL configuration
|
||||
#
|
||||
# CONFIG_LV_CONF_MINIMAL is not set
|
||||
# CONFIG_USING_EMBEDDED_DATABASE is not set
|
||||
@@ -418,13 +418,7 @@ static struct pbuf *low_level_input(struct netif *netif)
|
||||
rxBuffer = (uint8_t *)(EthHandle.stcRxFrame).u32Buf;
|
||||
if (len > 0UL) {
|
||||
/* Allocate a pbuf chain of pbufs from the buffer */
|
||||
p = (struct pbuf *)malloc(sizeof(struct pbuf) + len);
|
||||
if (NULL != p) {
|
||||
p->next = NULL;
|
||||
p->payload = &((uint8_t *)p)[sizeof(struct pbuf)];
|
||||
p->len = len;
|
||||
(void)memset(p->payload, 0, p->len);
|
||||
}
|
||||
p = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM);
|
||||
}
|
||||
if (p != NULL) {
|
||||
DmaRxDesc = (EthHandle.stcRxFrame).pstcFSDesc;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#define LORA_RST_PIN (GPIO_PIN_02)
|
||||
|
||||
static struct HardwareDev *g_spi_lora_dev;
|
||||
tRadioDriver *Radio = NONE;
|
||||
static tRadioDriver *Radio = NONE;
|
||||
|
||||
void SX1276InitIo(void)
|
||||
{
|
||||
|
||||
@@ -139,8 +139,8 @@ CONFIG_SHELL_USING_CMD_EXPORT=y
|
||||
CONFIG_SHELL_HELP_SHOW_PERMISSION=y
|
||||
# CONFIG_SHELL_HELP_LIST_VAR is not set
|
||||
# CONFIG_SHELL_HELP_LIST_KEY is not set
|
||||
#CONFIG_KERNEL_QUEUEMANAGE=y
|
||||
# CONFIG_KERNEL_WORKQUEUE is not set
|
||||
CONFIG_KERNEL_QUEUEMANAGE=y
|
||||
CONFIG_KERNEL_WORKQUEUE=y
|
||||
CONFIG_WORKQUEUE_KTASK_STACKSIZE=256
|
||||
CONFIG_WORKQUEUE_KTASK_PRIORITY=2
|
||||
CONFIG_QUEUE_MAX=2
|
||||
|
||||
@@ -225,7 +225,7 @@ CONFIG_FS_VFS_DEVFS=y
|
||||
CONFIG_LIB=y
|
||||
CONFIG_LIB_POSIX=y
|
||||
CONFIG_LIB_NEWLIB=y
|
||||
CONFIG_LIB_MUSLLIB=y
|
||||
# CONFIG_LIB_MUSLLIB is not set
|
||||
|
||||
CONFIG_LITTLEVGL2RTT_USING_DEMO=y
|
||||
|
||||
|
||||
@@ -4,6 +4,13 @@ export LFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl
|
||||
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
ifeq ($(CONFIG_LIB_MUSLLIB), y)
|
||||
export LFLAGS += -nostdlib -nostdinc -fno-builtin -nodefaultlibs
|
||||
export LIBCC := -lgcc
|
||||
export LINK_MUSLLIB := $(KERNEL_ROOT)/lib/musllib/libmusl.a
|
||||
endif
|
||||
|
||||
|
||||
export CXXFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -Werror
|
||||
|
||||
export CROSS_COMPILE ?=/opt/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.1-20190425-1021/bin/riscv-none-embed-
|
||||
|
||||
@@ -33,7 +33,7 @@ Modification:
|
||||
#include "fsl_clock.h"
|
||||
#include "fsl_enet.h"
|
||||
#include "clock_config.h"
|
||||
#include <xizi.h>
|
||||
// #include <xizi.h>
|
||||
#include <arch_interrupt.h>
|
||||
|
||||
#ifdef BSP_USING_LWIP
|
||||
|
||||
+1
-1
@@ -205,7 +205,7 @@ static int32_t GtpGetInfo(void)
|
||||
// not used in polling mode
|
||||
static void GT9xx_PEN_IRQHandler(void* arg)
|
||||
{
|
||||
KPrintf("int hdr working.\n");
|
||||
//KPrintf("int hdr working.\n");
|
||||
if (!SemReleaseFlag)
|
||||
{
|
||||
KSemaphoreAbandon(touch_sem);
|
||||
|
||||
@@ -126,6 +126,14 @@ x_err_t UserMsgQueueRecv(int32_t mq, void *buffer, size_t size,int32_t wait_tim
|
||||
x_err_t UserMsgQueueReinit(int32_t mq);
|
||||
#endif
|
||||
|
||||
#ifdef KERNEL_SOFTTIMER
|
||||
int32_t UserTimerCreate(const char *name, void (*timeout)(void *parameter), void *parameter, uint32_t time, uint8_t trigger_mode);
|
||||
x_err_t UserTimerDelete(int32_t timer_id);
|
||||
x_err_t UserTimerStartRun(int32_t timer_id);
|
||||
x_err_t UserTimerQuitRun(int32_t timer_id);
|
||||
x_err_t UserTimerModify(int32_t timer_id, uint32_t ticks);
|
||||
#endif
|
||||
|
||||
int open(const char *path, int flags, ...);
|
||||
int read(int fd, void *buf, size_t len);
|
||||
int write(int fd, const void *buf, size_t len);
|
||||
@@ -239,6 +247,14 @@ uint8_t UserGetTaskPriority(int32_t id);
|
||||
#define UserMsgQueueReinit KMsgQueueReinit
|
||||
#endif
|
||||
|
||||
#ifdef KERNEL_SOFTTIMER
|
||||
int32_t UserTimerCreate(const char *name, void (*timeout)(void *parameter), void *parameter, uint32_t time, uint8_t trigger_mode);
|
||||
x_err_t UserTimerDelete(int32_t timer_id);
|
||||
x_err_t UserTimerStartRun(int32_t timer_id);
|
||||
x_err_t UserTimerQuitRun(int32_t timer_id);
|
||||
x_err_t UserTimerModify(int32_t timer_id, uint32_t ticks);
|
||||
#endif
|
||||
|
||||
#define UserPrintf KPrintf
|
||||
|
||||
|
||||
|
||||
@@ -74,6 +74,12 @@ enum KernelServiceEnum
|
||||
KS_USER_MSGQUEUE_RECV,
|
||||
KS_USER_MSGQUEUE_REINIT,
|
||||
|
||||
KS_USER_TIMER_CREATE,
|
||||
KS_USER_TIMER_DELETE,
|
||||
KS_USER_TIMER_STARTRUN,
|
||||
KS_USER_TIMER_QUITRUN,
|
||||
KS_USER_TIMER_MODIFY,
|
||||
|
||||
KS_USER_OPEN,
|
||||
KS_USER_READ,
|
||||
KS_USER_WRITE,
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <xs_mutex.h>
|
||||
#include <xs_event.h>
|
||||
#include <xs_msg.h>
|
||||
#include <xs_timer.h>
|
||||
|
||||
#ifdef FS_VFS
|
||||
#include <iot-vfs_posix.h>
|
||||
@@ -401,6 +402,53 @@ uintptr_t KsMsgQueueReinit(uint32_t knum,uintptr_t *param, uint8_t num )
|
||||
return (uintptr_t)ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef KERNEL_SOFTTIMER
|
||||
static int32 timer_sem;
|
||||
static void KsTimerCallback(void *parameter)
|
||||
{
|
||||
KSemaphoreAbandon(timer_sem);
|
||||
}
|
||||
|
||||
uintptr_t KsTimerCreate(uint32_t knum, uintptr_t *param, uint8_t num)
|
||||
{
|
||||
int32 ret;
|
||||
|
||||
timer_sem = *((int *)param[2]);
|
||||
|
||||
ret = KCreateTimer((const char *)(param[0]), KsTimerCallback, (void *)(param[2]), (x_ticks_t)(param[3]), (uint8)(param[4]));
|
||||
return (uintptr_t)ret;
|
||||
}
|
||||
|
||||
uintptr_t KsTimerDelete(uint32_t knum, uintptr_t *param, uint8_t num)
|
||||
{
|
||||
x_err_t ret;
|
||||
ret = KDeleteTimer((int32)(param[0]));
|
||||
return (uintptr_t)ret;
|
||||
}
|
||||
|
||||
uintptr_t KsTimerStartRun(uint32_t knum, uintptr_t *param, uint8_t num)
|
||||
{
|
||||
x_err_t ret;
|
||||
ret = KTimerStartRun((int32)(param[0]));
|
||||
return (uintptr_t)ret;
|
||||
}
|
||||
|
||||
uintptr_t KsTimerQuitRun(uint32_t knum, uintptr_t *param, uint8_t num)
|
||||
{
|
||||
x_err_t ret;
|
||||
ret = KTimerQuitRun((int32)(param[0]));
|
||||
return (uintptr_t)ret;
|
||||
}
|
||||
|
||||
uintptr_t KsTimerModify(uint32_t knum, uintptr_t *param, uint8_t num)
|
||||
{
|
||||
x_err_t ret;
|
||||
ret = KTimerModify((int32)(param[0]), (x_ticks_t)(param[1]));
|
||||
return (uintptr_t)ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* fs posix*/
|
||||
|
||||
#ifdef FS_VFS
|
||||
@@ -566,87 +614,95 @@ uintptr_t KsStatfs(uint32_t knum,uintptr_t *param, uint8_t num )
|
||||
|
||||
struct KernelService g_service_table[256] __attribute__ ((section (".g_service_table"))) =
|
||||
{
|
||||
[KS_USER_PRINT_INFO] = { KsPrintInfo, 1 },
|
||||
[KS_USER_PRINT_INFO] = { KsPrintInfo, 1 },
|
||||
|
||||
/*************** Task ************/
|
||||
[KS_USER_TASK_CREATE] = { KsTaskCreate, 5 },
|
||||
[KS_USER_TASK_STARTUP] = { KsStartupTask, 1 },
|
||||
[KS_USER_TASK_DELETE] = { KsTaskDelete, 1 },
|
||||
[KS_USER_TASK_SEARCH] = { KsUserTaskSerach, 0 },
|
||||
[KS_USER_TASK_EXECEXIT] = { KsTaskQuit, 0 },
|
||||
[KS_USER_TASK_CORE_COMBINE] = { KsTaskCoreCombine, 2 },
|
||||
[KS_USER_TASK_CORE_UNCOMBINE] = { KsTaskCoreUnCombine, 1 },
|
||||
[KS_USER_TASK_DELAY] = { KsMdelayTask, 1 },
|
||||
[KS_USER_GET_TASK_NAME] = { KsGetTaskName, 2 },
|
||||
[KS_USER_GET_TASK_ID] = { KsGetTaskID, 0 },
|
||||
[KS_USER_GET_TASK_STAT] = { KsGetTaskStat, 1 },
|
||||
[KS_USER_GET_TASK_COMBINEED_CORE] = { KsGetTaskCombinedCore, 1 },
|
||||
[KS_USER_GET_TASK_RUNNING_CORE] = { KsGetTaskRunningCore, 1 },
|
||||
[KS_USER_GET_TASK_ERROR_STATUS] = { KsGetTaskErrorstatus, 1 },
|
||||
[KS_USER_GET_TASK_PRIORITY] = { KsGetTaskPriority, 1 },
|
||||
/*************** Task ************/
|
||||
[KS_USER_TASK_CREATE] = { KsTaskCreate, 5 },
|
||||
[KS_USER_TASK_STARTUP] = { KsStartupTask, 1 },
|
||||
[KS_USER_TASK_DELETE] = { KsTaskDelete, 1 },
|
||||
[KS_USER_TASK_SEARCH] = { KsUserTaskSerach, 0 },
|
||||
[KS_USER_TASK_EXECEXIT] = { KsTaskQuit, 0 },
|
||||
[KS_USER_TASK_CORE_COMBINE] = { KsTaskCoreCombine, 2 },
|
||||
[KS_USER_TASK_CORE_UNCOMBINE] = { KsTaskCoreUnCombine, 1 },
|
||||
[KS_USER_TASK_DELAY] = { KsMdelayTask, 1 },
|
||||
[KS_USER_GET_TASK_NAME] = { KsGetTaskName, 2 },
|
||||
[KS_USER_GET_TASK_ID] = { KsGetTaskID, 0 },
|
||||
[KS_USER_GET_TASK_STAT] = { KsGetTaskStat, 1 },
|
||||
[KS_USER_GET_TASK_COMBINEED_CORE] = { KsGetTaskCombinedCore, 1 },
|
||||
[KS_USER_GET_TASK_RUNNING_CORE] = { KsGetTaskRunningCore, 1 },
|
||||
[KS_USER_GET_TASK_ERROR_STATUS] = { KsGetTaskErrorstatus, 1 },
|
||||
[KS_USER_GET_TASK_PRIORITY] = { KsGetTaskPriority, 1 },
|
||||
|
||||
/*************** Memory ************/
|
||||
[KS_USER_MALLOC] = { KsMalloc, 1 },
|
||||
[KS_USER_FREE] = { KsFree, 1 },
|
||||
/*************** Memory ************/
|
||||
[KS_USER_MALLOC] = { KsMalloc, 1 },
|
||||
[KS_USER_FREE] = { KsFree, 1 },
|
||||
#ifdef KERNEL_MUTEX
|
||||
/*************** Mutex ************/
|
||||
[KS_USER_MUTEX_CREATE] = { KsCreateMutex, 0 },
|
||||
[KS_USER_MUTEX_DELETE] = { KsDeleteMutex, 1 },
|
||||
[KS_USER_MUTEX_OBTAIN] = { KsMutexObtain, 2 },
|
||||
[KS_USER_MUTEX_ABANDON] = { KsMutexAbandon, 1 },
|
||||
/*************** Mutex ************/
|
||||
[KS_USER_MUTEX_CREATE] = { KsCreateMutex, 0 },
|
||||
[KS_USER_MUTEX_DELETE] = { KsDeleteMutex, 1 },
|
||||
[KS_USER_MUTEX_OBTAIN] = { KsMutexObtain, 2 },
|
||||
[KS_USER_MUTEX_ABANDON] = { KsMutexAbandon, 1 },
|
||||
#endif
|
||||
#ifdef KERNEL_SEMAPHORE
|
||||
/*************** Semaphore ************/
|
||||
[KS_USER_SEMAPHORE_CREATE] = { KsCreateSemaphore, 1 },
|
||||
[KS_USER_SEMAPHORE_DELETE] = { KsDeleteSemaphore, 1 },
|
||||
[KS_USER_SEMAPHORE_OBTAIN] = { KsSemaphoreObtain, 2 },
|
||||
[KS_USER_SEMAPHORE_ABANDON] = { KsSemaphoreAbandon, 1 },
|
||||
[KS_USER_SEMAPHORE_SETVALUE] = { KsSemaphoreSetValue, 2 },
|
||||
/*************** Semaphore ************/
|
||||
[KS_USER_SEMAPHORE_CREATE] = { KsCreateSemaphore, 1 },
|
||||
[KS_USER_SEMAPHORE_DELETE] = { KsDeleteSemaphore, 1 },
|
||||
[KS_USER_SEMAPHORE_OBTAIN] = { KsSemaphoreObtain, 2 },
|
||||
[KS_USER_SEMAPHORE_ABANDON] = { KsSemaphoreAbandon, 1 },
|
||||
[KS_USER_SEMAPHORE_SETVALUE] = { KsSemaphoreSetValue, 2 },
|
||||
#endif
|
||||
/*************** Event ************/
|
||||
/*************** Event ************/
|
||||
#ifdef KERNEL_EVENT
|
||||
[KS_USER_EVENT_CREATE] = { KsCreateEvent, 1 },
|
||||
[KS_USER_EVENT_DELETE] = { KsDeleteEvent, 1 },
|
||||
[KS_USER_EVENT_TRIGGER] = { KsEventTrigger, 2 },
|
||||
[KS_USER_EVENT_PROCESS] = { KsEventProcess, 5 },
|
||||
[KS_USER_EVENT_CREATE] = { KsCreateEvent, 1 },
|
||||
[KS_USER_EVENT_DELETE] = { KsDeleteEvent, 1 },
|
||||
[KS_USER_EVENT_TRIGGER] = { KsEventTrigger, 2 },
|
||||
[KS_USER_EVENT_PROCESS] = { KsEventProcess, 5 },
|
||||
#endif
|
||||
#ifdef KERNEL_MESSAGEQUEUE
|
||||
/*************** Msg queue ************/
|
||||
[KS_USER_MSGQUEUE_CREATE] = { KsCreateMsgQueue, 2 },
|
||||
[KS_USER_MSGQUEUE_DELETE] = { KsDeleteMsgQueue, 1 },
|
||||
[KS_USER_MSGQUEUE_SENDWAIT] = { KsMsgQueueSendwait, 4 },
|
||||
[KS_USER_MSGQUEUE_SEND] = { KsMsgQueueSend, 3 },
|
||||
[KS_USER_MSGQUEUE_URGENTSEND] = { KsMsgQueueUrgentSend, 3 },
|
||||
[KS_USER_MSGQUEUE_RECV] = { KsMsgQueueRecv, 4 },
|
||||
[KS_USER_MSGQUEUE_REINIT] = { KsMsgQueueReinit, 1 },
|
||||
/*************** Msg queue ************/
|
||||
[KS_USER_MSGQUEUE_CREATE] = { KsCreateMsgQueue, 2 },
|
||||
[KS_USER_MSGQUEUE_DELETE] = { KsDeleteMsgQueue, 1 },
|
||||
[KS_USER_MSGQUEUE_SENDWAIT] = { KsMsgQueueSendwait, 4 },
|
||||
[KS_USER_MSGQUEUE_SEND] = { KsMsgQueueSend, 3 },
|
||||
[KS_USER_MSGQUEUE_URGENTSEND] = { KsMsgQueueUrgentSend, 3 },
|
||||
[KS_USER_MSGQUEUE_RECV] = { KsMsgQueueRecv, 4 },
|
||||
[KS_USER_MSGQUEUE_REINIT] = { KsMsgQueueReinit, 1 },
|
||||
#endif
|
||||
#ifdef KERNEL_SOFTTIMER
|
||||
/*************** Soft Timer ************/
|
||||
[KS_USER_TIMER_CREATE] = { KsTimerCreate, 5 },
|
||||
[KS_USER_TIMER_DELETE] = { KsTimerDelete, 1 },
|
||||
[KS_USER_TIMER_STARTRUN] = { KsTimerStartRun, 1 },
|
||||
[KS_USER_TIMER_QUITRUN] = { KsTimerQuitRun, 1 },
|
||||
[KS_USER_TIMER_MODIFY] = { KsTimerModify, 2 },
|
||||
#endif
|
||||
#ifdef FS_VFS
|
||||
/*************** fs poxix ************/
|
||||
[KS_USER_OPEN] = { KsOpen , 3 },
|
||||
[KS_USER_READ] = { KsRead , 3 },
|
||||
[KS_USER_WRITE] = { KsWrite , 3 },
|
||||
[KS_USER_CLOSE] = { KsClose , 1 },
|
||||
[KS_USER_IOCTL] = { KsIoctl , 3 },
|
||||
[KS_USER_LSEEK] = { KsLseek , 3 },
|
||||
[KS_USER_RENAME] = { KsRename , 2 },
|
||||
[KS_USER_UNLINK] = { KsUnlink , 1 },
|
||||
[KS_USER_STAT] = { KsStat , 2 },
|
||||
[KS_USER_FS_STAT] = { KsFstat , 2 },
|
||||
[KS_USER_FS_SYNC] = { KsFsync , 1 },
|
||||
[KS_USER_FTRUNCATE] = { KsFtruncate , 2 },
|
||||
[KS_USER_MKDIR] = { KsMkdir , 2 },
|
||||
[KS_USER_OPENDIR] = { KsOpendir , 1 },
|
||||
[KS_USER_CLOSEDIR] = { KsClosedir , 1 },
|
||||
[KS_USER_READDIR] = { KsReaddir , 1 },
|
||||
[KS_USER_RMDIR] = { KsRmdir , 1 },
|
||||
[KS_USER_CHDIR] = { KsChdir , 1 },
|
||||
[KS_USER_GETCWD] = { KsGetcwd, 2 },
|
||||
[KS_USER_TELLDIR] = { KsTelldir, 1 },
|
||||
[KS_USER_SEEKDIR] = { KsSeekdir, 2 },
|
||||
[KS_USER_REWIND_DIR] = { KsRewinddir, 1 },
|
||||
[KS_USER_STAT_FS] = { KsStatfs, 2 },
|
||||
/*************** fs poxix ************/
|
||||
[KS_USER_OPEN] = { KsOpen , 3 },
|
||||
[KS_USER_READ] = { KsRead , 3 },
|
||||
[KS_USER_WRITE] = { KsWrite , 3 },
|
||||
[KS_USER_CLOSE] = { KsClose , 1 },
|
||||
[KS_USER_IOCTL] = { KsIoctl , 3 },
|
||||
[KS_USER_LSEEK] = { KsLseek , 3 },
|
||||
[KS_USER_RENAME] = { KsRename , 2 },
|
||||
[KS_USER_UNLINK] = { KsUnlink , 1 },
|
||||
[KS_USER_STAT] = { KsStat , 2 },
|
||||
[KS_USER_FS_STAT] = { KsFstat , 2 },
|
||||
[KS_USER_FS_SYNC] = { KsFsync , 1 },
|
||||
[KS_USER_FTRUNCATE] = { KsFtruncate , 2 },
|
||||
[KS_USER_MKDIR] = { KsMkdir , 2 },
|
||||
[KS_USER_OPENDIR] = { KsOpendir , 1 },
|
||||
[KS_USER_CLOSEDIR] = { KsClosedir , 1 },
|
||||
[KS_USER_READDIR] = { KsReaddir , 1 },
|
||||
[KS_USER_RMDIR] = { KsRmdir , 1 },
|
||||
[KS_USER_CHDIR] = { KsChdir , 1 },
|
||||
[KS_USER_GETCWD] = { KsGetcwd, 2 },
|
||||
[KS_USER_TELLDIR] = { KsTelldir, 1 },
|
||||
[KS_USER_SEEKDIR] = { KsSeekdir, 2 },
|
||||
[KS_USER_REWIND_DIR] = { KsRewinddir, 1 },
|
||||
[KS_USER_STAT_FS] = { KsStatfs, 2 },
|
||||
#endif
|
||||
[KS_USER_END ... 255] = {NONE, 0}
|
||||
[KS_USER_END ... 255] = {NONE, 0}
|
||||
|
||||
};
|
||||
#else
|
||||
@@ -718,6 +774,53 @@ uint8_t UserGetTaskPriority(int32_t id)
|
||||
return (uintptr_t)task->task_dync_sched_member.cur_prio;
|
||||
}
|
||||
|
||||
#ifdef KERNEL_SOFTTIMER
|
||||
static int32 timer_sem;
|
||||
static void UserTimerCallback(void *parameter)
|
||||
{
|
||||
KSemaphoreAbandon(timer_sem);
|
||||
}
|
||||
|
||||
int32 UserTimerCreate(const char *name, void (*timeout)(void *parameter), void *parameter, uint32_t time, uint8_t trigger_mode)
|
||||
{
|
||||
int32 ret;
|
||||
|
||||
timer_sem = *((int *)parameter);
|
||||
|
||||
ret = KCreateTimer(name, UserTimerCallback, NONE, time, trigger_mode);
|
||||
return ret;
|
||||
}
|
||||
|
||||
x_err_t UserTimerDelete(int32_t timer_id)
|
||||
{
|
||||
x_err_t ret;
|
||||
ret = KDeleteTimer(timer_id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
x_err_t UserTimerStartRun(int32_t timer_id)
|
||||
{
|
||||
x_err_t ret;
|
||||
ret = KTimerStartRun(timer_id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
x_err_t UserTimerQuitRun(int32_t timer_id)
|
||||
{
|
||||
x_err_t ret;
|
||||
ret = KTimerQuitRun(timer_id);
|
||||
return ret;
|
||||
}
|
||||
|
||||
x_err_t UserTimerModify(int32_t timer_id, uint32_t ticks)
|
||||
{
|
||||
x_err_t ret;
|
||||
|
||||
ret = KTimerModify(timer_id, ticks);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
long occupy_g_service_table __attribute__ ((section (".g_service_table"))) = 0;
|
||||
|
||||
#endif
|
||||
@@ -288,7 +288,7 @@ int32 KEventTrigger(int32 id, uint32 events)
|
||||
* @param events events flag
|
||||
* @param options trigger way
|
||||
* @param msec timeout
|
||||
* @processed event processed flag
|
||||
* @param processed event processed flag
|
||||
*
|
||||
* @return EOK on success.
|
||||
*/
|
||||
|
||||
@@ -147,7 +147,7 @@ static struct TimerDone Done =
|
||||
/**
|
||||
* This function will create a softtimer.
|
||||
*
|
||||
* @param name the length of the msg queue.
|
||||
* @param name the name of the timer.
|
||||
* @param timeout the callback of the timer.
|
||||
* @param parameter the parameter of the callback function
|
||||
* @param time the timeout time
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
menu "Lib"
|
||||
menu "Kernel Lib"
|
||||
|
||||
menuconfig LIB
|
||||
bool "Enable libc APIs from toolchain"
|
||||
@@ -19,6 +19,10 @@ menuconfig LIB
|
||||
|
||||
config LIB_MUSLLIB
|
||||
bool "use musllib as libc realization."
|
||||
|
||||
config LIB_OTHER
|
||||
bool "use other lib"
|
||||
|
||||
endchoice
|
||||
|
||||
source "$KERNEL_DIR/lib/libcpp/Kconfig"
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
export APPPATHS :=-I$(BSP_ROOT) \
|
||||
|
||||
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Applications/general_functions/list \
|
||||
-I$(KERNEL_ROOT)/../../APP_Framework/lib/app_newlib/include \
|
||||
-I$(KERNEL_ROOT)/../../APP_Framework/Framework/sensor #
|
||||
-I$(KERNEL_ROOT)/../../APP_Framework/Framework/sensor #
|
||||
|
||||
ifeq ($(CONFIG_APP_SELECT_NEWLIB), y)
|
||||
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/app_newlib/include #
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_ADD_XIZI_FETURES), y)
|
||||
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xizi \
|
||||
|
||||
@@ -512,11 +512,29 @@ KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc_protoc
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc_protocol/s7 #
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_LIB_USING_CJSON), y)
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/cJSON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIB_USING_LORAWAN), y)
|
||||
ifeq ($(CONFIG_LIB_USING_LORA_RADIO), y)
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lora_radio_driver/lora-radio/common #
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lora_radio_driver/lora-radio/include #
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lora_radio_driver/lora-radio/sx126x #
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lora_radio_driver/lora-radio/sx127x #
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lora_radio_driver/ports/lora-module/inc #
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lora_radio_driver/ports/samples/lora-radio-tester #
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIB_USING_LORAWAN_ED_STACK), y)
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Aps/Basic #
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Common #
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Mac #
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Mac/Crypto #
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_devicenode/lorawan-ed-stack/Phy/region #
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CRYPTO), y)
|
||||
KERNELPATHS += -I$(KERNEL_ROOT)/framework/security/crypto/include #
|
||||
endif
|
||||
@@ -545,17 +563,14 @@ endif
|
||||
|
||||
|
||||
ifeq ($(ARCH), risc-v)
|
||||
# KERNELPATHS +=-I$(KERNEL_ROOT)/arch/risc-v/shared
|
||||
ifeq ($(MCU), k210)
|
||||
KERNELPATHS +=-I$(KERNEL_ROOT)/arch/risc-v/shared
|
||||
ifeq ($(MCU), k210)
|
||||
KERNELPATHS +=-I$(KERNEL_ROOT)/arch/risc-v/k210
|
||||
endif
|
||||
ifeq ($(MCU), FE310)
|
||||
KERNELPATHS +=-I$(KERNEL_ROOT)/arch/risc-v/shared
|
||||
KERNELPATHS +=-I$(KERNEL_ROOT)/arch/risc-v/fe310
|
||||
endif
|
||||
ifeq ($(MCU), GAP8)
|
||||
KERNELPATHS +=-I$(KERNEL_ROOT)/arch/risc-v/shared
|
||||
KERNELPATHS +=-I$(KERNEL_ROOT)/arch/risc-v/gap8
|
||||
endif
|
||||
ifeq ($(MCU), GD32VF103)
|
||||
|
||||
Reference in New Issue
Block a user