forked from xuos/xiuos
add imxrt1052 board mdelay function
This commit is contained in:
parent
f8b845ca62
commit
c621db2ca7
|
@ -58,7 +58,7 @@ __isr_vector:
|
||||||
.long IsrEntry /* Debug Monitor Handler*/
|
.long IsrEntry /* Debug Monitor Handler*/
|
||||||
.long 0 /* Reserved*/
|
.long 0 /* Reserved*/
|
||||||
.long PendSV_Handler /* PendSV Handler*/
|
.long PendSV_Handler /* PendSV Handler*/
|
||||||
.long IsrEntry /* SysTick Handler*/
|
.long SysTick_Handler /* SysTick Handler*/
|
||||||
|
|
||||||
/* External Interrupts*/
|
/* External Interrupts*/
|
||||||
.long IsrEntry /* DMA channel 0/16 transfer complete*/
|
.long IsrEntry /* DMA channel 0/16 transfer complete*/
|
||||||
|
|
|
@ -0,0 +1,294 @@
|
||||||
|
#
|
||||||
|
# Automatically generated file; DO NOT EDIT.
|
||||||
|
# XiZi_IIoT Project Configuration
|
||||||
|
#
|
||||||
|
CONFIG_BOARD_CORTEX_M7_EVB=y
|
||||||
|
CONFIG_ARCH_ARM=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# ok1052-c feature
|
||||||
|
#
|
||||||
|
CONFIG_BSP_USING_LPUART=y
|
||||||
|
CONFIG_BSP_USING_LPUART1=y
|
||||||
|
CONFIG_SERIAL_BUS_NAME_1="uart1"
|
||||||
|
CONFIG_SERIAL_DRV_NAME_1="uart1_drv"
|
||||||
|
CONFIG_SERIAL_1_DEVICE_NAME_0="uart1_dev1"
|
||||||
|
CONFIG_BSP_USING_LPUART2=y
|
||||||
|
CONFIG_SERIAL_BUS_NAME_2="uart2"
|
||||||
|
CONFIG_SERIAL_DRV_NAME_2="uart2_drv"
|
||||||
|
CONFIG_SERIAL_2_DEVICE_NAME_0="uart2_dev2"
|
||||||
|
CONFIG_BSP_USING_LPUART3=y
|
||||||
|
CONFIG_SERIAL_BUS_NAME_3="uart3"
|
||||||
|
CONFIG_SERIAL_DRV_NAME_3="uart3_drv"
|
||||||
|
CONFIG_SERIAL_3_DEVICE_NAME_0="uart3_dev3"
|
||||||
|
# CONFIG_BSP_USING_LPUART4 is not set
|
||||||
|
# CONFIG_BSP_USING_LPUART8 is not set
|
||||||
|
# CONFIG_BSP_USING_CH438 is not set
|
||||||
|
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_I2C is not set
|
||||||
|
# CONFIG_BSP_USING_LWIP is not set
|
||||||
|
# CONFIG_BSP_USING_SEMC is not set
|
||||||
|
# CONFIG_BSP_USING_SDIO is not set
|
||||||
|
# CONFIG_BSP_USING_LCD is not set
|
||||||
|
# CONFIG_BSP_USING_TOUCH is not set
|
||||||
|
# CONFIG_BSP_USING_USB is not set
|
||||||
|
# CONFIG_BSP_USING_WDT is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# config default board resources
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# config board app name
|
||||||
|
#
|
||||||
|
CONFIG_BOARD_APP_NAME="/XiUOS_xidatong_app.bin"
|
||||||
|
|
||||||
|
#
|
||||||
|
# config board service table
|
||||||
|
#
|
||||||
|
CONFIG_SERVICE_TABLE_ADDRESS=0x2007F0000
|
||||||
|
CONFIG___STACKSIZE__=4096
|
||||||
|
|
||||||
|
#
|
||||||
|
# config board peripheral
|
||||||
|
#
|
||||||
|
# CONFIG_MOUNT_SDCARD is not set
|
||||||
|
# CONFIG_MOUNT_USB is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Hardware feature
|
||||||
|
#
|
||||||
|
CONFIG_RESOURCES_SERIAL=y
|
||||||
|
CONFIG_SERIAL_USING_DMA=y
|
||||||
|
CONFIG_SERIAL_RB_BUFSZ=128
|
||||||
|
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_APP_STARTUP_FROM_SDCARD is not set
|
||||||
|
CONFIG_APP_STARTUP_FROM_FLASH=y
|
||||||
|
# CONFIG_COMPILER_KERNEL is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Memory Management
|
||||||
|
#
|
||||||
|
# CONFIG_KERNEL_MEMBLOCK is not set
|
||||||
|
CONFIG_MEM_ALIGN_SIZE=8
|
||||||
|
# CONFIG_MEM_EXTERN_SRAM is not set
|
||||||
|
CONFIG_MM_PAGE_SIZE=4096
|
||||||
|
|
||||||
|
#
|
||||||
|
# Using small memory allocator
|
||||||
|
#
|
||||||
|
CONFIG_KERNEL_SMALL_MEM_ALLOC=y
|
||||||
|
CONFIG_SMALL_NUMBER_32B=64
|
||||||
|
CONFIG_SMALL_NUMBER_64B=32
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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=y
|
||||||
|
CONFIG_KERNEL_MESSAGEQUEUE=y
|
||||||
|
CONFIG_KERNEL_SOFTTIMER=y
|
||||||
|
CONFIG_SCHED_POLICY_RR_REMAINSLICE=y
|
||||||
|
# CONFIG_SCHED_POLICY_RR is not set
|
||||||
|
# CONFIG_SCHED_POLICY_FIFO is not set
|
||||||
|
# CONFIG_KTASK_PRIORITY_8 is not set
|
||||||
|
CONFIG_KTASK_PRIORITY_32=y
|
||||||
|
# CONFIG_KTASK_PRIORITY_256 is not set
|
||||||
|
CONFIG_KTASK_PRIORITY_MAX=32
|
||||||
|
CONFIG_TICK_PER_SECOND=1000
|
||||||
|
CONFIG_KERNEL_STACK_OVERFLOW_CHECK=y
|
||||||
|
CONFIG_IDLE_KTASK_STACKSIZE=1024
|
||||||
|
CONFIG_ZOMBIE_KTASK_STACKSIZE=2048
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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_ENTER_CR=y
|
||||||
|
CONFIG_SHELL_ENTER_LF=y
|
||||||
|
CONFIG_SHELL_ENTER_CR_AND_LF=y
|
||||||
|
# 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
|
||||||
|
|
||||||
|
#
|
||||||
|
# Set shell config param
|
||||||
|
#
|
||||||
|
CONFIG_SHELL_TASK_STACK_SIZE=4096
|
||||||
|
CONFIG_SHELL_TASK_PRIORITY=20
|
||||||
|
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=y
|
||||||
|
CONFIG_WORKQUEUE_KTASK_STACKSIZE=2048
|
||||||
|
CONFIG_WORKQUEUE_KTASK_PRIORITY=23
|
||||||
|
CONFIG_QUEUE_MAX=16
|
||||||
|
CONFIG_KERNEL_WAITQUEUE=y
|
||||||
|
CONFIG_KERNEL_DATAQUEUE=y
|
||||||
|
# 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=8192
|
||||||
|
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=16
|
||||||
|
CONFIG_ID_NUM_MAX=128
|
||||||
|
# CONFIG_KERNEL_TEST is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Lib
|
||||||
|
#
|
||||||
|
CONFIG_LIB=y
|
||||||
|
CONFIG_LIB_POSIX=y
|
||||||
|
CONFIG_LIB_NEWLIB=y
|
||||||
|
# CONFIG_LIB_MUSLLIB is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# C++ features
|
||||||
|
#
|
||||||
|
# CONFIG_LIB_CPLUSPLUS is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# File system
|
||||||
|
#
|
||||||
|
CONFIG_FS_VFS=y
|
||||||
|
CONFIG_VFS_USING_WORKDIR=y
|
||||||
|
CONFIG_FS_VFS_DEVFS=y
|
||||||
|
CONFIG_FS_VFS_FATFS=y
|
||||||
|
# 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=4096
|
||||||
|
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
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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
|
|
@ -364,6 +364,32 @@ status_t BOARD_Camera_I2C_ReceiveSCCB(
|
||||||
#endif /* SDK_I2C_BASED_COMPONENT_USED */
|
#endif /* SDK_I2C_BASED_COMPONENT_USED */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void ImxrtMsDelay(uint32 ms)
|
||||||
|
{
|
||||||
|
uint64 ticks = 0;
|
||||||
|
uint32 told, tnow, tcnt = 0;
|
||||||
|
uint32 reload = SysTick->LOAD;
|
||||||
|
|
||||||
|
ticks = ((uint64)ms * ((uint64)reload + 1) * TICK_PER_SECOND) / 1000;
|
||||||
|
told = SysTick->VAL;
|
||||||
|
|
||||||
|
//KPrintf("%s reload %u ms %u ticks %u told %u\n", __func__, reload, ms, ticks, told);
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
tnow = SysTick->VAL;
|
||||||
|
if (tnow != told) {
|
||||||
|
if (tnow < told) {
|
||||||
|
tcnt += told - tnow;
|
||||||
|
} else {
|
||||||
|
tcnt += reload - tnow + told;
|
||||||
|
}
|
||||||
|
told = tnow;
|
||||||
|
if (tcnt >= ticks) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BOARD_SD_Pin_Config(uint32_t speed, uint32_t strength)
|
void BOARD_SD_Pin_Config(uint32_t speed, uint32_t strength)
|
||||||
{
|
{
|
||||||
|
@ -574,7 +600,6 @@ void SysTick_Handler(int irqn, void *arg)
|
||||||
{
|
{
|
||||||
TickAndTaskTimesliceUpdate();
|
TickAndTaskTimesliceUpdate();
|
||||||
}
|
}
|
||||||
DECLARE_HW_IRQ(SYSTICK_IRQN, SysTick_Handler, NONE);
|
|
||||||
|
|
||||||
#ifdef BSP_USING_LPUART
|
#ifdef BSP_USING_LPUART
|
||||||
void imxrt_uart_pins_init(void)
|
void imxrt_uart_pins_init(void)
|
||||||
|
|
|
@ -81,14 +81,11 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Code
|
* Code
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
extern void ImxrtMsDelay(uint32 ms);
|
||||||
|
|
||||||
void enet_delay(void)
|
void enet_delay(uint32 ms)
|
||||||
{
|
{
|
||||||
volatile uint32_t i = 0;
|
ImxrtMsDelay(ms);
|
||||||
for (i = 0; i < 1000000; ++i)
|
|
||||||
{
|
|
||||||
__asm("NOP"); /* delay */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Time_Update_LwIP(void)
|
void Time_Update_LwIP(void)
|
||||||
|
@ -124,7 +121,7 @@ void ethernetif_gpio_init(void)
|
||||||
GPIO_PinInit(GPIO1, 3, &gpio_config);
|
GPIO_PinInit(GPIO1, 3, &gpio_config);
|
||||||
/* pull up the ENET_INT before RESET. */
|
/* pull up the ENET_INT before RESET. */
|
||||||
GPIO_WritePinOutput(GPIO1, 3, 0);
|
GPIO_WritePinOutput(GPIO1, 3, 0);
|
||||||
enet_delay();
|
enet_delay(30);
|
||||||
GPIO_WritePinOutput(GPIO1, 3, 1);
|
GPIO_WritePinOutput(GPIO1, 3, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,294 @@
|
||||||
|
#
|
||||||
|
# Automatically generated file; DO NOT EDIT.
|
||||||
|
# XiZi_IIoT Project Configuration
|
||||||
|
#
|
||||||
|
CONFIG_BOARD_CORTEX_M7_EVB=y
|
||||||
|
CONFIG_ARCH_ARM=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# xidatong-arm32 feature
|
||||||
|
#
|
||||||
|
CONFIG_BSP_USING_LPUART=y
|
||||||
|
CONFIG_BSP_USING_LPUART1=y
|
||||||
|
CONFIG_SERIAL_BUS_NAME_1="uart1"
|
||||||
|
CONFIG_SERIAL_DRV_NAME_1="uart1_drv"
|
||||||
|
CONFIG_SERIAL_1_DEVICE_NAME_0="uart1_dev1"
|
||||||
|
CONFIG_BSP_USING_LPUART2=y
|
||||||
|
CONFIG_SERIAL_BUS_NAME_2="uart2"
|
||||||
|
CONFIG_SERIAL_DRV_NAME_2="uart2_drv"
|
||||||
|
CONFIG_SERIAL_2_DEVICE_NAME_0="uart2_dev2"
|
||||||
|
CONFIG_BSP_USING_LPUART3=y
|
||||||
|
CONFIG_SERIAL_BUS_NAME_3="uart3"
|
||||||
|
CONFIG_SERIAL_DRV_NAME_3="uart3_drv"
|
||||||
|
CONFIG_SERIAL_3_DEVICE_NAME_0="uart3_dev3"
|
||||||
|
# CONFIG_BSP_USING_LPUART4 is not set
|
||||||
|
# CONFIG_BSP_USING_LPUART8 is not set
|
||||||
|
# CONFIG_BSP_USING_CH438 is not set
|
||||||
|
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_I2C is not set
|
||||||
|
# CONFIG_BSP_USING_LWIP is not set
|
||||||
|
# CONFIG_BSP_USING_SEMC is not set
|
||||||
|
# CONFIG_BSP_USING_SDIO is not set
|
||||||
|
# CONFIG_BSP_USING_LCD is not set
|
||||||
|
# CONFIG_BSP_USING_TOUCH is not set
|
||||||
|
# CONFIG_BSP_USING_USB is not set
|
||||||
|
# CONFIG_BSP_USING_WDT is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# config default board resources
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# config board app name
|
||||||
|
#
|
||||||
|
CONFIG_BOARD_APP_NAME="/XiUOS_xidatong_app.bin"
|
||||||
|
|
||||||
|
#
|
||||||
|
# config board service table
|
||||||
|
#
|
||||||
|
CONFIG_SERVICE_TABLE_ADDRESS=0x2007F0000
|
||||||
|
CONFIG___STACKSIZE__=4096
|
||||||
|
|
||||||
|
#
|
||||||
|
# config board peripheral
|
||||||
|
#
|
||||||
|
# CONFIG_MOUNT_SDCARD is not set
|
||||||
|
# CONFIG_MOUNT_USB is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Hardware feature
|
||||||
|
#
|
||||||
|
CONFIG_RESOURCES_SERIAL=y
|
||||||
|
CONFIG_SERIAL_USING_DMA=y
|
||||||
|
CONFIG_SERIAL_RB_BUFSZ=128
|
||||||
|
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_APP_STARTUP_FROM_SDCARD is not set
|
||||||
|
CONFIG_APP_STARTUP_FROM_FLASH=y
|
||||||
|
# CONFIG_COMPILER_KERNEL is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Memory Management
|
||||||
|
#
|
||||||
|
# CONFIG_KERNEL_MEMBLOCK is not set
|
||||||
|
CONFIG_MEM_ALIGN_SIZE=8
|
||||||
|
# CONFIG_MEM_EXTERN_SRAM is not set
|
||||||
|
CONFIG_MM_PAGE_SIZE=4096
|
||||||
|
|
||||||
|
#
|
||||||
|
# Using small memory allocator
|
||||||
|
#
|
||||||
|
CONFIG_KERNEL_SMALL_MEM_ALLOC=y
|
||||||
|
CONFIG_SMALL_NUMBER_32B=64
|
||||||
|
CONFIG_SMALL_NUMBER_64B=32
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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=y
|
||||||
|
CONFIG_KERNEL_MESSAGEQUEUE=y
|
||||||
|
CONFIG_KERNEL_SOFTTIMER=y
|
||||||
|
CONFIG_SCHED_POLICY_RR_REMAINSLICE=y
|
||||||
|
# CONFIG_SCHED_POLICY_RR is not set
|
||||||
|
# CONFIG_SCHED_POLICY_FIFO is not set
|
||||||
|
# CONFIG_KTASK_PRIORITY_8 is not set
|
||||||
|
CONFIG_KTASK_PRIORITY_32=y
|
||||||
|
# CONFIG_KTASK_PRIORITY_256 is not set
|
||||||
|
CONFIG_KTASK_PRIORITY_MAX=32
|
||||||
|
CONFIG_TICK_PER_SECOND=1000
|
||||||
|
CONFIG_KERNEL_STACK_OVERFLOW_CHECK=y
|
||||||
|
CONFIG_IDLE_KTASK_STACKSIZE=1024
|
||||||
|
CONFIG_ZOMBIE_KTASK_STACKSIZE=2048
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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_ENTER_CR=y
|
||||||
|
CONFIG_SHELL_ENTER_LF=y
|
||||||
|
CONFIG_SHELL_ENTER_CR_AND_LF=y
|
||||||
|
# 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
|
||||||
|
|
||||||
|
#
|
||||||
|
# Set shell config param
|
||||||
|
#
|
||||||
|
CONFIG_SHELL_TASK_STACK_SIZE=4096
|
||||||
|
CONFIG_SHELL_TASK_PRIORITY=20
|
||||||
|
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=y
|
||||||
|
CONFIG_WORKQUEUE_KTASK_STACKSIZE=2048
|
||||||
|
CONFIG_WORKQUEUE_KTASK_PRIORITY=23
|
||||||
|
CONFIG_QUEUE_MAX=16
|
||||||
|
CONFIG_KERNEL_WAITQUEUE=y
|
||||||
|
CONFIG_KERNEL_DATAQUEUE=y
|
||||||
|
# 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=8192
|
||||||
|
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=16
|
||||||
|
CONFIG_ID_NUM_MAX=128
|
||||||
|
# CONFIG_KERNEL_TEST is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Lib
|
||||||
|
#
|
||||||
|
CONFIG_LIB=y
|
||||||
|
CONFIG_LIB_POSIX=y
|
||||||
|
CONFIG_LIB_NEWLIB=y
|
||||||
|
# CONFIG_LIB_MUSLLIB is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# C++ features
|
||||||
|
#
|
||||||
|
# CONFIG_LIB_CPLUSPLUS is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# File system
|
||||||
|
#
|
||||||
|
CONFIG_FS_VFS=y
|
||||||
|
CONFIG_VFS_USING_WORKDIR=y
|
||||||
|
CONFIG_FS_VFS_DEVFS=y
|
||||||
|
CONFIG_FS_VFS_FATFS=y
|
||||||
|
# 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=4096
|
||||||
|
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
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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
|
|
@ -83,6 +83,33 @@ extern int Imxrt1052HwLcdInit(void);
|
||||||
extern int HwTouchInit();
|
extern int HwTouchInit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void ImxrtMsDelay(uint32 ms)
|
||||||
|
{
|
||||||
|
uint64 ticks = 0;
|
||||||
|
uint32 told, tnow, tcnt = 0;
|
||||||
|
uint32 reload = SysTick->LOAD;
|
||||||
|
|
||||||
|
ticks = ((uint64)ms * ((uint64)reload + 1) * TICK_PER_SECOND) / 1000;
|
||||||
|
told = SysTick->VAL;
|
||||||
|
|
||||||
|
//KPrintf("%s reload %u ms %u ticks %u told %u\n", __func__, reload, ms, ticks, told);
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
tnow = SysTick->VAL;
|
||||||
|
if (tnow != told) {
|
||||||
|
if (tnow < told) {
|
||||||
|
tcnt += told - tnow;
|
||||||
|
} else {
|
||||||
|
tcnt += reload - tnow + told;
|
||||||
|
}
|
||||||
|
told = tnow;
|
||||||
|
if (tcnt >= ticks) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BOARD_SD_Pin_Config(uint32_t speed, uint32_t strength)
|
void BOARD_SD_Pin_Config(uint32_t speed, uint32_t strength)
|
||||||
{
|
{
|
||||||
IOMUXC_SetPinConfig(IOMUXC_GPIO_SD_B0_00_USDHC1_CMD,
|
IOMUXC_SetPinConfig(IOMUXC_GPIO_SD_B0_00_USDHC1_CMD,
|
||||||
|
@ -291,7 +318,6 @@ void SysTick_Handler(int irqn, void *arg)
|
||||||
{
|
{
|
||||||
TickAndTaskTimesliceUpdate();
|
TickAndTaskTimesliceUpdate();
|
||||||
}
|
}
|
||||||
DECLARE_HW_IRQ(SYSTICK_IRQN, SysTick_Handler, NONE);
|
|
||||||
|
|
||||||
struct InitSequenceDesc _board_init[] =
|
struct InitSequenceDesc _board_init[] =
|
||||||
{
|
{
|
||||||
|
|
|
@ -81,14 +81,11 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Code
|
* Code
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
extern void ImxrtMsDelay(uint32 ms);
|
||||||
|
|
||||||
void enet_delay(void)
|
void enet_delay(uint32 ms)
|
||||||
{
|
{
|
||||||
volatile uint32_t i = 0;
|
ImxrtMsDelay(ms);
|
||||||
for (i = 0; i < 10000000; ++i)
|
|
||||||
{
|
|
||||||
__asm("NOP"); /* delay */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Time_Update_LwIP(void)
|
void Time_Update_LwIP(void)
|
||||||
|
@ -126,7 +123,7 @@ void ethernetif_gpio_init(void)
|
||||||
/* pull up the ENET_INT before RESET. */
|
/* pull up the ENET_INT before RESET. */
|
||||||
GPIO_WritePinOutput(GPIO1, 10, 1);
|
GPIO_WritePinOutput(GPIO1, 10, 1);
|
||||||
GPIO_WritePinOutput(GPIO1, 3, 0);
|
GPIO_WritePinOutput(GPIO1, 3, 0);
|
||||||
enet_delay();
|
enet_delay(30);
|
||||||
GPIO_WritePinOutput(GPIO1, 3, 1);
|
GPIO_WritePinOutput(GPIO1, 3, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,294 @@
|
||||||
|
#
|
||||||
|
# Automatically generated file; DO NOT EDIT.
|
||||||
|
# XiZi_IIoT Project Configuration
|
||||||
|
#
|
||||||
|
CONFIG_BOARD_CORTEX_M7_EVB=y
|
||||||
|
CONFIG_ARCH_ARM=y
|
||||||
|
|
||||||
|
#
|
||||||
|
# xiwangtong-arm32 feature
|
||||||
|
#
|
||||||
|
CONFIG_BSP_USING_LPUART=y
|
||||||
|
CONFIG_BSP_USING_LPUART1=y
|
||||||
|
CONFIG_SERIAL_BUS_NAME_1="uart1"
|
||||||
|
CONFIG_SERIAL_DRV_NAME_1="uart1_drv"
|
||||||
|
CONFIG_SERIAL_1_DEVICE_NAME_0="uart1_dev1"
|
||||||
|
CONFIG_BSP_USING_LPUART2=y
|
||||||
|
CONFIG_SERIAL_BUS_NAME_2="uart2"
|
||||||
|
CONFIG_SERIAL_DRV_NAME_2="uart2_drv"
|
||||||
|
CONFIG_SERIAL_2_DEVICE_NAME_0="uart2_dev2"
|
||||||
|
CONFIG_BSP_USING_LPUART3=y
|
||||||
|
CONFIG_SERIAL_BUS_NAME_3="uart3"
|
||||||
|
CONFIG_SERIAL_DRV_NAME_3="uart3_drv"
|
||||||
|
CONFIG_SERIAL_3_DEVICE_NAME_0="uart3_dev3"
|
||||||
|
# CONFIG_BSP_USING_LPUART4 is not set
|
||||||
|
# CONFIG_BSP_USING_LPUART8 is not set
|
||||||
|
# CONFIG_BSP_USING_CH438 is not set
|
||||||
|
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_I2C is not set
|
||||||
|
# CONFIG_BSP_USING_LWIP is not set
|
||||||
|
# CONFIG_BSP_USING_SEMC is not set
|
||||||
|
# CONFIG_BSP_USING_SDIO is not set
|
||||||
|
# CONFIG_BSP_USING_LCD is not set
|
||||||
|
# CONFIG_BSP_USING_TOUCH is not set
|
||||||
|
# CONFIG_BSP_USING_USB is not set
|
||||||
|
# CONFIG_BSP_USING_WDT is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# config default board resources
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# config board app name
|
||||||
|
#
|
||||||
|
CONFIG_BOARD_APP_NAME="/XiUOS_xidatong_app.bin"
|
||||||
|
|
||||||
|
#
|
||||||
|
# config board service table
|
||||||
|
#
|
||||||
|
CONFIG_SERVICE_TABLE_ADDRESS=0x2007F0000
|
||||||
|
CONFIG___STACKSIZE__=4096
|
||||||
|
|
||||||
|
#
|
||||||
|
# config board peripheral
|
||||||
|
#
|
||||||
|
# CONFIG_MOUNT_SDCARD is not set
|
||||||
|
# CONFIG_MOUNT_USB is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Hardware feature
|
||||||
|
#
|
||||||
|
CONFIG_RESOURCES_SERIAL=y
|
||||||
|
CONFIG_SERIAL_USING_DMA=y
|
||||||
|
CONFIG_SERIAL_RB_BUFSZ=128
|
||||||
|
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_APP_STARTUP_FROM_SDCARD is not set
|
||||||
|
CONFIG_APP_STARTUP_FROM_FLASH=y
|
||||||
|
# CONFIG_COMPILER_KERNEL is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Memory Management
|
||||||
|
#
|
||||||
|
# CONFIG_KERNEL_MEMBLOCK is not set
|
||||||
|
CONFIG_MEM_ALIGN_SIZE=8
|
||||||
|
# CONFIG_MEM_EXTERN_SRAM is not set
|
||||||
|
CONFIG_MM_PAGE_SIZE=4096
|
||||||
|
|
||||||
|
#
|
||||||
|
# Using small memory allocator
|
||||||
|
#
|
||||||
|
CONFIG_KERNEL_SMALL_MEM_ALLOC=y
|
||||||
|
CONFIG_SMALL_NUMBER_32B=64
|
||||||
|
CONFIG_SMALL_NUMBER_64B=32
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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=y
|
||||||
|
CONFIG_KERNEL_MESSAGEQUEUE=y
|
||||||
|
CONFIG_KERNEL_SOFTTIMER=y
|
||||||
|
CONFIG_SCHED_POLICY_RR_REMAINSLICE=y
|
||||||
|
# CONFIG_SCHED_POLICY_RR is not set
|
||||||
|
# CONFIG_SCHED_POLICY_FIFO is not set
|
||||||
|
# CONFIG_KTASK_PRIORITY_8 is not set
|
||||||
|
CONFIG_KTASK_PRIORITY_32=y
|
||||||
|
# CONFIG_KTASK_PRIORITY_256 is not set
|
||||||
|
CONFIG_KTASK_PRIORITY_MAX=32
|
||||||
|
CONFIG_TICK_PER_SECOND=1000
|
||||||
|
CONFIG_KERNEL_STACK_OVERFLOW_CHECK=y
|
||||||
|
CONFIG_IDLE_KTASK_STACKSIZE=1024
|
||||||
|
CONFIG_ZOMBIE_KTASK_STACKSIZE=2048
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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_ENTER_CR=y
|
||||||
|
CONFIG_SHELL_ENTER_LF=y
|
||||||
|
CONFIG_SHELL_ENTER_CR_AND_LF=y
|
||||||
|
# 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
|
||||||
|
|
||||||
|
#
|
||||||
|
# Set shell config param
|
||||||
|
#
|
||||||
|
CONFIG_SHELL_TASK_STACK_SIZE=4096
|
||||||
|
CONFIG_SHELL_TASK_PRIORITY=20
|
||||||
|
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=y
|
||||||
|
CONFIG_WORKQUEUE_KTASK_STACKSIZE=2048
|
||||||
|
CONFIG_WORKQUEUE_KTASK_PRIORITY=23
|
||||||
|
CONFIG_QUEUE_MAX=16
|
||||||
|
CONFIG_KERNEL_WAITQUEUE=y
|
||||||
|
CONFIG_KERNEL_DATAQUEUE=y
|
||||||
|
# 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=8192
|
||||||
|
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=16
|
||||||
|
CONFIG_ID_NUM_MAX=128
|
||||||
|
# CONFIG_KERNEL_TEST is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# Lib
|
||||||
|
#
|
||||||
|
CONFIG_LIB=y
|
||||||
|
CONFIG_LIB_POSIX=y
|
||||||
|
CONFIG_LIB_NEWLIB=y
|
||||||
|
# CONFIG_LIB_MUSLLIB is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# C++ features
|
||||||
|
#
|
||||||
|
# CONFIG_LIB_CPLUSPLUS is not set
|
||||||
|
|
||||||
|
#
|
||||||
|
# File system
|
||||||
|
#
|
||||||
|
CONFIG_FS_VFS=y
|
||||||
|
CONFIG_VFS_USING_WORKDIR=y
|
||||||
|
CONFIG_FS_VFS_DEVFS=y
|
||||||
|
CONFIG_FS_VFS_FATFS=y
|
||||||
|
# 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=4096
|
||||||
|
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
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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
|
|
@ -83,6 +83,33 @@ extern int Imxrt1052HwLcdInit(void);
|
||||||
extern int HwTouchInit();
|
extern int HwTouchInit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void ImxrtMsDelay(uint32 ms)
|
||||||
|
{
|
||||||
|
uint64 ticks = 0;
|
||||||
|
uint32 told, tnow, tcnt = 0;
|
||||||
|
uint32 reload = SysTick->LOAD;
|
||||||
|
|
||||||
|
ticks = ((uint64)ms * ((uint64)reload + 1) * TICK_PER_SECOND) / 1000;
|
||||||
|
told = SysTick->VAL;
|
||||||
|
|
||||||
|
//KPrintf("%s reload %u ms %u ticks %u told %u\n", __func__, reload, ms, ticks, told);
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
tnow = SysTick->VAL;
|
||||||
|
if (tnow != told) {
|
||||||
|
if (tnow < told) {
|
||||||
|
tcnt += told - tnow;
|
||||||
|
} else {
|
||||||
|
tcnt += reload - tnow + told;
|
||||||
|
}
|
||||||
|
told = tnow;
|
||||||
|
if (tcnt >= ticks) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BOARD_SD_Pin_Config(uint32_t speed, uint32_t strength)
|
void BOARD_SD_Pin_Config(uint32_t speed, uint32_t strength)
|
||||||
{
|
{
|
||||||
IOMUXC_SetPinConfig(IOMUXC_GPIO_SD_B0_00_USDHC1_CMD,
|
IOMUXC_SetPinConfig(IOMUXC_GPIO_SD_B0_00_USDHC1_CMD,
|
||||||
|
@ -291,7 +318,6 @@ void SysTick_Handler(int irqn, void *arg)
|
||||||
{
|
{
|
||||||
TickAndTaskTimesliceUpdate();
|
TickAndTaskTimesliceUpdate();
|
||||||
}
|
}
|
||||||
DECLARE_HW_IRQ(SYSTICK_IRQN, SysTick_Handler, NONE);
|
|
||||||
|
|
||||||
struct InitSequenceDesc _board_init[] =
|
struct InitSequenceDesc _board_init[] =
|
||||||
{
|
{
|
||||||
|
|
|
@ -81,14 +81,11 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Code
|
* Code
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
extern void ImxrtMsDelay(uint32 ms);
|
||||||
|
|
||||||
void enet_delay(void)
|
void enet_delay(uint32 ms)
|
||||||
{
|
{
|
||||||
volatile uint32_t i = 0;
|
ImxrtMsDelay(ms);
|
||||||
for (i = 0; i < 1000000; ++i)
|
|
||||||
{
|
|
||||||
__asm("NOP"); /* delay */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Time_Update_LwIP(void)
|
void Time_Update_LwIP(void)
|
||||||
|
@ -112,7 +109,7 @@ void ethernetif_gpio_init(void)
|
||||||
/* pull up the ENET_INT before RESET. */
|
/* pull up the ENET_INT before RESET. */
|
||||||
GPIO_WritePinOutput(GPIO1, 10, 1);
|
GPIO_WritePinOutput(GPIO1, 10, 1);
|
||||||
GPIO_WritePinOutput(GPIO1, 3, 0);
|
GPIO_WritePinOutput(GPIO1, 3, 0);
|
||||||
enet_delay();
|
enet_delay(30);
|
||||||
GPIO_WritePinOutput(GPIO1, 3, 1);
|
GPIO_WritePinOutput(GPIO1, 3, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue