diff --git a/.gitmodules b/.gitmodules index 0c1a2eedf..4b15013ec 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,4 +28,7 @@ [submodule "APP_Framework/lib/lorawan/lorawan_devicenode"] path = APP_Framework/lib/lorawan/lorawan_devicenode url = https://gitlink.org.cn/IACU/lorawan_devicenode.git - branch = master \ No newline at end of file + branch = master +[submodule "APP_Framework/lib/lorawan/lorawan_gateway_single_channel"] + path = APP_Framework/lib/lorawan/lorawan_gateway_single_channel + url = https://gitlink.org.cn/IACU/lorawan_gateway_single_channel.git diff --git a/APP_Framework/Applications/Makefile b/APP_Framework/Applications/Makefile index 262ae4911..0f0d2a744 100644 --- a/APP_Framework/Applications/Makefile +++ b/APP_Framework/Applications/Makefile @@ -1,13 +1,13 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_DIR := general_functions app_test SRC_FILES := main.c diff --git a/APP_Framework/Applications/app_test/Kconfig b/APP_Framework/Applications/app_test/Kconfig index 45df5f5d5..3a103a6b3 100644 --- a/APP_Framework/Applications/app_test/Kconfig +++ b/APP_Framework/Applications/app_test/Kconfig @@ -8,7 +8,7 @@ menu "test app" bool "Config test adc" default n if USER_TEST_ADC - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config ADC_DEV_DRIVER string "Set ADC dev path" default "/dev/adc1_dev" @@ -19,7 +19,7 @@ menu "test app" bool "Config test dac" default n if USER_TEST_DAC - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config DAC_DEV_DRIVER string "Set DAC dev path" default "/dev/dac_dev" @@ -30,7 +30,7 @@ menu "test app" bool "Config test fs with sd or usb" default n if USER_TEST_FS - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config FPATH string "Set test file path" default "/test_file" @@ -46,7 +46,7 @@ menu "test app" bool "Config test gpio with led and key" default n if USER_TEST_GPIO - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config GPIO_DEV_DRIVER string "Set gpio dev path" default "/dev/pin_dev" @@ -62,7 +62,7 @@ menu "test app" bool "Config test uart(loraE220)" default n if USER_TEST_LORA - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config LORA_UART_DEV_DRIVER string "Set uart dev path" default "/dev/uart2_dev2" @@ -80,7 +80,7 @@ menu "test app" bool "Config test uart(RS485)" default n if USER_TEST_RS485 - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config RS485_UART_DEV_DRIVER string "Set uart dev path" default "/dev/uart1_dev1" @@ -95,7 +95,7 @@ menu "test app" bool "Config test rtc" default n if USER_TEST_RTC - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config RTC_DEV_DRIVER string "Set rtc dev path" default "/dev/rtc_dev" @@ -110,7 +110,7 @@ menu "test app" bool "Config test hwtimer" default n if USER_TEST_HWTIMER - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config HWTIMER_TIMER_DEV_DRIVER string "Set pin dev path" default "/dev/timer0_dev0" @@ -125,7 +125,7 @@ menu "test app" bool "Config test watchdog" default n if USER_TEST_WDT - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config WDT0_DEV_DRIVER string "Set wdt dev path" default "/dev/wdt0_dev0" @@ -137,7 +137,7 @@ menu "test app" bool "Config test lcd in PrivOpen" default n if USER_TEST_LCD_EDU - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config EDU_LCD_DEV_DRIVER string "Set lcd dev path" default "/dev/lcd_dev" @@ -149,7 +149,7 @@ menu "test app" bool "Config test touch" default n if USER_TEST_TOUCH - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config TOUCH_DEV_DRIVER string "Set touch dev path" default "/dev/touch_dev" @@ -164,7 +164,7 @@ menu "test app" bool "Config test i2c" default n if USER_TEST_I2C - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config I2C_DEV_DRIVER string "Set i2c dev path" default "/dev/i2c1_dev0" @@ -176,7 +176,7 @@ menu "test app" bool "Config test can" default n if USER_TEST_CAN - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config CAN_DEV_DRIVER string "Set can dev path" default "/dev/can2_dev1" @@ -189,7 +189,7 @@ menu "test app" bool "Config test camera with lcd" default n if USER_TEST_CAMERA - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config CAMERA_DEV_DRIVER string "Set camera dev path" default "/dev/camera_dev" @@ -211,7 +211,7 @@ menu "test app" bool "Config test ethernet only for edu-riscv64" default n if USER_TEST_ETHERNET - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES choice prompt "set ethernet role as client or server" default ETHERNET_AS_SERVER @@ -229,7 +229,7 @@ menu "test app" bool "Config test w25q128 device" default n if USER_TEST_FLASH - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config FLASH_DEV_DRIVER string "Set flash dev path" default "/dev/qspi_W25Q128" diff --git a/APP_Framework/Applications/app_test/Makefile b/APP_Framework/Applications/app_test/Makefile index 1cf919846..200e9e02a 100644 --- a/APP_Framework/Applications/app_test/Makefile +++ b/APP_Framework/Applications/app_test/Makefile @@ -1,5 +1,5 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs ifeq ($(CONFIG_USER_TEST_SEMC),y) @@ -22,7 +22,7 @@ ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := test_shell.c ifeq ($(CONFIG_USER_TEST_ADC),y) diff --git a/APP_Framework/Applications/app_test/test_adc.c b/APP_Framework/Applications/app_test/test_adc.c index c8cb94bfc..ceceec161 100644 --- a/APP_Framework/Applications/app_test/test_adc.c +++ b/APP_Framework/Applications/app_test/test_adc.c @@ -21,7 +21,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES void TestAdc(void) { diff --git a/APP_Framework/Applications/app_test/test_camera.c b/APP_Framework/Applications/app_test/test_camera.c index 5f9c03e65..442bfd615 100644 --- a/APP_Framework/Applications/app_test/test_camera.c +++ b/APP_Framework/Applications/app_test/test_camera.c @@ -21,7 +21,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES static uint16_t image_buff[384000]; diff --git a/APP_Framework/Applications/app_test/test_can.c b/APP_Framework/Applications/app_test/test_can.c index 046503642..c19abecdb 100644 --- a/APP_Framework/Applications/app_test/test_can.c +++ b/APP_Framework/Applications/app_test/test_can.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES void TestCAN(void) diff --git a/APP_Framework/Applications/app_test/test_dac.c b/APP_Framework/Applications/app_test/test_dac.c index 4aa105eb1..37ac2bf1c 100644 --- a/APP_Framework/Applications/app_test/test_dac.c +++ b/APP_Framework/Applications/app_test/test_dac.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES void TestDac(void) { diff --git a/APP_Framework/Applications/app_test/test_ethernet.c b/APP_Framework/Applications/app_test/test_ethernet.c index a94a8c15c..9f4a4ce8f 100644 --- a/APP_Framework/Applications/app_test/test_ethernet.c +++ b/APP_Framework/Applications/app_test/test_ethernet.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES #include diff --git a/APP_Framework/Applications/app_test/test_flash.c b/APP_Framework/Applications/app_test/test_flash.c index e2ea3be86..fb12f461a 100644 --- a/APP_Framework/Applications/app_test/test_flash.c +++ b/APP_Framework/Applications/app_test/test_flash.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES void TestFlash(void) { diff --git a/APP_Framework/Applications/app_test/test_fs.c b/APP_Framework/Applications/app_test/test_fs.c index 280d599c8..e0a2c2339 100644 --- a/APP_Framework/Applications/app_test/test_fs.c +++ b/APP_Framework/Applications/app_test/test_fs.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES #define MAX_READ_LENGTH 1000 diff --git a/APP_Framework/Applications/app_test/test_gpio.c b/APP_Framework/Applications/app_test/test_gpio.c index ea2262416..16bbfbb89 100644 --- a/APP_Framework/Applications/app_test/test_gpio.c +++ b/APP_Framework/Applications/app_test/test_gpio.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES #ifdef BOARD_EDU_RISCV64_EVB #define BSP_LED_PIN 29 diff --git a/APP_Framework/Applications/app_test/test_hwtimer.c b/APP_Framework/Applications/app_test/test_hwtimer.c index c44a63bc3..9e6f7f981 100644 --- a/APP_Framework/Applications/app_test/test_hwtimer.c +++ b/APP_Framework/Applications/app_test/test_hwtimer.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES #define BSP_LED_PIN 134 #define NULL_PARAMETER 0 diff --git a/APP_Framework/Applications/app_test/test_i2c.c b/APP_Framework/Applications/app_test/test_i2c.c index 5428d9296..76881b92e 100644 --- a/APP_Framework/Applications/app_test/test_i2c.c +++ b/APP_Framework/Applications/app_test/test_i2c.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES #define I2C_SLAVE_ADDRESS 0x0012U diff --git a/APP_Framework/Applications/app_test/test_lcd.c b/APP_Framework/Applications/app_test/test_lcd.c index 0e8b4be28..eee200d7a 100755 --- a/APP_Framework/Applications/app_test/test_lcd.c +++ b/APP_Framework/Applications/app_test/test_lcd.c @@ -20,7 +20,7 @@ #include -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES #ifdef CONFIG_K210_LCD void LcdDemo(void) diff --git a/APP_Framework/Applications/app_test/test_lcd_edu.c b/APP_Framework/Applications/app_test/test_lcd_edu.c index edb1ac96c..e1dddbfd2 100644 --- a/APP_Framework/Applications/app_test/test_lcd_edu.c +++ b/APP_Framework/Applications/app_test/test_lcd_edu.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES #define GRAPHIC_CTRL_RECT_UPDATE 0x00 #define LCD_STRING_TYPE 0 diff --git a/APP_Framework/Applications/app_test/test_loraE220.c b/APP_Framework/Applications/app_test/test_loraE220.c index 45eddd69b..90682c990 100644 --- a/APP_Framework/Applications/app_test/test_loraE220.c +++ b/APP_Framework/Applications/app_test/test_loraE220.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES #define NULL_PARAMETER 0 #define E220_CFG_LENGTH diff --git a/APP_Framework/Applications/app_test/test_musl.c b/APP_Framework/Applications/app_test/test_musl.c index bfa1ba1f7..ce9432b5a 100644 --- a/APP_Framework/Applications/app_test/test_musl.c +++ b/APP_Framework/Applications/app_test/test_musl.c @@ -20,7 +20,7 @@ #include -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES #if defined(CONFIG_MUSL_LIBC) && defined(CONFIG_FS_AUTOMOUNTER) diff --git a/APP_Framework/Applications/app_test/test_rs485.c b/APP_Framework/Applications/app_test/test_rs485.c index 1c90a5190..bbe6f1c4d 100644 --- a/APP_Framework/Applications/app_test/test_rs485.c +++ b/APP_Framework/Applications/app_test/test_rs485.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES #define BSP_485_DIR_PIN 24 diff --git a/APP_Framework/Applications/app_test/test_rtc.c b/APP_Framework/Applications/app_test/test_rtc.c index cff31edbc..a7f64d393 100644 --- a/APP_Framework/Applications/app_test/test_rtc.c +++ b/APP_Framework/Applications/app_test/test_rtc.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES void TestRTC(int argc,char *argv[]) { diff --git a/APP_Framework/Applications/app_test/test_touch.c b/APP_Framework/Applications/app_test/test_touch.c index e378b9de6..0eb1cdc88 100644 --- a/APP_Framework/Applications/app_test/test_touch.c +++ b/APP_Framework/Applications/app_test/test_touch.c @@ -24,7 +24,7 @@ #include -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES #ifdef CONFIG_BSP_USING_TOUCH void TestTouch(void) @@ -48,7 +48,7 @@ void TestTouch(void) #define LCD_DOT_TYPE 1 #define LCD_SIZE 320 -#elif defined ADD_XIZI_FETURES +#elif defined ADD_XIZI_FEATURES void TestTouch(void) { diff --git a/APP_Framework/Applications/app_test/test_wdt.c b/APP_Framework/Applications/app_test/test_wdt.c index 99115c038..cace0a9cd 100644 --- a/APP_Framework/Applications/app_test/test_wdt.c +++ b/APP_Framework/Applications/app_test/test_wdt.c @@ -20,7 +20,7 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES void TestWDT(int argc, char *agrv[]) { diff --git a/APP_Framework/Applications/connection_app/Makefile b/APP_Framework/Applications/connection_app/Makefile index df4ae9b97..8aa357308 100755 --- a/APP_Framework/Applications/connection_app/Makefile +++ b/APP_Framework/Applications/connection_app/Makefile @@ -1,11 +1,11 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) ifeq ($(CONFIG_CONNECTION_ADAPTER_4G),y) SRC_DIR += 4g_app diff --git a/APP_Framework/Applications/connection_app/socket_demo/Makefile b/APP_Framework/Applications/connection_app/socket_demo/Makefile index f75bae3ee..c75d0ece7 100755 --- a/APP_Framework/Applications/connection_app/socket_demo/Makefile +++ b/APP_Framework/Applications/connection_app/socket_demo/Makefile @@ -1,10 +1,10 @@ -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := lwip_tcp_socket_demo.c lwip_udp_socket_demo.c include $(KERNEL_ROOT)/compiler.mk endif include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += lwip_tcp_socket_demo.c lwip_udp_socket_demo.c include $(APPDIR)/Application.mk diff --git a/APP_Framework/Applications/connection_app/socket_demo/lwip_tcp_socket_demo.c b/APP_Framework/Applications/connection_app/socket_demo/lwip_tcp_socket_demo.c index 48f147fe9..f0d0d6dbc 100755 --- a/APP_Framework/Applications/connection_app/socket_demo/lwip_tcp_socket_demo.c +++ b/APP_Framework/Applications/connection_app/socket_demo/lwip_tcp_socket_demo.c @@ -20,13 +20,13 @@ #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES #include #include #include "lwip/sys.h" #endif -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES #include #include #include @@ -45,7 +45,7 @@ static char tcp_demo_ipaddr[] = {192, 168, 131, 77}; static char tcp_demo_netmask[] = {255, 255, 254, 0}; static char tcp_demo_gwaddr[] = {192, 168, 131, 1}; -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES #define lw_print printf #define lw_notice printf #define lw_error printf @@ -151,7 +151,7 @@ void TcpSocketRecvTest(int argc, char *argv[]) TcpSocketConfigParam(argv[1]); } -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES lwip_config_tcp(0, tcp_demo_ipaddr, tcp_demo_netmask, tcp_demo_gwaddr); pthread_attr_t attr; @@ -159,7 +159,7 @@ void TcpSocketRecvTest(int argc, char *argv[]) attr.stacksize = LWIP_TCP_DEMO_TASK_STACK_SIZE; #endif -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES pthread_attr_t attr = PTHREAD_ATTR_INITIALIZER; attr.priority = LWIP_TCP_DEMO_TASK_PRIO; attr.stacksize = LWIP_TCP_DEMO_TASK_STACK_SIZE; @@ -222,14 +222,14 @@ void TcpSocketSendTest(int argc, char *argv[]) TcpSocketConfigParam(argv[1]); } -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES lwip_config_tcp(0, tcp_demo_ipaddr, tcp_demo_netmask, tcp_demo_gwaddr); pthread_attr_t attr; attr.schedparam.sched_priority = LWIP_TCP_DEMO_TASK_PRIO; attr.stacksize = LWIP_TCP_DEMO_TASK_STACK_SIZE; #endif -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES pthread_attr_t attr = PTHREAD_ATTR_INITIALIZER; attr.priority = LWIP_TCP_DEMO_TASK_PRIO; attr.stacksize = LWIP_TCP_DEMO_TASK_STACK_SIZE; diff --git a/APP_Framework/Applications/connection_app/socket_demo/lwip_udp_socket_demo.c b/APP_Framework/Applications/connection_app/socket_demo/lwip_udp_socket_demo.c index b6af89ffe..ebb2a06d0 100755 --- a/APP_Framework/Applications/connection_app/socket_demo/lwip_udp_socket_demo.c +++ b/APP_Framework/Applications/connection_app/socket_demo/lwip_udp_socket_demo.c @@ -19,12 +19,12 @@ */ #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES #include #include "lwip/sockets.h" #endif -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES #include #include #include @@ -133,14 +133,14 @@ void UdpSocketRecvTest(int argc, char *argv[]) UdpSocketConfigParam(argv[1]); } -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES lwip_config_tcp(0, udp_demo_ipaddr, udp_demo_netmask, udp_demo_gwaddr); pthread_attr_t attr; attr.schedparam.sched_priority = LWIP_UDP_DEMO_TASK_PRIO; attr.stacksize = LWIP_UDP_DEMO_TASK_STACK_SIZE; #endif -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES pthread_attr_t attr = PTHREAD_ATTR_INITIALIZER; attr.priority = LWIP_UDP_DEMO_TASK_PRIO; attr.stacksize = LWIP_UDP_DEMO_TASK_STACK_SIZE; @@ -199,14 +199,14 @@ void UdpSocketSendTest(int argc, char *argv[]) UdpSocketConfigParam(argv[1]); } -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES lwip_config_tcp(0, udp_demo_ipaddr, udp_demo_netmask, udp_demo_gwaddr); pthread_attr_t attr; attr.schedparam.sched_priority = LWIP_UDP_DEMO_TASK_PRIO; attr.stacksize = LWIP_UDP_DEMO_TASK_STACK_SIZE; #endif -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES pthread_attr_t attr = PTHREAD_ATTR_INITIALIZER; attr.priority = LWIP_UDP_DEMO_TASK_PRIO; attr.stacksize = LWIP_UDP_DEMO_TASK_STACK_SIZE; diff --git a/APP_Framework/Applications/general_functions/circular_area/Makefile b/APP_Framework/Applications/general_functions/circular_area/Makefile index 30616891b..3a440ecbf 100644 --- a/APP_Framework/Applications/general_functions/circular_area/Makefile +++ b/APP_Framework/Applications/general_functions/circular_area/Makefile @@ -1,11 +1,11 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += circular_area_app.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := circular_area_app.c include $(KERNEL_ROOT)/compiler.mk endif \ No newline at end of file diff --git a/APP_Framework/Applications/general_functions/list/Makefile b/APP_Framework/Applications/general_functions/list/Makefile index acfac595c..cb227275c 100644 --- a/APP_Framework/Applications/general_functions/list/Makefile +++ b/APP_Framework/Applications/general_functions/list/Makefile @@ -1,11 +1,11 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += double_list.c single_list.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := double_list.c single_list.c include $(KERNEL_ROOT)/compiler.mk endif \ No newline at end of file diff --git a/APP_Framework/Applications/knowing_app/k210_fft_test/Makefile b/APP_Framework/Applications/knowing_app/k210_fft_test/Makefile index ff9bc3df8..23476939d 100644 --- a/APP_Framework/Applications/knowing_app/k210_fft_test/Makefile +++ b/APP_Framework/Applications/knowing_app/k210_fft_test/Makefile @@ -1,6 +1,6 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs ifeq ($(CONFIG_K210_FFT_TEST), y) diff --git a/APP_Framework/Applications/knowing_app/k210_fft_test/fft_test.c b/APP_Framework/Applications/knowing_app/k210_fft_test/fft_test.c index 3a54afbb0..5166087f9 100644 --- a/APP_Framework/Applications/knowing_app/k210_fft_test/fft_test.c +++ b/APP_Framework/Applications/knowing_app/k210_fft_test/fft_test.c @@ -155,7 +155,7 @@ void k210_fft_test(void) cycle[FFT_SOFT][FFT_DIR_BACKWARD]/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000000)); } -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES void nuttx_k210_fft_test(void) { pthread_t thread; diff --git a/APP_Framework/Applications/knowing_app/nnom_demo/mnist_nnom/main.c b/APP_Framework/Applications/knowing_app/nnom_demo/mnist_nnom/main.c index dcdb6e8f7..4c2f5022e 100644 --- a/APP_Framework/Applications/knowing_app/nnom_demo/mnist_nnom/main.c +++ b/APP_Framework/Applications/knowing_app/nnom_demo/mnist_nnom/main.c @@ -71,7 +71,7 @@ void mnist_nnom(int argc, char **argv) printf("Predicted label: %d\n", predic_label); printf("Probability: %d%%\n", (int)(prob * 100)); } -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES PRIV_SHELL_CMD_FUNCTION(mnist_nnom, a mnist_nnom test sample, PRIV_SHELL_CMD_MAIN_ATTR); #endif #ifdef __RT_THREAD_H__ diff --git a/APP_Framework/Applications/sensor_app/Kconfig b/APP_Framework/Applications/sensor_app/Kconfig index fbab69a78..d00f82865 100755 --- a/APP_Framework/Applications/sensor_app/Kconfig +++ b/APP_Framework/Applications/sensor_app/Kconfig @@ -108,7 +108,7 @@ menu "sensor app" bool "Using sensor HS300x apps" default n - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES endif endif @@ -122,7 +122,7 @@ menu "sensor app" bool "Using sensor HS300x apps" default n - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES endif endif diff --git a/APP_Framework/Applications/sensor_app/Makefile b/APP_Framework/Applications/sensor_app/Makefile index 03bc3952a..a67b8fb53 100644 --- a/APP_Framework/Applications/sensor_app/Makefile +++ b/APP_Framework/Applications/sensor_app/Makefile @@ -1,6 +1,6 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs ifeq ($(CONFIG_APPLICATION_SENSOR_HCHO_TB600B_WQ_HCHO1OS), y) @@ -64,7 +64,7 @@ ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := ifeq ($(CONFIG_APPLICATION_SENSOR_HCHO_TB600B_WQ_HCHO1OS), y) diff --git a/APP_Framework/Framework/Kconfig b/APP_Framework/Framework/Kconfig index 7934d2006..9be072ceb 100644 --- a/APP_Framework/Framework/Kconfig +++ b/APP_Framework/Framework/Kconfig @@ -5,16 +5,16 @@ menu "Framework" default y choice prompt "select os features" - default ADD_XIZI_FETURES + default ADD_XIZI_FEATURES - config ADD_XIZI_FETURES - bool "add xizi fetures" + config ADD_XIZI_FEATURES + bool "add xizi features" - config ADD_NUTTX_FETURES - bool "add nuttx fetures" + config ADD_NUTTX_FEATURES + bool "add nuttx features" - config ADD_RTTHREAD_FETURES - bool "add rt_thread fetures" + config ADD_RTTHREAD_FEATURES + bool "add rt_thread features" endchoice diff --git a/APP_Framework/Framework/Makefile b/APP_Framework/Framework/Makefile index 32a3a1005..ca4bace06 100644 --- a/APP_Framework/Framework/Makefile +++ b/APP_Framework/Framework/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += framework_init.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := framework_init.c SRC_DIR := transform_layer diff --git a/APP_Framework/Framework/connection/4g/Makefile b/APP_Framework/Framework/connection/4g/Makefile index f5c4a138e..df607fbb6 100644 --- a/APP_Framework/Framework/connection/4g/Makefile +++ b/APP_Framework/Framework/connection/4g/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += adapter_4g.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := adapter_4g.c ifeq ($(CONFIG_ADAPTER_EC200T),y) diff --git a/APP_Framework/Framework/connection/4g/ec200t/Kconfig b/APP_Framework/Framework/connection/4g/ec200t/Kconfig index f97268782..c84c4b9a6 100644 --- a/APP_Framework/Framework/connection/4g/ec200t/Kconfig +++ b/APP_Framework/Framework/connection/4g/ec200t/Kconfig @@ -2,7 +2,7 @@ config ADAPTER_4G_EC200T string "EC200T adapter name" default "ec200t" -if ADD_XIZI_FETURES +if ADD_XIZI_FEATURES config ADAPTER_EC200T_USING_PWRKEY bool "EC200T using PWRKEY pin number" default n @@ -37,7 +37,7 @@ if ADD_XIZI_FETURES endif endif -if ADD_NUTTX_FETURES +if ADD_NUTTX_FEATURES config ADAPTER_EC200T_USING_PWRKEY bool "EC200T using PWRKEY pin number" default n @@ -72,7 +72,7 @@ if ADD_NUTTX_FETURES endif endif -if ADD_RTTHREAD_FETURES +if ADD_RTTHREAD_FEATURES config ADAPTER_EC200T_PWRKEY int "EC200T PWRKEY pin number" default "97" diff --git a/APP_Framework/Framework/connection/4g/ec200t/Makefile b/APP_Framework/Framework/connection/4g/ec200t/Makefile index 5b2bff1fe..e3bf4efec 100644 --- a/APP_Framework/Framework/connection/4g/ec200t/Makefile +++ b/APP_Framework/Framework/connection/4g/ec200t/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += ec200t.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := ec200t.c include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/Framework/connection/4g/ec200t/ec200t.c b/APP_Framework/Framework/connection/4g/ec200t/ec200t.c index 6fd36e9b9..92f687303 100644 --- a/APP_Framework/Framework/connection/4g/ec200t/ec200t.c +++ b/APP_Framework/Framework/connection/4g/ec200t/ec200t.c @@ -142,7 +142,7 @@ out: return ret; } -#ifdef ADD_RTTHREAD_FETURES +#ifdef ADD_RTTHREAD_FEATURES static int Ec200tIoctl(struct Adapter *adapter, int cmd, void *args){ return 0;} #else static int Ec200tIoctl(struct Adapter *adapter, int cmd, void *args) diff --git a/APP_Framework/Framework/connection/Makefile b/APP_Framework/Framework/connection/Makefile index cc71769af..0a33bf95f 100644 --- a/APP_Framework/Framework/connection/Makefile +++ b/APP_Framework/Framework/connection/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += adapter.c adapter_agent.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := adapter.c adapter_agent.c ifeq ($(CONFIG_CONNECTION_INDUSTRIAL_NETWORK),y) diff --git a/APP_Framework/Framework/connection/adapter_agent.c b/APP_Framework/Framework/connection/adapter_agent.c index dd77eb3de..e9c4dcb98 100755 --- a/APP_Framework/Framework/connection/adapter_agent.c +++ b/APP_Framework/Framework/connection/adapter_agent.c @@ -26,10 +26,10 @@ #include #include #include -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES # include #endif -#ifdef ADD_RTTHREAD_FETURES +#ifdef ADD_RTTHREAD_FEATURES #include #endif #define AT_CMD_MAX_LEN 128 @@ -450,26 +450,26 @@ int DeleteATAgent(ATAgentType agent) PrivClose(agent->fd); } -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES if (agent->lock.sem.semcount > 0) { printf("delete agent lock = %d\n",agent->lock.sem.semcount); PrivMutexDelete(&agent->lock); } -#elif defined ADD_RTTHREAD_FETURES +#elif defined ADD_RTTHREAD_FEATURES #else if (agent->lock) { printf("delete agent lock = %d\n",agent->lock); PrivMutexDelete(&agent->lock); } #endif -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES if (agent->entm_rx_notice) { printf("delete agent entm_rx_notice = %d\n",agent->entm_rx_notice); PrivSemaphoreDelete(&agent->entm_rx_notice); } #else #endif -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES if (agent->rsp_sem) { printf("delete agent rsp_sem = %d\n",agent->rsp_sem); PrivSemaphoreDelete(&agent->rsp_sem); @@ -544,7 +544,7 @@ static int ATAgentInit(ATAgentType agent) agent->receive_mode = DEFAULT_MODE; -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES pthread_attr_t attr = PTHREAD_ATTR_INITIALIZER; attr.priority = 18; attr.stacksize = 8192; diff --git a/APP_Framework/Framework/connection/at_agent.h b/APP_Framework/Framework/connection/at_agent.h index b1255c51e..81ed948cf 100755 --- a/APP_Framework/Framework/connection/at_agent.h +++ b/APP_Framework/Framework/connection/at_agent.h @@ -58,7 +58,7 @@ struct ATAgent uint32 maintain_len; uint32 maintain_max; -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES int lock; #else pthread_mutex_t lock; @@ -69,7 +69,7 @@ struct ATAgent char reply_end_last_char; char reply_end_char; uint32 reply_char_num; -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES int rsp_sem; #else sem_t rsp_sem; @@ -79,7 +79,7 @@ struct ATAgent char entm_recv_buf[ENTM_RECV_MAX]; uint32 entm_recv_len; enum ReceiveMode receive_mode; -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES int entm_rx_notice; #else sem_t entm_rx_notice; diff --git a/APP_Framework/Framework/connection/bluetooth/Makefile b/APP_Framework/Framework/connection/bluetooth/Makefile index bc7d736cd..3ee1fcaa7 100644 --- a/APP_Framework/Framework/connection/bluetooth/Makefile +++ b/APP_Framework/Framework/connection/bluetooth/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += adapter_bluetooth.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := adapter_bluetooth.c ifeq ($(CONFIG_ADAPTER_HC08),y) diff --git a/APP_Framework/Framework/connection/bluetooth/hc08/Kconfig b/APP_Framework/Framework/connection/bluetooth/hc08/Kconfig index 042cf75a0..6a6887560 100644 --- a/APP_Framework/Framework/connection/bluetooth/hc08/Kconfig +++ b/APP_Framework/Framework/connection/bluetooth/hc08/Kconfig @@ -2,7 +2,7 @@ config ADAPTER_BLUETOOTH_HC08 string "HC08 adapter name" default "hc08" -if ADD_XIZI_FETURES +if ADD_XIZI_FEATURES config ADAPTER_HC08_RECV_BUFFER_SIZE int "HC08 recv data buffer size" default "128" @@ -31,7 +31,7 @@ if ADD_XIZI_FETURES endif endif -if ADD_NUTTX_FETURES +if ADD_NUTTX_FEATURES config ADAPTER_HC08_WORK_ROLE string "HC08 work role M(MASTER) or S(SLAVER)" @@ -58,7 +58,7 @@ if ADD_NUTTX_FETURES endif -if ADD_RTTHREAD_FETURES +if ADD_RTTHREAD_FEATURES config ADAPTER_HC08_RECV_BUFFER_SIZE int "HC08 recv data buffer size" default "128" diff --git a/APP_Framework/Framework/connection/bluetooth/hc08/Makefile b/APP_Framework/Framework/connection/bluetooth/hc08/Makefile index e437a114f..f95394e46 100644 --- a/APP_Framework/Framework/connection/bluetooth/hc08/Makefile +++ b/APP_Framework/Framework/connection/bluetooth/hc08/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += hc08.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := hc08.c include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/Framework/connection/bluetooth/hc08/hc08.c b/APP_Framework/Framework/connection/bluetooth/hc08/hc08.c index 1cbf69d44..d04b732b4 100644 --- a/APP_Framework/Framework/connection/bluetooth/hc08/hc08.c +++ b/APP_Framework/Framework/connection/bluetooth/hc08/hc08.c @@ -353,7 +353,7 @@ static int Hc08Ioctl(struct Adapter *adapter, int cmd, void *args) } PrivTaskDelay(500); - #ifdef ADD_RTTHREAD_FETURES + #ifdef ADD_RTTHREAD_FEATURES //Step3 : show hc08 device info, hc08_get send "AT+RX" response device info char device_info[HC08_RESP_DEFAULT_SIZE * 2] = {0}; if (Hc08AtConfigure(adapter->agent, HC08_AT_CMD_GET_DEVICE_INFO, NULL, device_info) < 0) { @@ -369,7 +369,7 @@ static int Hc08Ioctl(struct Adapter *adapter, int cmd, void *args) if (Hc08AtConfigure(adapter->agent, HC08_AT_CMD_GET_LUUID, NULL, NULL) < 0) { return -1; } - #ifdef ADD_RTTHREAD_FETURES + #ifdef ADD_RTTHREAD_FEATURES uint32_t suuid=1234; if (Hc08AtConfigure(adapter->agent, HC08_AT_CMD_SET_SUUID, &luuid, NULL) < 0) { return -1; diff --git a/APP_Framework/Framework/connection/ethernet/hfa21_ethernet/Kconfig b/APP_Framework/Framework/connection/ethernet/hfa21_ethernet/Kconfig index 808272cfa..2083a127d 100644 --- a/APP_Framework/Framework/connection/ethernet/hfa21_ethernet/Kconfig +++ b/APP_Framework/Framework/connection/ethernet/hfa21_ethernet/Kconfig @@ -2,7 +2,7 @@ config ADAPTER_ETHERNET_HFA21 string "HFA21 ETHERNET adapter name" default "hfa21_ethernet" -if ADD_XIZI_FETURES +if ADD_XIZI_FEATURES config ADAPTER_HFA21_DRIVER_EXTUART bool "Using extra uart to support ethernet" @@ -24,11 +24,11 @@ if ADD_XIZI_FETURES endif endif -if ADD_NUTTX_FETURES +if ADD_NUTTX_FEATURES endif -if ADD_RTTHREAD_FETURES +if ADD_RTTHREAD_FEATURES config ADAPTER_HFA21_DRIVER string "HFA21 device uart driver path" default "/dev/uart3" diff --git a/APP_Framework/Framework/connection/lora/Makefile b/APP_Framework/Framework/connection/lora/Makefile index e1b055274..d35c25340 100644 --- a/APP_Framework/Framework/connection/lora/Makefile +++ b/APP_Framework/Framework/connection/lora/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += adapter_lora.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := adapter_lora.c ifeq ($(CONFIG_ADAPTER_SX1278),y) diff --git a/APP_Framework/Framework/connection/lora/adapter_lora.c b/APP_Framework/Framework/connection/lora/adapter_lora.c index dbb76bcad..0c44b76bd 100644 --- a/APP_Framework/Framework/connection/lora/adapter_lora.c +++ b/APP_Framework/Framework/connection/lora/adapter_lora.c @@ -930,7 +930,7 @@ int AdapterLoraTest(void) //create lora gateway task #ifdef AS_LORA_GATEWAY_ROLE -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES pthread_attr_t lora_gateway_attr = PTHREAD_ATTR_INITIALIZER; lora_gateway_attr.priority = 20; lora_gateway_attr.stacksize = 2048; @@ -943,7 +943,7 @@ int AdapterLoraTest(void) PrivTaskCreate(&lora_recv_data_task, &lora_gateway_attr, &LoraReceiveTask, (void *)adapter); PrivTaskStartup(&lora_recv_data_task); -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES lora_gateway_attr.priority = 19; #else lora_gateway_attr.schedparam.sched_priority = 19; @@ -953,7 +953,7 @@ int AdapterLoraTest(void) PrivTaskStartup(&lora_gateway_task); #else //AS_LORA_CLIENT_ROLE -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES pthread_attr_t lora_client_attr = PTHREAD_ATTR_INITIALIZER; lora_client_attr.priority = 20; lora_client_attr.stacksize = 2048; @@ -965,7 +965,7 @@ int AdapterLoraTest(void) PrivTaskCreate(&lora_recv_data_task, &lora_client_attr, &LoraReceiveTask, (void *)adapter); PrivTaskStartup(&lora_recv_data_task); -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES lora_client_attr.priority = 19; #else lora_client_attr.schedparam.sched_priority = 19; diff --git a/APP_Framework/Framework/connection/lora/e22/Kconfig b/APP_Framework/Framework/connection/lora/e22/Kconfig index ec61a8558..81e0cfc53 100644 --- a/APP_Framework/Framework/connection/lora/e22/Kconfig +++ b/APP_Framework/Framework/connection/lora/e22/Kconfig @@ -2,7 +2,7 @@ config ADAPTER_LORA_E22 string "E22-400T30S adapter name" default "e22" -if ADD_NUTTX_FETURES +if ADD_NUTTX_FEATURES config ADAPTER_E22_M0_PATH string "E22 M0 pin device" diff --git a/APP_Framework/Framework/connection/lora/e22/Makefile b/APP_Framework/Framework/connection/lora/e22/Makefile index c0da4046f..aee122136 100644 --- a/APP_Framework/Framework/connection/lora/e22/Makefile +++ b/APP_Framework/Framework/connection/lora/e22/Makefile @@ -1,5 +1,5 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += e22.c include $(APPDIR)/Application.mk diff --git a/APP_Framework/Framework/connection/lora/e220/Kconfig b/APP_Framework/Framework/connection/lora/e220/Kconfig index 9e51b8eda..2ef8c83d4 100644 --- a/APP_Framework/Framework/connection/lora/e220/Kconfig +++ b/APP_Framework/Framework/connection/lora/e220/Kconfig @@ -2,7 +2,7 @@ config ADAPTER_LORA_E220 string "E220-400T22S adapter name" default "e220" -if ADD_XIZI_FETURES +if ADD_XIZI_FEATURES config ADAPTER_E220_M0 int "E220 M0 pin number" default "11" @@ -35,7 +35,7 @@ if ADD_XIZI_FETURES endif endif -if ADD_NUTTX_FETURES +if ADD_NUTTX_FEATURES config ADAPTER_E220_M0_PATH string "E220 M0 pin device" @@ -66,7 +66,7 @@ if ADD_NUTTX_FETURES endif -if ADD_RTTHREAD_FETURES +if ADD_RTTHREAD_FEATURES config ADAPTER_E220_M0 int "E220 M0 pin number" default "11" diff --git a/APP_Framework/Framework/connection/lora/e220/Makefile b/APP_Framework/Framework/connection/lora/e220/Makefile index 71d5454a0..0b158cdf9 100644 --- a/APP_Framework/Framework/connection/lora/e220/Makefile +++ b/APP_Framework/Framework/connection/lora/e220/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += e220.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := e220.c include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/Framework/connection/lora/e220/e220.c b/APP_Framework/Framework/connection/lora/e220/e220.c index 201e9417f..9a6bbf3c6 100644 --- a/APP_Framework/Framework/connection/lora/e220/e220.c +++ b/APP_Framework/Framework/connection/lora/e220/e220.c @@ -21,7 +21,7 @@ #include #define E220_GATEWAY_ADDRESS 0xFFFF -#ifdef ADD_RTTHREAD_FETURES +#ifdef ADD_RTTHREAD_FEATURES #define E220_CHANNEL 0x02 #else #define E220_CHANNEL 0x05 @@ -35,7 +35,7 @@ #define E220_ADDRESS ADAPTER_LORA_NET_ROLE_ID #endif -#ifdef ADD_RTTHREAD_FETURES +#ifdef ADD_RTTHREAD_FEATURES #define E220_UART_BAUD_RATE 9600 #else #define E220_UART_BAUD_RATE 115200 @@ -54,7 +54,7 @@ enum E220LoraMode * @param mode Lora working mode * @return NULL */ -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES static void E220LoraModeConfig(enum E220LoraMode mode) { int m0_fd, m1_fd; @@ -338,7 +338,7 @@ static int E220GetRegisterParam(uint8 *buf) * @param adapter - Lora device pointer * @return success: 0, failure: -1 */ -#ifdef ADD_RTTHREAD_FETURES +#ifdef ADD_RTTHREAD_FEATURES static int E220Open(struct Adapter *adapter) { /*step1: open e220 uart port*/ @@ -614,7 +614,7 @@ static void LoraOpen(void) E220Open(adapter); } -#ifdef ADD_RTTHREAD_FETURES +#ifdef ADD_RTTHREAD_FEATURES MSH_CMD_EXPORT(LoraOpen,Lora open test sample); static void LoraRead(void *parameter) @@ -692,7 +692,7 @@ static void LoraRead(void *parameter) #endif -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES static void LoraTest(void) { int ret; @@ -727,7 +727,7 @@ static void LoraSend(int argc, char *argv[]) PRIV_SHELL_CMD_FUNCTION(LoraSend, a lora test send sample, PRIV_SHELL_CMD_MAIN_ATTR); #endif -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES void E220LoraReceive(void) { int ret; @@ -763,7 +763,7 @@ void E220LoraSend(int argc, char *argv[]) } #endif -#ifdef ADD_RTTHREAD_FETURES +#ifdef ADD_RTTHREAD_FEATURES static void LoraReadStart(void) { int ret; diff --git a/APP_Framework/Framework/connection/lora/sx1278/Kconfig b/APP_Framework/Framework/connection/lora/sx1278/Kconfig index 9b9cc2b48..b574497b6 100644 --- a/APP_Framework/Framework/connection/lora/sx1278/Kconfig +++ b/APP_Framework/Framework/connection/lora/sx1278/Kconfig @@ -2,20 +2,20 @@ config ADAPTER_LORA_SX1278 string "SX1278 adapter name" default "sx1278" -if ADD_XIZI_FETURES +if ADD_XIZI_FEATURES config ADAPTER_SX1278_DRIVER string "SX1278 device spi driver path" default "/dev/spi2_lora" endif -if ADD_NUTTX_FETURES +if ADD_NUTTX_FEATURES config ADAPTER_SX1278_DRIVER string "SX1278 device spi driver path" default "/dev/spi2_lora" endif -if ADD_RTTHREAD_FETURES +if ADD_RTTHREAD_FEATURES config ADAPTER_SX1278_DRIVER string "SX1278 device spi driver path" default "/dev/sx1278" diff --git a/APP_Framework/Framework/connection/lora/sx1278/Makefile b/APP_Framework/Framework/connection/lora/sx1278/Makefile index 636fa525d..2e4e0e10f 100644 --- a/APP_Framework/Framework/connection/lora/sx1278/Makefile +++ b/APP_Framework/Framework/connection/lora/sx1278/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += sx1278.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := sx1278.c include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/Framework/connection/lora/sx1278/sx1278.c b/APP_Framework/Framework/connection/lora/sx1278/sx1278.c index dda8b54e0..e8d92143c 100644 --- a/APP_Framework/Framework/connection/lora/sx1278/sx1278.c +++ b/APP_Framework/Framework/connection/lora/sx1278/sx1278.c @@ -20,7 +20,7 @@ #include -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES /** * @description: Sx127x_Nuttx_Write function for nuttx * @param fd - file descriptor to write to @@ -104,7 +104,7 @@ static int Sx1278Ioctl(struct Adapter *adapter, int cmd, void *args) * @param priv_net_group - priv_net_group params * @return success: 0, failure: -1 */ -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES static int Sx1278Join(struct Adapter *adapter, unsigned char *priv_net_group) { int ret; @@ -140,7 +140,7 @@ static int Sx1278Join(struct Adapter *adapter, unsigned char *priv_net_group) * @param len - data len * @return success: 0, failure: -1 */ -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES static int Sx1278Send(struct Adapter *adapter, const void *buf, size_t len) { int ret; @@ -170,7 +170,7 @@ static int Sx1278Send(struct Adapter *adapter, const void *buf, size_t len) * @param len - data len * @return success: 0, failure: -1 */ -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES static int Sx1278Recv(struct Adapter *adapter, void *buf, size_t len) { int ret; @@ -196,7 +196,7 @@ static int Sx1278Recv(struct Adapter *adapter, void *buf, size_t len) * @param priv_net_group - priv_net_group params * @return success: 0, failure: -1 */ -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES static int Sx1278Quit(struct Adapter *adapter, unsigned char *priv_net_group) { int ret; diff --git a/APP_Framework/Framework/connection/nbiot/bc28/Kconfig b/APP_Framework/Framework/connection/nbiot/bc28/Kconfig index 6897a6ae2..012901041 100644 --- a/APP_Framework/Framework/connection/nbiot/bc28/Kconfig +++ b/APP_Framework/Framework/connection/nbiot/bc28/Kconfig @@ -2,7 +2,7 @@ config ADAPTER_NBIOT_BC28 string "BC28 adapter name" default "bc28" -if ADD_XIZI_FETURES +if ADD_XIZI_FEATURES config ADAPTER_BC28_RESETPIN int "BC28 RESET pin number" default "100" @@ -31,11 +31,11 @@ if ADD_XIZI_FETURES endif endif -if ADD_NUTTX_FETURES +if ADD_NUTTX_FEATURES endif -if ADD_RTTHREAD_FETURES +if ADD_RTTHREAD_FEATURES config ADAPTER_BC28_DRIVER string "BC28 device uart driver path" default "/dev/uart2" diff --git a/APP_Framework/Framework/connection/wifi/Makefile b/APP_Framework/Framework/connection/wifi/Makefile index 5e466adc5..c7cb23eae 100644 --- a/APP_Framework/Framework/connection/wifi/Makefile +++ b/APP_Framework/Framework/connection/wifi/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += adapter_wifi.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := adapter_wifi.c ifeq ($(CONFIG_ADAPTER_HFA21_WIFI),y) diff --git a/APP_Framework/Framework/connection/wifi/adapter_wifi.c b/APP_Framework/Framework/connection/wifi/adapter_wifi.c index 6c40f7413..ebea01232 100644 --- a/APP_Framework/Framework/connection/wifi/adapter_wifi.c +++ b/APP_Framework/Framework/connection/wifi/adapter_wifi.c @@ -297,7 +297,7 @@ int WifiRecv(int argc, char *argv[]) } PRIV_SHELL_CMD_FUNCTION(WifiRecv, a WiFi receive sample, PRIV_SHELL_CMD_MAIN_ATTR); -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES enum { diff --git a/APP_Framework/Framework/connection/wifi/esp07s_wifi/Kconfig b/APP_Framework/Framework/connection/wifi/esp07s_wifi/Kconfig index 15fdda3f5..848026276 100755 --- a/APP_Framework/Framework/connection/wifi/esp07s_wifi/Kconfig +++ b/APP_Framework/Framework/connection/wifi/esp07s_wifi/Kconfig @@ -2,7 +2,7 @@ config ADAPTER_WIFI_ESP07S string "ESP07S WIFI adapter name" default "esp07s_wifi" -if ADD_XIZI_FETURES +if ADD_XIZI_FEATURES config ADAPTER_ESP07S_DRIVER_EXTUART bool "Using extra uart to support wifi" @@ -24,7 +24,7 @@ if ADD_XIZI_FETURES endif endif -if ADD_NUTTX_FETURES +if ADD_NUTTX_FEATURES config ADAPTER_ESP07S_DRIVER_EXTUART bool "Using extra uart to support wifi" default n @@ -45,8 +45,8 @@ if ADD_NUTTX_FETURES endif endif -if ADD_RTTHREAD_FETURES - if ADD_RTTHREAD_FETURES +if ADD_RTTHREAD_FEATURES + if ADD_RTTHREAD_FEATURES config ADAPTER_ESP07S_DRIVER_EXTUART bool "Using extra uart to support wifi" default n diff --git a/APP_Framework/Framework/connection/wifi/esp07s_wifi/Makefile b/APP_Framework/Framework/connection/wifi/esp07s_wifi/Makefile index 53493604e..2a2819d4d 100755 --- a/APP_Framework/Framework/connection/wifi/esp07s_wifi/Makefile +++ b/APP_Framework/Framework/connection/wifi/esp07s_wifi/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += esp07s_wifi.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := esp07s_wifi.c include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/Framework/connection/wifi/esp8285_wifi/Kconfig b/APP_Framework/Framework/connection/wifi/esp8285_wifi/Kconfig index 6fea4cc6f..bd83eb4cc 100644 --- a/APP_Framework/Framework/connection/wifi/esp8285_wifi/Kconfig +++ b/APP_Framework/Framework/connection/wifi/esp8285_wifi/Kconfig @@ -2,13 +2,13 @@ config ADAPTER_WIFI_ESP8285 string "ESP8285 WIFI adapter name" default "esp8285_wifi" -if ADD_NUTTX_FETURES +if ADD_NUTTX_FEATURES config ADAPTER_ESP8285_DRIVER string "ESP8285 device uart driver path" default "/dev/ttyS1" endif -if ADD_XIZI_FETURES +if ADD_XIZI_FEATURES config ADAPTER_ESP8285_DRIVER string "ESP8285 device uart driver path" default "/dev/uart1_dev1" diff --git a/APP_Framework/Framework/connection/wifi/esp8285_wifi/Makefile b/APP_Framework/Framework/connection/wifi/esp8285_wifi/Makefile index 0431e2732..6b9fc3626 100644 --- a/APP_Framework/Framework/connection/wifi/esp8285_wifi/Makefile +++ b/APP_Framework/Framework/connection/wifi/esp8285_wifi/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += esp8285_wifi.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := esp8285_wifi.c include $(KERNEL_ROOT)/compiler.mk endif \ No newline at end of file diff --git a/APP_Framework/Framework/connection/wifi/hfa21_wifi/Kconfig b/APP_Framework/Framework/connection/wifi/hfa21_wifi/Kconfig index cc248bd79..fe0dc74bd 100755 --- a/APP_Framework/Framework/connection/wifi/hfa21_wifi/Kconfig +++ b/APP_Framework/Framework/connection/wifi/hfa21_wifi/Kconfig @@ -2,7 +2,7 @@ config ADAPTER_WIFI_HFA21 string "HFA21 WIFI adapter name" default "hfa21_wifi" -if ADD_XIZI_FETURES +if ADD_XIZI_FEATURES config ADAPTER_HFA21_DRIVER_EXTUART bool "Using extra uart to support wifi" @@ -24,11 +24,11 @@ if ADD_XIZI_FETURES endif endif -if ADD_NUTTX_FETURES +if ADD_NUTTX_FEATURES endif -if ADD_RTTHREAD_FETURES +if ADD_RTTHREAD_FEATURES config ADAPTER_HFA21_DRIVER string "HFA21 device uart driver path" default "/dev/uart3" diff --git a/APP_Framework/Framework/connection/zigbee/Makefile b/APP_Framework/Framework/connection/zigbee/Makefile index cfd9f20c0..d4c2485bf 100644 --- a/APP_Framework/Framework/connection/zigbee/Makefile +++ b/APP_Framework/Framework/connection/zigbee/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += adapter_zigbee.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := adapter_zigbee.c ifeq ($(CONFIG_ADAPTER_E18),y) diff --git a/APP_Framework/Framework/connection/zigbee/e18/Kconfig b/APP_Framework/Framework/connection/zigbee/e18/Kconfig index 0551d4cbf..2b1efac9d 100644 --- a/APP_Framework/Framework/connection/zigbee/e18/Kconfig +++ b/APP_Framework/Framework/connection/zigbee/e18/Kconfig @@ -17,7 +17,7 @@ choice endchoice -if ADD_XIZI_FETURES +if ADD_XIZI_FEATURES config ADAPTER_E18_MODEPIN int "E18 MODE pin number" default "61" @@ -46,7 +46,7 @@ if ADD_XIZI_FETURES endif endif -if ADD_NUTTX_FETURES +if ADD_NUTTX_FEATURES if ARCH_BOARD_XIDATONG_ARM32 config ADAPTER_E18_MODEPIN int "E18 MODE pin number" @@ -84,6 +84,6 @@ endif endif -if ADD_RTTHREAD_FETURES +if ADD_RTTHREAD_FEATURES endif diff --git a/APP_Framework/Framework/connection/zigbee/e18/Makefile b/APP_Framework/Framework/connection/zigbee/e18/Makefile index 1ac35b43f..6f2e1d871 100644 --- a/APP_Framework/Framework/connection/zigbee/e18/Makefile +++ b/APP_Framework/Framework/connection/zigbee/e18/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += e18.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := e18.c include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/Framework/connection/zigbee/e18/e18.c b/APP_Framework/Framework/connection/zigbee/e18/e18.c index b07a4c3ea..4ebc8aed9 100644 --- a/APP_Framework/Framework/connection/zigbee/e18/e18.c +++ b/APP_Framework/Framework/connection/zigbee/e18/e18.c @@ -43,7 +43,7 @@ char *cmd_set_ch = "AT+CH=11"; /*set channel as 11*/ static int E18HardwareModeGet() { -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES #ifdef CONFIG_ARCH_BOARD_XIDATONG_ARM32 int ret = 0; int pin_fd; @@ -96,7 +96,7 @@ static int E18HardwareModeGet() static int E18HardwareModeSet(void) { -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES #ifdef CONFIG_ARCH_BOARD_XIDATONG_ARM32 int ret = 0; int pin_fd; @@ -227,7 +227,7 @@ static int E18NetworkModeConfig(struct Adapter *adapter) } out: -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES if(E18_AS_HEX_MODE == mode) #else if(E18_AS_AT_MODE == mode) @@ -302,7 +302,7 @@ static int E18NetRoleConfig(struct Adapter *adapter) } out: -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES if(E18_AS_HEX_MODE == mode) #else if(E18_AS_AT_MODE == mode) @@ -449,7 +449,7 @@ static int E18Join(struct Adapter *adapter, unsigned char *priv_net_group) // } if(!ret){ -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES if(E18_AS_HEX_MODE == mode) #else if(E18_AS_AT_MODE == mode) diff --git a/APP_Framework/Framework/control/ipc_protocol/modbus_uart/Kconfig b/APP_Framework/Framework/control/ipc_protocol/modbus_uart/Kconfig index bc6a0cae9..6729481c1 100755 --- a/APP_Framework/Framework/control/ipc_protocol/modbus_uart/Kconfig +++ b/APP_Framework/Framework/control/ipc_protocol/modbus_uart/Kconfig @@ -1,4 +1,4 @@ -if ADD_XIZI_FETURES +if ADD_XIZI_FEATURES config CONTROL_FRAMEWORK_UART_485_DIR int "control framework 485 direction pin number" default "2" @@ -27,11 +27,11 @@ if ADD_XIZI_FETURES endif endif -if ADD_NUTTX_FETURES +if ADD_NUTTX_FEATURES endif -if ADD_RTTHREAD_FETURES +if ADD_RTTHREAD_FEATURES endif diff --git a/APP_Framework/Framework/control/plc_protocol/melsec/Kconfig b/APP_Framework/Framework/control/plc_protocol/melsec/Kconfig index c441642b9..e26812739 100755 --- a/APP_Framework/Framework/control/plc_protocol/melsec/Kconfig +++ b/APP_Framework/Framework/control/plc_protocol/melsec/Kconfig @@ -24,7 +24,7 @@ choice endchoice if CONTROL_USING_SERIAL_485 - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config CONTROL_FRAMEWORK_UART_485_DIR int "control framework 485 direction pin number" default "2" @@ -53,11 +53,11 @@ if CONTROL_USING_SERIAL_485 endif endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES endif diff --git a/APP_Framework/Framework/knowing/kpu/k210_yolov2_detect_procedure/k210_yolov2_detect.c b/APP_Framework/Framework/knowing/kpu/k210_yolov2_detect_procedure/k210_yolov2_detect.c index aea9b553f..f3b52157e 100644 --- a/APP_Framework/Framework/knowing/kpu/k210_yolov2_detect_procedure/k210_yolov2_detect.c +++ b/APP_Framework/Framework/knowing/kpu/k210_yolov2_detect_procedure/k210_yolov2_detect.c @@ -48,7 +48,7 @@ void k210_detect(char *json_file_path) return; } -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES kpu_fd = PrivOpen(KPU_DEV_DRIVER, O_RDONLY); if (camera_fd < 0) { @@ -154,7 +154,7 @@ void k210_detect(char *json_file_path) } } -#ifdef ADD_RTTHREAD_FETURES +#ifdef ADD_RTTHREAD_FEATURES dvp_set_ai_addr( (uintptr_t)(kpurgbbuffer + detect_params.net_input_size[1] * (detect_params.net_input_size[0] - detect_params.sensor_output_size[0])), @@ -175,7 +175,7 @@ void k210_detect(char *json_file_path) #endif // Load kmodel into kpu task -#ifdef ADD_RTTHREAD_FETURES +#ifdef ADD_RTTHREAD_FEATURES if (kpu_load_kmodel(&detect_task, model_data_align) != 0) { printf("\nmodel init error\n"); @@ -287,7 +287,7 @@ static void *thread_detect_entry(void *parameter) while (shoot_flag == 2) PrivIoctl(camera_fd, FLAG_CHECK, &camera_cfg); -#ifdef ADD_RTTHREAD_FETURES +#ifdef ADD_RTTHREAD_FEATURES if (dmalock_sync_take(&dma_ch, 2000)) { printf("Fail to take DMA channel"); @@ -296,7 +296,7 @@ static void *thread_detect_entry(void *parameter) while (!g_ai_done_flag) ; dmalock_release(dma_ch); -#elif defined ADD_XIZI_FETURES +#elif defined ADD_XIZI_FEATURES struct PrivIoctlCfg kpu_cfg; kpu_cfg.args = kpurgbbuffer; kpu_cfg.ioctl_driver_type = KPU_TYPE; @@ -309,7 +309,7 @@ static void *thread_detect_entry(void *parameter) } #endif -#ifdef ADD_RTTHREAD_FETURES +#ifdef ADD_RTTHREAD_FEATURES float *output; size_t output_size; kpu_get_output(&detect_task, 0, (uint8_t **)&output, &output_size); @@ -335,7 +335,7 @@ static void *thread_detect_entry(void *parameter) } #ifdef BSP_USING_LCD -#ifdef ADD_RTTHREAD_FETURES +#ifdef ADD_RTTHREAD_FEATURES extern void lcd_draw_picture(uint16_t x1, uint16_t y1, uint16_t width, uint16_t height, uint32_t * ptr); lcd_draw_picture(0, 0, (uint16_t)detect_params.sensor_output_size[1] - 1, (uint16_t)detect_params.sensor_output_size[0] - 1, (uint32_t *)showbuffer); diff --git a/APP_Framework/Framework/sensor/Makefile b/APP_Framework/Framework/sensor/Makefile index 2ac3900a9..ea1294107 100644 --- a/APP_Framework/Framework/sensor/Makefile +++ b/APP_Framework/Framework/sensor/Makefile @@ -1,18 +1,18 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += sensor.c include $(APPDIR)/Application.mk endif -ifeq ($(ADD_XIZI_FETURES),y) +ifeq ($(ADD_XIZI_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += sensor.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := sensor.c ifeq ($(CONFIG_SENSOR_HCHO),y) diff --git a/APP_Framework/Framework/sensor/altitude/Kconfig b/APP_Framework/Framework/sensor/altitude/Kconfig index afbbef1f7..7e9b13aad 100644 --- a/APP_Framework/Framework/sensor/altitude/Kconfig +++ b/APP_Framework/Framework/sensor/altitude/Kconfig @@ -12,7 +12,7 @@ config SENSOR_BMP180 string "BMP180 quantity name" default "altitude_1" - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_DEVICE_BMP180_DEV string "BMP180 device name" default "/dev/i2c1_dev0" @@ -22,11 +22,11 @@ config SENSOR_BMP180 default 0x77 endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES endif endif diff --git a/APP_Framework/Framework/sensor/ch4/Kconfig b/APP_Framework/Framework/sensor/ch4/Kconfig index 63011de1d..9bc386da7 100644 --- a/APP_Framework/Framework/sensor/ch4/Kconfig +++ b/APP_Framework/Framework/sensor/ch4/Kconfig @@ -12,7 +12,7 @@ config SENSOR_AS830 string "as830 quantity name" default "ch4_1" - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_AS830_DRIVER_EXTUART bool "Using extra uart to support as830" default y @@ -33,7 +33,7 @@ config SENSOR_AS830 endif endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES config SENSOR_DEVICE_AS830_DEV string "as830 device uart path" default "/dev/ttyS1" @@ -42,7 +42,7 @@ config SENSOR_AS830 endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES config SENSOR_AS830_DRIVER_EXTUART bool "Using extra uart to support as830" default y diff --git a/APP_Framework/Framework/sensor/ch4/as830/Makefile b/APP_Framework/Framework/sensor/ch4/as830/Makefile index 5d661e31b..a8c591811 100644 --- a/APP_Framework/Framework/sensor/ch4/as830/Makefile +++ b/APP_Framework/Framework/sensor/ch4/as830/Makefile @@ -1,11 +1,11 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += as830.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := as830.c include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/Framework/sensor/co2/Kconfig b/APP_Framework/Framework/sensor/co2/Kconfig index 78a965e8d..8ae2dcf68 100644 --- a/APP_Framework/Framework/sensor/co2/Kconfig +++ b/APP_Framework/Framework/sensor/co2/Kconfig @@ -12,7 +12,7 @@ config SENSOR_ZG09 string "zg09 quantity name" default "co2_1" - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_ZG09_DRIVER_EXTUART bool "Using extra uart to support zg09" default y @@ -33,7 +33,7 @@ config SENSOR_ZG09 endif endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES config SENSOR_DEVICE_ZG09_DEV string "CO2 device name" default "/dev/ttyS1" @@ -42,7 +42,7 @@ config SENSOR_ZG09 endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES config SENSOR_ZG09_DRIVER_EXTUART bool "Using extra uart to support zg09" default y @@ -78,7 +78,7 @@ config SENSOR_G8S string "g8-s quantity name" default "co2_2" - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_G8S_DRIVER_EXTUART bool "Using extra uart to support g8-s" default n @@ -99,7 +99,7 @@ config SENSOR_G8S endif endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES config SENSOR_DEVICE_G8S_DEV string "CO2 device name" default "/dev/ttyS3" @@ -107,7 +107,7 @@ config SENSOR_G8S If USART1 is selected, then fill in /dev/ttyS1 here. endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES endif endif diff --git a/APP_Framework/Framework/sensor/co2/g8s/Makefile b/APP_Framework/Framework/sensor/co2/g8s/Makefile index e4b77f31a..293a243fb 100644 --- a/APP_Framework/Framework/sensor/co2/g8s/Makefile +++ b/APP_Framework/Framework/sensor/co2/g8s/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += g8s.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := g8s.c include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/Framework/sensor/co2/zg09/Makefile b/APP_Framework/Framework/sensor/co2/zg09/Makefile index 1a3e79d52..8ff1c1d27 100644 --- a/APP_Framework/Framework/sensor/co2/zg09/Makefile +++ b/APP_Framework/Framework/sensor/co2/zg09/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += zg09.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := zg09.c include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/Framework/sensor/hcho/Kconfig b/APP_Framework/Framework/sensor/hcho/Kconfig index cd87003b6..aad01deb1 100644 --- a/APP_Framework/Framework/sensor/hcho/Kconfig +++ b/APP_Framework/Framework/sensor/hcho/Kconfig @@ -12,7 +12,7 @@ config SENSOR_TB600B_WQ_HCHO1OS string "tb600b wq_hcho1os quantity name" default "hcho_1" - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_TB600B_WQ_HCHO1OS_DRIVER_EXTUART bool "Using extra uart to support tb600b wq_hcho1os" default y @@ -33,7 +33,7 @@ config SENSOR_TB600B_WQ_HCHO1OS endif endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES config SENSOR_DEVICE_TB600B_WQ_HCHO1OS_DEV string "tb600b wq_hcho1os device uart path" default "/dev/ttyS1" @@ -42,7 +42,7 @@ config SENSOR_TB600B_WQ_HCHO1OS endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES config SENSOR_TB600B_WQ_HCHO1OS_DRIVER_EXTUART bool "Using extra uart to support tb600b wq_hcho1os" default y diff --git a/APP_Framework/Framework/sensor/hcho/tb600b_wq_hcho1os/Makefile b/APP_Framework/Framework/sensor/hcho/tb600b_wq_hcho1os/Makefile index 9e7dd4863..3049e5223 100644 --- a/APP_Framework/Framework/sensor/hcho/tb600b_wq_hcho1os/Makefile +++ b/APP_Framework/Framework/sensor/hcho/tb600b_wq_hcho1os/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += tb600b_wq_hcho1os.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := tb600b_wq_hcho1os.c include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/Framework/sensor/humidity/Kconfig b/APP_Framework/Framework/sensor/humidity/Kconfig index a38a74125..8909f03e3 100644 --- a/APP_Framework/Framework/sensor/humidity/Kconfig +++ b/APP_Framework/Framework/sensor/humidity/Kconfig @@ -12,7 +12,7 @@ config SENSOR_HS300X_HUMIDITY string "HS300x quantity name" default "humidity_1" - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_DEVICE_HS300X_DEV string "HS300x device name" default "/dev/i2c1_dev0" @@ -23,7 +23,7 @@ config SENSOR_HS300X_HUMIDITY endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES config SENSOR_DEVICE_HS300X_DEV string "HS300x device name" default "/dev/i2c1_dev0" @@ -34,7 +34,7 @@ config SENSOR_HS300X_HUMIDITY endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES config SENSOR_DEVICE_HS300X_DEV string "HS300x device name" default "/dev/i2c1" diff --git a/APP_Framework/Framework/sensor/humidity/hs300x_humi/Makefile b/APP_Framework/Framework/sensor/humidity/hs300x_humi/Makefile index 58f85b1ef..0dc12429d 100644 --- a/APP_Framework/Framework/sensor/humidity/hs300x_humi/Makefile +++ b/APP_Framework/Framework/sensor/humidity/hs300x_humi/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += hs300x_humi.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := hs300x_humi.c include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/Framework/sensor/iaq/Kconfig b/APP_Framework/Framework/sensor/iaq/Kconfig index 6b52c1db1..209911950 100644 --- a/APP_Framework/Framework/sensor/iaq/Kconfig +++ b/APP_Framework/Framework/sensor/iaq/Kconfig @@ -12,7 +12,7 @@ config SENSOR_TB600B_IAQ10 string "tb600b iaq10 quantity name" default "iaq_1" - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_TB600B_IAQ10_DRIVER_EXTUART bool "Using extra uart to support tb600b iaq10" default y @@ -33,7 +33,7 @@ config SENSOR_TB600B_IAQ10 endif endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES config SENSOR_DEVICE_TB600B_IAQ10_DEV string "tb600b iaq10 device uart path" default "/dev/ttyS1" @@ -42,7 +42,7 @@ config SENSOR_TB600B_IAQ10 endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES endif endif diff --git a/APP_Framework/Framework/sensor/iaq/tb600b_iaq10/Makefile b/APP_Framework/Framework/sensor/iaq/tb600b_iaq10/Makefile index 39da6a6bb..600f7e2fc 100644 --- a/APP_Framework/Framework/sensor/iaq/tb600b_iaq10/Makefile +++ b/APP_Framework/Framework/sensor/iaq/tb600b_iaq10/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += tb600b_iaq10.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := tb600b_iaq10.c include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/Framework/sensor/pm/Kconfig b/APP_Framework/Framework/sensor/pm/Kconfig index 5c9d7069c..328f06455 100644 --- a/APP_Framework/Framework/sensor/pm/Kconfig +++ b/APP_Framework/Framework/sensor/pm/Kconfig @@ -38,7 +38,7 @@ config SENSOR_PS5308 default "pm10_1" endif - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_PS5308_DRIVER_EXTUART bool "Using extra uart to support PS5308" default y @@ -59,7 +59,7 @@ config SENSOR_PS5308 endif endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES config SENSOR_DEVICE_PS5308_DEV string "PS5308 device name" default "/dev/ttyS1" @@ -68,7 +68,7 @@ config SENSOR_PS5308 endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES endif endif diff --git a/APP_Framework/Framework/sensor/pm/ps5308/Makefile b/APP_Framework/Framework/sensor/pm/ps5308/Makefile index 960968dd2..96ae6cc99 100644 --- a/APP_Framework/Framework/sensor/pm/ps5308/Makefile +++ b/APP_Framework/Framework/sensor/pm/ps5308/Makefile @@ -1,11 +1,11 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += ps5308.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := ps5308.c include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/Framework/sensor/temperature/Kconfig b/APP_Framework/Framework/sensor/temperature/Kconfig index aa170103b..64584f8bf 100644 --- a/APP_Framework/Framework/sensor/temperature/Kconfig +++ b/APP_Framework/Framework/sensor/temperature/Kconfig @@ -12,7 +12,7 @@ config SENSOR_HS300X_TEMPERATURE string "HS300x quantity name" default "temperature_1" - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_DEVICE_HS300X_DEV string "HS300x device name" default "/dev/i2c1_dev0" @@ -22,7 +22,7 @@ config SENSOR_HS300X_TEMPERATURE default 0x44 endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES config SENSOR_DEVICE_HS300X_DEV string "HS300x device name" default "/dev/i2c1_dev0" @@ -33,7 +33,7 @@ config SENSOR_HS300X_TEMPERATURE endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES config SENSOR_DEVICE_HS300X_DEV string "HS300x device name" default "/dev/i2c1" diff --git a/APP_Framework/Framework/sensor/temperature/hs300x_temp/Makefile b/APP_Framework/Framework/sensor/temperature/hs300x_temp/Makefile index 047981e4b..dc0382316 100644 --- a/APP_Framework/Framework/sensor/temperature/hs300x_temp/Makefile +++ b/APP_Framework/Framework/sensor/temperature/hs300x_temp/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += hs300x_temp.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := hs300x_temp.c include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/Framework/sensor/tvoc/Kconfig b/APP_Framework/Framework/sensor/tvoc/Kconfig index b667e4801..60d062363 100644 --- a/APP_Framework/Framework/sensor/tvoc/Kconfig +++ b/APP_Framework/Framework/sensor/tvoc/Kconfig @@ -12,7 +12,7 @@ config SENSOR_TB600B_TVOC10 string "tb600b tvoc10 quantity name" default "tvoc_1" - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_TB600B_TVOC10_DRIVER_EXTUART bool "Using extra uart to support tb600b tvoc10" default y @@ -33,7 +33,7 @@ config SENSOR_TB600B_TVOC10 endif endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES config SENSOR_DEVICE_TB600B_TVOC10_DEV string "tb600b tvoc10 device uart path" default "/dev/ttyS1" @@ -42,7 +42,7 @@ config SENSOR_TB600B_TVOC10 endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES endif endif diff --git a/APP_Framework/Framework/sensor/tvoc/tb600b_tvoc10/Makefile b/APP_Framework/Framework/sensor/tvoc/tb600b_tvoc10/Makefile index 7fb2cadbd..b5467d0ad 100644 --- a/APP_Framework/Framework/sensor/tvoc/tb600b_tvoc10/Makefile +++ b/APP_Framework/Framework/sensor/tvoc/tb600b_tvoc10/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += tb600b_tvoc10.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := tb600b_tvoc10.c include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/Framework/sensor/voice/Kconfig b/APP_Framework/Framework/sensor/voice/Kconfig index 87a8c213f..e2b56743e 100644 --- a/APP_Framework/Framework/sensor/voice/Kconfig +++ b/APP_Framework/Framework/sensor/voice/Kconfig @@ -12,7 +12,7 @@ config SENSOR_D124 string "D124 quantity voice name" default "voice_1" - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_D124_DRIVER_EXTUART bool "Using extra uart to support D124" default y @@ -33,7 +33,7 @@ config SENSOR_D124 endif endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES config SENSOR_DEVICE_D124_DEV string "D124 device name" default "/dev/ttyS1" @@ -42,7 +42,7 @@ config SENSOR_D124 endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES config SENSOR_D124_DRIVER_EXTUART bool "Using extra uart to support D124" default y diff --git a/APP_Framework/Framework/sensor/voice/d124/Makefile b/APP_Framework/Framework/sensor/voice/d124/Makefile index 18f5d991a..7686ec3ec 100644 --- a/APP_Framework/Framework/sensor/voice/d124/Makefile +++ b/APP_Framework/Framework/sensor/voice/d124/Makefile @@ -1,12 +1,12 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += d124.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := d124.c include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/Framework/sensor/voice/d124/d124.c b/APP_Framework/Framework/sensor/voice/d124/d124.c index 1e204806d..232680c21 100644 --- a/APP_Framework/Framework/sensor/voice/d124/d124.c +++ b/APP_Framework/Framework/sensor/voice/d124/d124.c @@ -51,7 +51,7 @@ static void *ReadTask(void *parameter) * @param sdev - sensor device pointer * @return success: 1 , failure: other */ -#ifdef ADD_NUTTX_FETURES +#ifdef ADD_NUTTX_FEATURES static int SensorDeviceOpen(struct SensorDevice *sdev) { int result = 0; diff --git a/APP_Framework/Framework/sensor/winddirection/Kconfig b/APP_Framework/Framework/sensor/winddirection/Kconfig index 7fdbd7bd4..11c59f174 100644 --- a/APP_Framework/Framework/sensor/winddirection/Kconfig +++ b/APP_Framework/Framework/sensor/winddirection/Kconfig @@ -12,7 +12,7 @@ config SENSOR_QS_FX string "qs-fx quantity name" default "winddirection_1" - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_QS_FX_DRIVER_EXTUART bool "Using extra uart to support qs-fx" default y @@ -41,7 +41,7 @@ config SENSOR_QS_FX endif endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES config SENSOR_DEVICE_QS_FX_DEV string "qs-fx device name" default "/dev/ttyS1" @@ -50,7 +50,7 @@ config SENSOR_QS_FX endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES endif endif diff --git a/APP_Framework/Framework/sensor/winddirection/qs-fx/Makefile b/APP_Framework/Framework/sensor/winddirection/qs-fx/Makefile index e45522588..ff3f83ad6 100644 --- a/APP_Framework/Framework/sensor/winddirection/qs-fx/Makefile +++ b/APP_Framework/Framework/sensor/winddirection/qs-fx/Makefile @@ -1,11 +1,11 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += qs-fx.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := qs-fx.c include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/Framework/sensor/winddirection/qs-fx/qs-fx.c b/APP_Framework/Framework/sensor/winddirection/qs-fx/qs-fx.c index 3a9e1eed5..d26c44e80 100644 --- a/APP_Framework/Framework/sensor/winddirection/qs-fx/qs-fx.c +++ b/APP_Framework/Framework/sensor/winddirection/qs-fx/qs-fx.c @@ -69,7 +69,7 @@ static int SensorDeviceOpen(struct SensorDevice *sdev) return result; } -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES static int PinOpen(void){ int pin_fd = PrivOpen(SENSOR_DEVICE_QS_FX_PIN_DEV, O_RDWR); if (pin_fd < 0) { @@ -106,7 +106,7 @@ static int PinOpen(void){ */ static int SensorDeviceRead(struct SensorDevice *sdev, size_t len) { -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES int pin_fd=PinOpen(); struct PinStat pin_dir; pin_dir.pin = SENSOR_DEVICE_QS_FX_PIN_NUMBER; @@ -120,7 +120,7 @@ static int SensorDeviceRead(struct SensorDevice *sdev, size_t len) return -1; PrivTaskDelay(20); -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES pin_dir.val = GPIO_LOW; if (PrivWrite(pin_fd,&pin_dir,0) < 0) // pull-down pin to configure as rx mode return -1; diff --git a/APP_Framework/Framework/sensor/windspeed/Kconfig b/APP_Framework/Framework/sensor/windspeed/Kconfig index 96dfabf27..a8247f5e2 100644 --- a/APP_Framework/Framework/sensor/windspeed/Kconfig +++ b/APP_Framework/Framework/sensor/windspeed/Kconfig @@ -12,7 +12,7 @@ config SENSOR_QS_FS string "qs-fs quantity name" default "windspeed_1" - if ADD_XIZI_FETURES + if ADD_XIZI_FEATURES config SENSOR_QS_FS_DRIVER_EXTUART bool "Using extra uart to support qs-fx" default y @@ -41,7 +41,7 @@ config SENSOR_QS_FS endif endif - if ADD_NUTTX_FETURES + if ADD_NUTTX_FEATURES config SENSOR_DEVICE_QS_FS_DEV string "qs-fx device name" default "/dev/ttyS1" @@ -50,7 +50,7 @@ config SENSOR_QS_FS endif - if ADD_RTTHREAD_FETURES + if ADD_RTTHREAD_FEATURES endif endif diff --git a/APP_Framework/Framework/sensor/windspeed/qs-fs/Makefile b/APP_Framework/Framework/sensor/windspeed/qs-fs/Makefile index a6872570e..479e73cc5 100644 --- a/APP_Framework/Framework/sensor/windspeed/qs-fs/Makefile +++ b/APP_Framework/Framework/sensor/windspeed/qs-fs/Makefile @@ -1,11 +1,11 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs CSRCS += qs-fs.c include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_FILES := qs-fs.c include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/Framework/sensor/windspeed/qs-fs/qs-fs.c b/APP_Framework/Framework/sensor/windspeed/qs-fs/qs-fs.c index 151e70c91..ff8651fcb 100644 --- a/APP_Framework/Framework/sensor/windspeed/qs-fs/qs-fs.c +++ b/APP_Framework/Framework/sensor/windspeed/qs-fs/qs-fs.c @@ -68,7 +68,7 @@ static int SensorDeviceOpen(struct SensorDevice *sdev) return result; } -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES static int PinOpen(void){ int pin_fd = PrivOpen(SENSOR_DEVICE_QS_FS_PIN_DEV, O_RDWR); if (pin_fd < 0) { @@ -106,7 +106,7 @@ static int PinOpen(void){ */ static int SensorDeviceRead(struct SensorDevice *sdev, size_t len) { -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES int pin_fd=PinOpen(); struct PinStat pin_dir; pin_dir.pin = SENSOR_DEVICE_QS_FS_PIN_NUMBER; @@ -121,7 +121,7 @@ static int SensorDeviceRead(struct SensorDevice *sdev, size_t len) return -1; PrivTaskDelay(20); -#ifdef ADD_XIZI_FETURES +#ifdef ADD_XIZI_FEATURES pin_dir.val = GPIO_LOW; if (PrivWrite(pin_fd,&pin_dir,0) < 0) // pull-down pin to configure as rx mode return -1; diff --git a/APP_Framework/Framework/transform_layer/Makefile b/APP_Framework/Framework/transform_layer/Makefile index 6a6d096f8..46204ebe2 100644 --- a/APP_Framework/Framework/transform_layer/Makefile +++ b/APP_Framework/Framework/transform_layer/Makefile @@ -1,6 +1,6 @@ SRC_DIR := -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_DIR += xizi endif diff --git a/APP_Framework/Makefile b/APP_Framework/Makefile index 3a832911b..2b9d30849 100644 --- a/APP_Framework/Makefile +++ b/APP_Framework/Makefile @@ -1,10 +1,10 @@ include $(KERNEL_ROOT)/.config -ifeq ($(CONFIG_ADD_NUTTX_FETURES),y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES),y) include $(APPDIR)/Make.defs include $(APPDIR)/Application.mk endif -ifeq ($(CONFIG_ADD_XIZI_FETURES),y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES),y) SRC_DIR := Applications Framework lib include $(KERNEL_ROOT)/compiler.mk endif diff --git a/APP_Framework/lib/lorawan/Kconfig b/APP_Framework/lib/lorawan/Kconfig index ec6f54332..be88cbf5d 100644 --- a/APP_Framework/lib/lorawan/Kconfig +++ b/APP_Framework/lib/lorawan/Kconfig @@ -5,6 +5,18 @@ menuconfig LIB_USING_LORAWAN default n if LIB_USING_LORAWAN + menuconfig LIB_USING_LORAWAN_GATEWAY_SC + help + Please add "source "$APP_DIR/lib/lorawan/lorawan_gateway_single_channel/Kconfig"" when using lorawan_gateway_single_channel + bool "LoRaWan using lorawan_gateway for single channel(SX126x/SX127x) lib" + default n + select LIB_USING_LORA_RADIO + select BSP_USING_LWIP + + if LIB_USING_LORAWAN_GATEWAY_SC + + endif + menuconfig LIB_USING_LORAWAN_ED_STACK help Please add "source "$APP_DIR/lib/lorawan/lorawan_devicenode/Kconfig"" when using lorawan_devicenode @@ -21,6 +33,7 @@ menuconfig LIB_USING_LORAWAN Please add "source "$APP_DIR/lib/lorawan/lora_radio_driver/Kconfig"" when using lora_radio_driver bool "LoRaWan using lora-radio-driver lib" default n + select BSP_USING_SPI if LIB_USING_LORA_RADIO diff --git a/APP_Framework/lib/lorawan/Makefile b/APP_Framework/lib/lorawan/Makefile index dd6c0721f..98b176f19 100644 --- a/APP_Framework/lib/lorawan/Makefile +++ b/APP_Framework/lib/lorawan/Makefile @@ -8,4 +8,8 @@ ifeq ($(CONFIG_LIB_USING_LORAWAN_ED_STACK),y) SRC_DIR += lorawan_devicenode endif +ifeq ($(CONFIG_LIB_USING_LORAWAN_GATEWAY_SC),y) + SRC_DIR += lorawan_gateway_single_channel +endif + include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/lib/lorawan/README.md b/APP_Framework/lib/lorawan/README.md index 7fb6c76e2..bff82e90b 100644 --- a/APP_Framework/lib/lorawan/README.md +++ b/APP_Framework/lib/lorawan/README.md @@ -1,16 +1,17 @@ # lorawan子模块调试说明 -矽璓工业物联操作系统XiUOS目前支持lorawan相关开源库,通过子模块形式管理,该目录主要内容是包含**lora_radio_driver**、**lorawan_devicenode**等。 +矽璓工业物联操作系统XiUOS目前支持lorawan相关开源库,通过子模块形式管理,该目录主要内容是包含**lora_radio_driver**、**lorawan_devicenode**、**lorawan_gateway_single_channel**等。 ## 目录内容 ``` xiuos/APP_Framework/lib/lorawan ├── README.md - ├── lora_radio_driver lora_radio驱动库 - ├── lorawan_devicenode lorawan节点协议栈 - ├── Kconfig lorawan Kconfig配置 - └── Makefile lorawan Makefile + ├── lora_radio_driver lora_radio驱动库 + ├── lorawan_devicenode lorawan节点协议栈 + ├── lorawan_gateway_single_channel lorawan单通道网关协议栈 + ├── Kconfig lorawan Kconfig配置 + └── Makefile lorawan Makefile ``` ## 使用 @@ -24,7 +25,16 @@ git submodule init git submodule update APP_Framework/lib/lorawan/lora_radio_driver git submodule update APP_Framework/lib/lorawan/lorawan_devicenode -# 进入 APP_Framework/lib/lorawan/Kconfig 配置,增加子模块source路径 +# 进入 APP_Framework/lib/lorawan/Kconfig 配置,增加子模块source路径,从而编译时可找到相应lib的配置 +menuconfig LIB_USING_LORAWAN_GATEWAY_SC + bool "LoRaWan using lorawan_gateway for single channel(SX126x、SX127x) lib" + default n + select LIB_USING_LORA_RADIO + +if LIB_USING_LORAWAN_GATEWAY_SC + source "$APP_DIR/lib/lorawan/lorawan_gateway_single_channel/Kconfig" +endif + menuconfig LIB_USING_LORAWAN_ED_STACK bool "LoRaWan using lorawan_ed_stack lib" default n diff --git a/APP_Framework/lib/lorawan/lora_radio_driver b/APP_Framework/lib/lorawan/lora_radio_driver index bc03d64f4..d21965b1c 160000 --- a/APP_Framework/lib/lorawan/lora_radio_driver +++ b/APP_Framework/lib/lorawan/lora_radio_driver @@ -1 +1 @@ -Subproject commit bc03d64f4b7408f85512735064dc5569431d6c8d +Subproject commit d21965b1cbcfa99b2d36acd029a37f3f2eba612e diff --git a/APP_Framework/lib/lorawan/lorawan_gateway_single_channel b/APP_Framework/lib/lorawan/lorawan_gateway_single_channel new file mode 160000 index 000000000..ac1c6516e --- /dev/null +++ b/APP_Framework/lib/lorawan/lorawan_gateway_single_channel @@ -0,0 +1 @@ +Subproject commit ac1c6516ec9b2998c0c50796a4e5a8b78781dc8c diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/aiit-arm32-board/configs/nsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/aiit-arm32-board/configs/nsh/defconfig index 697a70852..06623fbae 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/aiit-arm32-board/configs/nsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/aiit-arm32-board/configs/nsh/defconfig @@ -9,7 +9,7 @@ # CONFIG_NSH_ARGCAT is not set # CONFIG_NSH_CMDOPT_HEXDUMP is not set # CONFIG_NSH_CMDPARMS is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="aiit-arm32-board" CONFIG_ARCH_BOARD_STM32F4_AIIT=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/aiit-riscv64-board/configs/nsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/aiit-riscv64-board/configs/nsh/defconfig index 641746360..b6214968f 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/aiit-riscv64-board/configs/nsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/aiit-riscv64-board/configs/nsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="aiit-riscv64-board" CONFIG_ARCH_BOARD_AIIT_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/lorae22nsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/lorae22nsh/defconfig index 8beb3aa76..18e17f54e 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/lorae22nsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/lorae22nsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="edu-riscv64" CONFIG_ARCH_BOARD_EDU_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/loransh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/loransh/defconfig index 882bfd930..b68627f4f 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/loransh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/loransh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="edu-riscv64" CONFIG_ARCH_BOARD_EDU_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/nsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/nsh/defconfig index c93933657..4293cb647 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/nsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/nsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="edu-riscv64" CONFIG_ARCH_BOARD_EDU_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/usbnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/usbnsh/defconfig index fbe6ee65d..ee5ba82a5 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/usbnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/usbnsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="edu-riscv64" CONFIG_ARCH_BOARD_EDU_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/wifinsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/wifinsh/defconfig index 83a523fcf..dfc7f4901 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/wifinsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/edu-riscv64/configs/wifinsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="edu-riscv64" CONFIG_ARCH_BOARD_EDU_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/hc32f4a0/configs/nsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/hc32f4a0/configs/nsh/defconfig index 513eca924..85bcadd17 100755 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/hc32f4a0/configs/nsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/hc32f4a0/configs/nsh/defconfig @@ -9,7 +9,7 @@ # CONFIG_NSH_ARGCAT is not set # CONFIG_NSH_CMDOPT_HEXDUMP is not set # CONFIG_NSH_CMDPARMS is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_ARMV7M=y CONFIG_ARCH_CORTEXM4=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/elf/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/elf/defconfig index b0c8add40..909a58c09 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/elf/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/elf/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="sabre-lite" CONFIG_ARCH_BOARD_SABRE_LITE=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/knsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/knsh/defconfig index 5d1a8916c..3b15c1260 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/knsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/knsh/defconfig @@ -6,7 +6,7 @@ # modifications. # # CONFIG_NSH_CMDOPT_HEXDUMP is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_ADDRENV=y CONFIG_ARCH_BOARD="sabre-lite" diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/nsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/nsh/defconfig index 5588f4a47..8624d9db1 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/nsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/nsh/defconfig @@ -6,7 +6,7 @@ # modifications. # # CONFIG_NSH_CMDOPT_HEXDUMP is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="sabre-lite" CONFIG_ARCH_BOARD_SABRE_LITE=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/posix_spawn/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/posix_spawn/defconfig index 50f16f7a7..77ffec5f1 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/posix_spawn/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/posix_spawn/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="sabre-lite" CONFIG_ARCH_BOARD_SABRE_LITE=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/smp/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/smp/defconfig index 430c983cc..2fed4ea83 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/smp/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/sabre-lite/configs/smp/defconfig @@ -6,7 +6,7 @@ # modifications. # # CONFIG_NSH_CMDOPT_HEXDUMP is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="sabre-lite" CONFIG_ARCH_BOARD_SABRE_LITE=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/4gnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/4gnsh/defconfig index e77bb4385..60de6af8a 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/4gnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/4gnsh/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="xidatong-arm32" CONFIG_ARCH_BOARD_XIDATONG_ARM32=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/btnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/btnsh/defconfig index 9b7af5b16..a8b10a612 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/btnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/btnsh/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="xidatong-arm32" CONFIG_ARCH_BOARD_XIDATONG_ARM32=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/lcdnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/lcdnsh/defconfig index 3219e42d0..463b56ad4 100755 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/lcdnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/lcdnsh/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="xidatong-arm32" CONFIG_ARCH_BOARD_XIDATONG_ARM32=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/loransh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/loransh/defconfig index b13f681e5..c921ad8b4 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/loransh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/loransh/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="xidatong-arm32" CONFIG_ARCH_BOARD_XIDATONG_ARM32=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/mmnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/mmnsh/defconfig index e38a4d7e5..5cd70cefe 100755 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/mmnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/mmnsh/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="xidatong-arm32" CONFIG_ARCH_BOARD_XIDATONG_ARM32=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/muslnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/muslnsh/defconfig index 9b1048d9e..0aed0f5c7 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/muslnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/muslnsh/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="xidatong-arm32" CONFIG_ARCH_BOARD_XIDATONG_ARM32=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/netnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/netnsh/defconfig index 18e37d804..f51869369 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/netnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/netnsh/defconfig @@ -6,7 +6,7 @@ # modifications. # # CONFIG_ARCH_LEDS is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="xidatong-arm32" CONFIG_ARCH_BOARD_XIDATONG_ARM32=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/nsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/nsh/defconfig index 9bbac573a..332888ba3 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/nsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/nsh/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="xidatong-arm32" CONFIG_ARCH_BOARD_XIDATONG_ARM32=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/sdionsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/sdionsh/defconfig index 09b581648..366f58951 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/sdionsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/sdionsh/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="xidatong-arm32" CONFIG_ARCH_BOARD_XIDATONG_ARM32=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/usbnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/usbnsh/defconfig index fbb2ab1d2..5aadd5c2f 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/usbnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/usbnsh/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="xidatong-arm32" CONFIG_ARCH_BOARD_XIDATONG_ARM32=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/wifinsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/wifinsh/defconfig index 2d1625113..f5de9941f 100755 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/wifinsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/wifinsh/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="xidatong-arm32" CONFIG_ARCH_BOARD_XIDATONG_ARM32=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/zbnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/zbnsh/defconfig index f2bb2dd5a..3aad755ea 100755 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/zbnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-arm32/configs/zbnsh/defconfig @@ -5,7 +5,7 @@ # You can then do "make savedefconfig" to generate a new defconfig file that includes your # modifications. # -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="xidatong-arm32" CONFIG_ARCH_BOARD_XIDATONG_ARM32=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/4gnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/4gnsh/defconfig index 9f8bf526d..c2764380a 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/4gnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/4gnsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="xidatong-riscv64" CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/btnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/btnsh/defconfig index d22793b51..33ce3dd95 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/btnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/btnsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="xidatong-riscv64" CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/cannsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/cannsh/defconfig index d0df672e4..8d552684b 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/cannsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/cannsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="xidatong-riscv64" CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/ch376nsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/ch376nsh/defconfig index b9aefbaa3..25aabdfa7 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/ch376nsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/ch376nsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="xidatong-riscv64" CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/lcdnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/lcdnsh/defconfig index 588b67f60..6525d7e4c 100755 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/lcdnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/lcdnsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="xidatong-riscv64" CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/loransh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/loransh/defconfig index d86e29dfb..562195c42 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/loransh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/loransh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="xidatong-riscv64" CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/nsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/nsh/defconfig index aaad9d7a0..6a930ff44 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/nsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/nsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="xidatong-riscv64" CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/touchnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/touchnsh/defconfig index 09d0c7329..c02b6aaec 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/touchnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/touchnsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="xidatong-riscv64" CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/w5500nsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/w5500nsh/defconfig index 6075ce1b8..380fef511 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/w5500nsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/w5500nsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="xidatong-riscv64" CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/wifinsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/wifinsh/defconfig index 327ac8b74..389d01ec1 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/wifinsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/wifinsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="xidatong-riscv64" CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/zbnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/zbnsh/defconfig index 2eef08514..94962951a 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/zbnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/aiit_board/xidatong-riscv64/configs/zbnsh/defconfig @@ -7,7 +7,7 @@ # # CONFIG_NSH_DISABLE_LOSMART is not set # CONFIG_STANDARD_SERIAL is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="risc-v" CONFIG_ARCH_BOARD="xidatong-riscv64" CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/iaqnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/iaqnsh/defconfig index 004a0a38b..bccc666e1 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/iaqnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/iaqnsh/defconfig @@ -9,7 +9,7 @@ # CONFIG_NSH_ARGCAT is not set # CONFIG_NSH_CMDOPT_HEXDUMP is not set # CONFIG_NSH_CMDPARMS is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="stm32f4discovery" CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/loransh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/loransh/defconfig index e5288e75b..addd8965e 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/loransh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/loransh/defconfig @@ -9,7 +9,7 @@ # CONFIG_NSH_ARGCAT is not set # CONFIG_NSH_CMDOPT_HEXDUMP is not set # CONFIG_NSH_CMDPARMS is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="stm32f4discovery" CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/nsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/nsh/defconfig index 5ca3887cc..3902a9e1c 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/nsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/nsh/defconfig @@ -9,7 +9,7 @@ # CONFIG_NSH_ARGCAT is not set # CONFIG_NSH_CMDOPT_HEXDUMP is not set # CONFIG_NSH_CMDPARMS is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="stm32f4discovery" CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y diff --git a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/tempnsh/defconfig b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/tempnsh/defconfig index 7522834e8..614fb27a8 100644 --- a/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/tempnsh/defconfig +++ b/Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/boards/arm/stm32/stm32f4discovery/configs/tempnsh/defconfig @@ -9,7 +9,7 @@ # CONFIG_NSH_ARGCAT is not set # CONFIG_NSH_CMDOPT_HEXDUMP is not set # CONFIG_NSH_CMDPARMS is not set -CONFIG_ADD_NUTTX_FETURES=y +CONFIG_ADD_NUTTX_FEATURES=y CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="stm32f4discovery" CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-arm32-board/.config b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-arm32-board/.config index aa01305c9..5decf02ef 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-arm32-board/.config +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-arm32-board/.config @@ -313,9 +313,9 @@ CONFIG_USB_DEVICE_NAME="usb_dev" # Framework # CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y -# CONFIG_ADD_XIZI_FETURES is not set -# CONFIG_ADD_NUTTX_FETURES is not set -CONFIG_ADD_RTTHREAD_FETURES=y +# CONFIG_ADD_XIZI_FEATURES is not set +# CONFIG_ADD_NUTTX_FEATURES is not set +CONFIG_ADD_RTTHREAD_FEATURES=y # CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set CONFIG_SUPPORT_CONNECTION_FRAMEWORK=y CONFIG_CONNECTION_FRAMEWORK_DEBUG=y diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-arm32-board/rtconfig.h b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-arm32-board/rtconfig.h index e71dc1826..b755526d1 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-arm32-board/rtconfig.h +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-arm32-board/rtconfig.h @@ -190,7 +190,7 @@ /* Framework */ #define TRANSFORM_LAYER_ATTRIUBUTE -#define ADD_RTTHREAD_FETURES +#define ADD_RTTHREAD_FEATURES #define SUPPORT_CONNECTION_FRAMEWORK #define CONNECTION_FRAMEWORK_DEBUG #define ADAPTER_HFA21_DRIVER "/dev/uart3" diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-riscv64-board/.config b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-riscv64-board/.config index a35ce48a2..781d0905f 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-riscv64-board/.config +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-riscv64-board/.config @@ -327,9 +327,9 @@ CONFIG_PKG_KENDRYTE_SDK_VERNUM=0x0055 # Framework # CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y -# CONFIG_ADD_XIZI_FETURES is not set -# CONFIG_ADD_NUTTX_FETURES is not set -CONFIG_ADD_RTTHREAD_FETURES=y +# CONFIG_ADD_XIZI_FEATURES is not set +# CONFIG_ADD_NUTTX_FEATURES is not set +CONFIG_ADD_RTTHREAD_FEATURES=y CONFIG_SUPPORT_SENSOR_FRAMEWORK=y CONFIG_SENSOR_HCHO=y CONFIG_SENSOR_TB600B_WQ_HCHO1OS=y diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-riscv64-board/rtconfig.h b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-riscv64-board/rtconfig.h index 714ab891e..7377e8ac0 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-riscv64-board/rtconfig.h +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/aiit-riscv64-board/rtconfig.h @@ -206,7 +206,7 @@ /* Framework */ #define TRANSFORM_LAYER_ATTRIUBUTE -#define ADD_RTTHREAD_FETURES +#define ADD_RTTHREAD_FEATURES #define SUPPORT_SENSOR_FRAMEWORK #define SENSOR_HCHO #define SENSOR_TB600B_WQ_HCHO1OS diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/k210/.config b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/k210/.config index 335c45a54..81e2f5a1f 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/k210/.config +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/k210/.config @@ -465,9 +465,9 @@ CONFIG_OV2640_Y_IMAGE_WINDOWS_SIZE=400 # 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_ADD_XIZI_FEATURES=y +# CONFIG_ADD_NUTTX_FEATURES is not set +# CONFIG_ADD_RTTHREAD_FEATURES is not set # CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set # CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set CONFIG_SUPPORT_KNOWING_FRAMEWORK=y diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/k210/rtconfig.h b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/k210/rtconfig.h index 437cca660..bb838bb57 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/k210/rtconfig.h +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/k210/rtconfig.h @@ -318,7 +318,7 @@ /* Framework */ #define TRANSFORM_LAYER_ATTRIUBUTE -#define ADD_XIZI_FETURES +#define ADD_XIZI_FEATURES #define SUPPORT_KNOWING_FRAMEWORK #define USING_KPU_PROCESSING #define USING_YOLOV2 diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32f407_core/.config b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32f407_core/.config index 80c549734..36a8c9ccd 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32f407_core/.config +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32f407_core/.config @@ -482,9 +482,9 @@ CONFIG_OV2640_Y_IMAGE_WINDOWS_SIZE=400 # 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_ADD_XIZI_FEATURES=y +# CONFIG_ADD_NUTTX_FEATURES is not set +# CONFIG_ADD_RTTHREAD_FEATURES is not set CONFIG_SUPPORT_SENSOR_FRAMEWORK=y # CONFIG_SENSOR_HCHO is not set # CONFIG_SENSOR_TVOC is not set diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32f407_core/rtconfig.h b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32f407_core/rtconfig.h index 01651642e..6829561cd 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32f407_core/rtconfig.h +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32f407_core/rtconfig.h @@ -311,7 +311,7 @@ /* Framework */ #define TRANSFORM_LAYER_ATTRIUBUTE -#define ADD_XIZI_FETURES +#define ADD_XIZI_FEATURES #define SUPPORT_SENSOR_FRAMEWORK #define SENSOR_VOICE #define SENSOR_D124 diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32h743_openmv_h7plus/.config b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32h743_openmv_h7plus/.config index 0f63cb237..658492e7a 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32h743_openmv_h7plus/.config +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32h743_openmv_h7plus/.config @@ -324,9 +324,9 @@ CONFIG_BSP_USING_USBD=y # 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_ADD_XIZI_FEATURES=y +# CONFIG_ADD_NUTTX_FEATURES is not set +# CONFIG_ADD_RTTHREAD_FEATURES is not set # CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set # CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set # CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32h743_openmv_h7plus/rtconfig.h b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32h743_openmv_h7plus/rtconfig.h index 8ebd6580e..1fb0f5228 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32h743_openmv_h7plus/rtconfig.h +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/stm32h743_openmv_h7plus/rtconfig.h @@ -193,7 +193,7 @@ /* Framework */ #define TRANSFORM_LAYER_ATTRIUBUTE -#define ADD_XIZI_FETURES +#define ADD_XIZI_FEATURES /* Security */ diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-arm32/.config b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-arm32/.config index a17f65d9d..6074e05ac 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-arm32/.config +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-arm32/.config @@ -389,9 +389,9 @@ CONFIG_PHY_RESET_PIN=3 # Framework # CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y -# CONFIG_ADD_XIZI_FETURES is not set -# CONFIG_ADD_NUTTX_FETURES is not set -CONFIG_ADD_RTTHREAD_FETURES=y +# CONFIG_ADD_XIZI_FEATURES is not set +# CONFIG_ADD_NUTTX_FEATURES is not set +CONFIG_ADD_RTTHREAD_FEATURES=y # CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set # CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set # CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-arm32/rtconfig.h b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-arm32/rtconfig.h index 964d9ebdc..f4203c863 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-arm32/rtconfig.h +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-arm32/rtconfig.h @@ -248,7 +248,7 @@ /* Framework */ #define TRANSFORM_LAYER_ATTRIUBUTE -#define ADD_RTTHREAD_FETURES +#define ADD_RTTHREAD_FEATURES /* Security */ diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-riscv64/.config b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-riscv64/.config index e12d40794..561d84c00 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-riscv64/.config +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-riscv64/.config @@ -352,9 +352,9 @@ CONFIG_PKG_WIZNET_VER="latest" # Framework # CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y -# CONFIG_ADD_XIZI_FETURES is not set -# CONFIG_ADD_NUTTX_FETURES is not set -CONFIG_ADD_RTTHREAD_FETURES=y +# CONFIG_ADD_XIZI_FEATURES is not set +# CONFIG_ADD_NUTTX_FEATURES is not set +CONFIG_ADD_RTTHREAD_FEATURES=y # CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set # CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set # CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set diff --git a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-riscv64/rtconfig.h b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-riscv64/rtconfig.h index eee446b17..0c87387ec 100644 --- a/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-riscv64/rtconfig.h +++ b/Ubiquitous/RT-Thread_Fusion_XiUOS/aiit_board/xidatong-riscv64/rtconfig.h @@ -217,7 +217,7 @@ /* Framework */ #define TRANSFORM_LAYER_ATTRIUBUTE -#define ADD_RTTHREAD_FETURES +#define ADD_RTTHREAD_FEATURES /* Security */ diff --git a/Ubiquitous/XiZi_IIoT/arch/risc-v/gap8/gap8.h b/Ubiquitous/XiZi_IIoT/arch/risc-v/gap8/gap8.h index 78bdaed19..8f1d72598 100755 --- a/Ubiquitous/XiZi_IIoT/arch/risc-v/gap8/gap8.h +++ b/Ubiquitous/XiZi_IIoT/arch/risc-v/gap8/gap8.h @@ -37,7 +37,7 @@ /** * @file gap8.h -* @brief support gap8 chip fetures +* @brief support gap8 chip features * @version 1.0 * @author AIIT XUOS Lab * @date 2021-09-02 @@ -45,7 +45,7 @@ /************************************************* File name: gap8.h -Description: support gap8 chip fetures +Description: support gap8 chip features Others: take nuttx/arch/risc-v/src/gap8/gap8.h for references https://github.com/apache/incubator-nuttx.git History: diff --git a/Ubiquitous/XiZi_IIoT/board/cortex-m0-emulator/.defconfig b/Ubiquitous/XiZi_IIoT/board/cortex-m0-emulator/.defconfig index ed725c23c..90e7fce5f 100644 --- a/Ubiquitous/XiZi_IIoT/board/cortex-m0-emulator/.defconfig +++ b/Ubiquitous/XiZi_IIoT/board/cortex-m0-emulator/.defconfig @@ -179,9 +179,9 @@ CONFIG_LIB_NEWLIB=y # 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_ADD_XIZI_FEATURES=y +# CONFIG_ADD_NUTTX_FEATURES is not set +# CONFIG_ADD_RTTHREAD_FEATURES is not set # CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set # CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set # CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set diff --git a/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/Makefile b/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/Makefile index dbc03153b..b5bc3166b 100644 --- a/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/Makefile +++ b/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/Makefile @@ -1,3 +1,3 @@ -SRC_FILES := socket.c connect_w5500.c w5500.c wizchip_conf.c spi_interface.c wiz_ping.c wiz_iperf.c +SRC_FILES := socket.c connect_w5500.c w5500.c wizchip_conf.c spi_interface.c wiz_ping.c connect_w5500_test.c wiz_iperf.c include $(KERNEL_ROOT)/compiler.mk \ No newline at end of file diff --git a/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/connect_w5500.c b/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/connect_w5500.c index d06dfaa2d..0b245b11d 100644 --- a/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/connect_w5500.c +++ b/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/connect_w5500.c @@ -23,47 +23,53 @@ extern void spi_select_cs(void); extern void spi_deselete_cs(void); // global configurations for w5500 tcp connection -const uint32_t g_wiznet_buf_size = 2048; +uint32_t get_gbuf_size() { + static const uint32_t g_wiznet_buf_size = 2048; + return g_wiznet_buf_size; +} -static wiz_NetInfo g_wiz_netinfo = {.mac = {0x00, 0x08, 0xdc, 0x11, 0x11, 0x11}, - .ip = {192, 168, 131, 42}, - .sn = {255, 255, 254, 0}, - .gw = {192, 168, 130, 1}, - .dns = {0, 0, 0, 0}, - .dhcp = NETINFO_STATIC}; +wiz_NetInfo *get_gnetinfo() { + static wiz_NetInfo g_wiz_netinfo = {.mac = {0x00, 0x08, 0xdc, 0x11, 0x11, 0x11}, + .ip = {192, 168, 130, 77}, + .sn = {255, 255, 254, 0}, + .gw = {192, 168, 130, 1}, + .dns = {0, 0, 0, 0}, + .dhcp = NETINFO_STATIC}; + return &g_wiz_netinfo; +} int network_init() { wiz_NetInfo check_wiz_netinfo; check_wiz_netinfo.dhcp = NETINFO_STATIC; - ctlnetwork(CN_SET_NETINFO, (void *)&g_wiz_netinfo); + ctlnetwork(CN_SET_NETINFO, (void *)get_gnetinfo()); ctlnetwork(CN_GET_NETINFO, (void *)&check_wiz_netinfo); - if (memcmp(&g_wiz_netinfo, &check_wiz_netinfo, sizeof(wiz_NetInfo)) != 0) { + if (memcmp(get_gnetinfo(), &check_wiz_netinfo, sizeof(wiz_NetInfo)) != 0) { KPrintf( "mac: %d; ip: %d; gw: %d; sn: %d; dns: %d; dhcp: %d;\n", - memcmp(&g_wiz_netinfo.mac, &check_wiz_netinfo.mac, sizeof(uint8_t) * 6), - memcmp(&g_wiz_netinfo.ip, &check_wiz_netinfo.ip, sizeof(uint8_t) * 4), - memcmp(&g_wiz_netinfo.sn, &check_wiz_netinfo.sn, sizeof(uint8_t) * 4), - memcmp(&g_wiz_netinfo.gw, &check_wiz_netinfo.gw, sizeof(uint8_t) * 4), - memcmp(&g_wiz_netinfo.dns, &check_wiz_netinfo.dns, sizeof(uint8_t) * 4), - memcmp(&g_wiz_netinfo.dhcp, &check_wiz_netinfo.dhcp, sizeof(uint8_t))); + memcmp(&get_gnetinfo()->mac, &check_wiz_netinfo.mac, sizeof(uint8_t) * 6), + memcmp(&get_gnetinfo()->ip, &check_wiz_netinfo.ip, sizeof(uint8_t) * 4), + memcmp(&get_gnetinfo()->sn, &check_wiz_netinfo.sn, sizeof(uint8_t) * 4), + memcmp(&get_gnetinfo()->gw, &check_wiz_netinfo.gw, sizeof(uint8_t) * 4), + memcmp(&get_gnetinfo()->dns, &check_wiz_netinfo.dns, sizeof(uint8_t) * 4), + memcmp(&get_gnetinfo()->dhcp, &check_wiz_netinfo.dhcp, sizeof(uint8_t))); KPrintf("WIZCHIP set network information fail.\n"); return ERROR; } uint8_t tmpstr[6]; ctlwizchip(CW_GET_ID, (void *)tmpstr); KPrintf("=== %s NET CONF ===\r\n", (char *)tmpstr); - KPrintf("MAC: %02X:%02X:%02X:%02X:%02X:%02X\r\n", g_wiz_netinfo.mac[0], - g_wiz_netinfo.mac[1], g_wiz_netinfo.mac[2], g_wiz_netinfo.mac[3], - g_wiz_netinfo.mac[4], g_wiz_netinfo.mac[5]); - KPrintf("SIP: %d.%d.%d.%d\r\n", g_wiz_netinfo.ip[0], g_wiz_netinfo.ip[1], - g_wiz_netinfo.ip[2], g_wiz_netinfo.ip[3]); - KPrintf("GAR: %d.%d.%d.%d\r\n", g_wiz_netinfo.gw[0], g_wiz_netinfo.gw[1], - g_wiz_netinfo.gw[2], g_wiz_netinfo.gw[3]); - KPrintf("SUB: %d.%d.%d.%d\r\n", g_wiz_netinfo.sn[0], g_wiz_netinfo.sn[1], - g_wiz_netinfo.sn[2], g_wiz_netinfo.sn[3]); - KPrintf("DNS: %d.%d.%d.%d\r\n", g_wiz_netinfo.dns[0], g_wiz_netinfo.dns[1], - g_wiz_netinfo.dns[2], g_wiz_netinfo.dns[3]); + KPrintf("MAC: %02X:%02X:%02X:%02X:%02X:%02X\r\n", get_gnetinfo()->mac[0], + get_gnetinfo()->mac[1], get_gnetinfo()->mac[2], get_gnetinfo()->mac[3], + get_gnetinfo()->mac[4], get_gnetinfo()->mac[5]); + KPrintf("SIP: %d.%d.%d.%d\r\n", get_gnetinfo()->ip[0], get_gnetinfo()->ip[1], + get_gnetinfo()->ip[2], get_gnetinfo()->ip[3]); + KPrintf("GAR: %d.%d.%d.%d\r\n", get_gnetinfo()->gw[0], get_gnetinfo()->gw[1], + get_gnetinfo()->gw[2], get_gnetinfo()->gw[3]); + KPrintf("SUB: %d.%d.%d.%d\r\n", get_gnetinfo()->sn[0], get_gnetinfo()->sn[1], + get_gnetinfo()->sn[2], get_gnetinfo()->sn[3]); + KPrintf("DNS: %d.%d.%d.%d\r\n", get_gnetinfo()->dns[0], get_gnetinfo()->dns[1], + get_gnetinfo()->dns[2], get_gnetinfo()->dns[3]); KPrintf("======================\r\n"); return EOK; @@ -255,312 +261,4 @@ int HwWiznetInit(void) { network_init(); return EOK; -} - -/****************** basic functions ********************/ - -enum TCP_OPTION { - SEND_DATA = 0, - RECV_DATA, -}; - -uint32_t wiz_client_op(uint8_t sn, uint8_t *buf, uint32_t buf_size, - uint8_t dst_ip[4], uint16_t dst_port, - enum TCP_OPTION opt) { - // assert(buf_size <= g_wiznet_buf_size); - int32_t ret; - switch (getSn_SR(sn)) { - case SOCK_CLOSE_WAIT: - wiz_sock_disconnect(sn); - break; - case SOCK_CLOSED: - wiz_socket(sn, Sn_MR_TCP, 5000, 0x00); - break; - case SOCK_INIT: - KPrintf("[SOCKET CLIENT] sock init.\n"); - wiz_sock_connect(sn, dst_ip, dst_port); - break; - case SOCK_ESTABLISHED: - if (getSn_IR(sn) & Sn_IR_CON) { - printf("[SOCKET CLIENT] %d:Connected\r\n", sn); - setSn_IR(sn, Sn_IR_CON); - } - if (opt == SEND_DATA) { - uint32_t sent_size = 0; - ret = wiz_sock_send(sn, buf, buf_size); - if (ret < 0) { - wiz_sock_close(sn); - return ret; - } - } else if (opt == RECV_DATA) { - uint32_t size = 0; - if ((size = getSn_RX_RSR(sn)) > 0) { - if (size > buf_size) size = buf_size; - ret = wiz_sock_recv(sn, buf, size); - if (ret <= 0) return ret; - } - } - break; - default: - break; - } -} - -void wiz_client_op_test(int argc, char *argv[]) { - /* argv[1]: ip ip addr - * argv[2]: port port number - * argv[3]: msg send msg - * argv[4]: count test times,if no this parameter,default 10 times - */ - if (argc < 4) - { - KPrintf("wiz_client_op_test error\n"); - return; - } - uint8_t client_sock = 2; - uint32_t tmp_ip[4]; - uint8_t ip[4]; - uint64_t pCount = 10; - uint8_t buf[g_wiznet_buf_size]; - uint16_t port; - - sscanf(argv[1], "%d.%d.%d.%d", &tmp_ip[0], &tmp_ip[1], &tmp_ip[2], &tmp_ip[3]); - ip[0] = (uint8_t)tmp_ip[0]; - ip[1] = (uint8_t)tmp_ip[1]; - ip[2] = (uint8_t)tmp_ip[2]; - ip[3] = (uint8_t)tmp_ip[3]; - - port = atoi(argv[2]); - KPrintf("wiz client to wiz_server, send to %d.%d.%d.%d %d\n", // tip info - ip[0], ip[1], ip[2], ip[3], port); - - if (argc >= 5){ - pCount = atoi(argv[4]); - } - for(uint64_t i = 0; i < pCount; i++) - { - wiz_client_op(client_sock, argv[3], strlen(argv[3]), ip, port, SEND_DATA); - MdelayKTask(10); - // waiting for a responding. - wiz_client_op(client_sock, buf, g_wiznet_buf_size, ip, port, RECV_DATA); - KPrintf("received msg: %s\n", buf); - memset(buf, 0, g_wiznet_buf_size); - } -} - -SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), - wiz_client_op, wiz_client_op_test, - wiz_sock_recv or wiz_sock_send data as tcp client); - -int32_t wiz_server_op(uint8_t sn, uint8_t *buf, uint32_t buf_size, - uint16_t port, enum TCP_OPTION opt) { - int32_t ret = 0; - uint16_t size = 0, sentsize = 0; - switch (getSn_SR(sn)) { - case SOCK_ESTABLISHED: - if (getSn_IR(sn) & Sn_IR_CON) { - printf("%d:Connected\r\n", sn); - setSn_IR(sn, Sn_IR_CON); - } - if (opt == SEND_DATA) { - uint32_t sent_size = 0; - ret = wiz_sock_send(sn, buf, buf_size); - if (ret < 0) { - wiz_sock_close(sn); - return ret; - } - } else if (opt == RECV_DATA) { - uint32_t size = 0; - if ((size = getSn_RX_RSR(sn)) > 0) { - if (size > buf_size) size = buf_size; - ret = wiz_sock_recv(sn, buf, size); - return ret; - } - } - break; - case SOCK_CLOSE_WAIT: - printf("%d:CloseWait\r\n", sn); - if ((ret = wiz_sock_disconnect(sn)) != SOCK_OK) return ret; - printf("%d:Closed\r\n", sn); - break; - case SOCK_INIT: - printf("%d:Listen, port [%d]\r\n", sn, port); - if ((ret = wiz_sock_listen(sn)) != SOCK_OK) return ret; - break; - case SOCK_CLOSED: - printf("%d:LBTStart\r\n", sn); - if ((ret = wiz_socket(sn, Sn_MR_TCP, port, 0x00)) != sn) return ret; - printf("%d:Opened\r\n", sn); - break; - default: - break; - } - return 0; -} - -void wiz_server(void *param) { - uint16_t port = *(uint16_t *)param; - KPrintf("wiz server, listen port: %d\n", port); - uint8_t buf[g_wiznet_buf_size]; - memset(buf, 0, g_wiznet_buf_size); - int ret = 0; - uint32_t size = 0; - - while (1) { - ret = wiz_server_op(0, buf, g_wiznet_buf_size, port, RECV_DATA); - while(buf[size] != 0){ - size ++; - } - if (ret > 0) { - KPrintf("received %d bytes: %s\n", size, buf); - - wiz_server_op(0, buf, g_wiznet_buf_size, port, SEND_DATA); - memset(buf, 0, g_wiznet_buf_size); - } - size = 0; - } -} - -void wiz_server_test(uint16_t port) { - /* argv[1]: port - */ - int32 wiz_server_id = - KTaskCreate("wiz_server", wiz_server, (void *)&port, 4096, 25); - x_err_t flag = StartupKTask(wiz_server_id); - if (flag != EOK) { - KPrintf("StartupKTask wiz_server_id failed .\n"); - } -} - -SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC) | - SHELL_CMD_PARAM_NUM(1), - wiz_server_op, wiz_server_test, - wiz_sock_recv or wiz_sock_send data as tcp server); - -void loopback_udps(int argc, char *argv[]) -{ - /* argv[1]: remote_ip ip address of remote udp - * argv[2]: remote_port the port number of the remote udp - * argv[2]: local_port the port number of the local udp - */ - uint32_t tmp_ip[4]; - uint8_t remote_ip[4]; - uint16_t remote_port, local_port; - uint8_t buffer[g_wiznet_buf_size]; - uint16_t len = 0; - - if (argc < 4) - { - KPrintf("loopback_udps test error\n"); - return; - } - - sscanf(argv[1], "%d.%d.%d.%d", &tmp_ip[0], &tmp_ip[1], &tmp_ip[2], &tmp_ip[3]); - for(int i = 0;i < 4; i++) - { - remote_ip[i] = (uint8_t)tmp_ip[i]; - } - - remote_port = atoi(argv[2]); - local_port = atoi(argv[3]); - while(1) - { - switch (getSn_SR(0)) - { - case SOCK_UDP: - if(getSn_IR(0) & Sn_IR_RECV) - { - setSn_IR(0, Sn_IR_RECV); - } - if((len = getSn_RX_RSR(0))>0) - { - memset(buffer,0,len+1); - wiz_sock_recvfrom(0, buffer, len, remote_ip, (uint16_t *)&remote_port); - printf("received msg: %s\n", buffer); - wiz_sock_sendto(0, buffer, len, remote_ip, remote_port); - } - break; - - case SOCK_CLOSED: - printf("LBUStart\r\n"); - wiz_socket(0, Sn_MR_UDP, local_port, 0); - break; - } - } -} - -/* wiz_udp remote_ip remote_port local_port */ -SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), - wiz_udp, loopback_udps, w5500 upd test); - -void ifconfig() { - wiz_NetInfo wiz_netinfo; - ctlnetwork(CN_GET_NETINFO, (void *)&wiz_netinfo); - uint8_t tmpstr[6]; - ctlwizchip(CW_GET_ID, (void *)tmpstr); - KPrintf("=== %s NET CONF ===\r\n", (char *)tmpstr); - KPrintf("MAC: %02X:%02X:%02X:%02X:%02X:%02X\r\n", wiz_netinfo.mac[0], - wiz_netinfo.mac[1], wiz_netinfo.mac[2], wiz_netinfo.mac[3], - wiz_netinfo.mac[4], wiz_netinfo.mac[5]); - KPrintf("SIP: %d.%d.%d.%d\r\n", wiz_netinfo.ip[0], wiz_netinfo.ip[1], - wiz_netinfo.ip[2], wiz_netinfo.ip[3]); - KPrintf("GAR: %d.%d.%d.%d\r\n", wiz_netinfo.gw[0], wiz_netinfo.gw[1], - wiz_netinfo.gw[2], wiz_netinfo.gw[3]); - KPrintf("SUB: %d.%d.%d.%d\r\n", wiz_netinfo.sn[0], wiz_netinfo.sn[1], - wiz_netinfo.sn[2], wiz_netinfo.sn[3]); - KPrintf("DNS: %d.%d.%d.%d\r\n", wiz_netinfo.dns[0], wiz_netinfo.dns[1], - wiz_netinfo.dns[2], wiz_netinfo.dns[3]); - KPrintf("======================\r\n"); -} -SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), - ifconfig, ifconfig, printf w5500 configurations); - -void char_arr_assign(uint8_t *dst, uint32_t *src, int len) { - for (int i = 0; i < len; ++i) { - dst[i] = (uint8_t)(src[i]); - } -} - -char *network_param_name[] = {"ip", "sn", "gw"}; - -void config_w5500_network(int argc, char *argv[]) { - if (argc < 2) { - KPrintf("[W5500] Network config require params.\n"); - return; - } - - wiz_NetInfo wiz_netinfo; - memcpy(&wiz_netinfo, &g_wiz_netinfo, sizeof(wiz_NetInfo)); - - int cur_arg_idx = 1; - - while (argv[cur_arg_idx] != NULL) { - if (argv[cur_arg_idx + 1] == NULL) { - KPrintf("[W5500] Network config %s requires value.\n", argv[cur_arg_idx]); - return; - } - uint32_t tmp_arr[4]; - sscanf(argv[cur_arg_idx + 1], "%d.%d.%d.%d", &tmp_arr[0], &tmp_arr[1], - &tmp_arr[2], &tmp_arr[3]); - if (memcmp(argv[cur_arg_idx], network_param_name[0], 2 * sizeof(char)) == - 0) { - char_arr_assign(wiz_netinfo.ip, tmp_arr, 4); - } else if (memcmp(argv[cur_arg_idx], network_param_name[1], - 2 * sizeof(char)) == 0) { - char_arr_assign(wiz_netinfo.sn, tmp_arr, 4); - } else if (memcmp(argv[cur_arg_idx], network_param_name[2], - 2 * sizeof(char)) == 0) { - char_arr_assign(wiz_netinfo.gw, tmp_arr, 4); - } else { - KPrintf("[W5500] Invalid network param.\n"); - } - cur_arg_idx += 2; - } - - ctlnetwork(CN_SET_NETINFO, (void *)&wiz_netinfo); - KPrintf("[W5500] Network config success.\n", argv[cur_arg_idx]); - ifconfig(); -} -SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), - config_w5500_network, config_w5500_network, - set w5500 configurations); \ No newline at end of file +} \ No newline at end of file diff --git a/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/connect_w5500_test.c b/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/connect_w5500_test.c new file mode 100644 index 000000000..c85c33090 --- /dev/null +++ b/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/connect_w5500_test.c @@ -0,0 +1,314 @@ +#include +#include +#include + +#include "socket.h" + +extern uint32_t get_gbuf_size(); +extern wiz_NetInfo *get_gnetinfo(); + +enum TCP_OPTION { + SEND_DATA = 0, + RECV_DATA, +}; + +uint32_t wiz_client_op(uint8_t sn, uint8_t *buf, uint32_t buf_size, + uint8_t dst_ip[4], uint16_t dst_port, + enum TCP_OPTION opt) { + // assert(buf_size <= get_gbuf_size()); + int32_t ret; + switch (getSn_SR(sn)) { + case SOCK_CLOSE_WAIT: + wiz_sock_disconnect(sn); + break; + case SOCK_CLOSED: + wiz_socket(sn, Sn_MR_TCP, 5000, 0x00); + break; + case SOCK_INIT: + KPrintf("[SOCKET CLIENT] sock init.\n"); + wiz_sock_connect(sn, dst_ip, dst_port); + break; + case SOCK_ESTABLISHED: + if (getSn_IR(sn) & Sn_IR_CON) { + printf("[SOCKET CLIENT] %d:Connected\r\n", sn); + setSn_IR(sn, Sn_IR_CON); + } + if (opt == SEND_DATA) { + uint32_t sent_size = 0; + ret = wiz_sock_send(sn, buf, buf_size); + if (ret < 0) { + wiz_sock_close(sn); + return ret; + } + } else if (opt == RECV_DATA) { + uint32_t size = 0; + if ((size = getSn_RX_RSR(sn)) > 0) { + if (size > buf_size) size = buf_size; + ret = wiz_sock_recv(sn, buf, size); + if (ret <= 0) return ret; + } + } + break; + default: + break; + } +} + +void wiz_client_op_test(int argc, char *argv[]) { + /* argv[1]: ip ip addr + * argv[2]: port port number + * argv[3]: msg send msg + * argv[4]: count test times,if no this parameter,default 10 times + */ + if (argc < 4) + { + KPrintf("wiz_client_op_test error\n"); + return; + } + uint8_t client_sock = 2; + uint32_t tmp_ip[4]; + uint8_t ip[4]; + uint64_t pCount = 10; + uint8_t buf[get_gbuf_size()]; + uint16_t port; + + sscanf(argv[1], "%d.%d.%d.%d", &tmp_ip[0], &tmp_ip[1], &tmp_ip[2], &tmp_ip[3]); + ip[0] = (uint8_t)tmp_ip[0]; + ip[1] = (uint8_t)tmp_ip[1]; + ip[2] = (uint8_t)tmp_ip[2]; + ip[3] = (uint8_t)tmp_ip[3]; + + port = atoi(argv[2]); + KPrintf("wiz client to wiz_server, send to %d.%d.%d.%d %d\n", // tip info + ip[0], ip[1], ip[2], ip[3], port); + + if (argc >= 5){ + pCount = atoi(argv[4]); + } + for(uint64_t i = 0; i < pCount; i++) + { + wiz_client_op(client_sock, argv[3], strlen(argv[3]), ip, port, SEND_DATA); + MdelayKTask(10); + // waiting for a responding. + wiz_client_op(client_sock, buf, get_gbuf_size(), ip, port, RECV_DATA); + KPrintf("received msg: %s\n", buf); + memset(buf, 0, get_gbuf_size()); + } +} + +SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), + wiz_client_op, wiz_client_op_test, + wiz_sock_recv or wiz_sock_send data as tcp client); + +int32_t wiz_server_op(uint8_t sn, uint8_t *buf, uint32_t buf_size, + uint16_t port, enum TCP_OPTION opt) { + int32_t ret = 0; + uint16_t size = 0, sentsize = 0; + switch (getSn_SR(sn)) { + case SOCK_ESTABLISHED: + if (getSn_IR(sn) & Sn_IR_CON) { + printf("%d:Connected\r\n", sn); + setSn_IR(sn, Sn_IR_CON); + } + if (opt == SEND_DATA) { + uint32_t sent_size = 0; + ret = wiz_sock_send(sn, buf, buf_size); + if (ret < 0) { + wiz_sock_close(sn); + return ret; + } + } else if (opt == RECV_DATA) { + uint32_t size = 0; + if ((size = getSn_RX_RSR(sn)) > 0) { + if (size > buf_size) size = buf_size; + ret = wiz_sock_recv(sn, buf, size); + return ret; + } + } + break; + case SOCK_CLOSE_WAIT: + printf("%d:CloseWait\r\n", sn); + if ((ret = wiz_sock_disconnect(sn)) != SOCK_OK) return ret; + printf("%d:Closed\r\n", sn); + break; + case SOCK_INIT: + printf("%d:Listen, port [%d]\r\n", sn, port); + if ((ret = wiz_sock_listen(sn)) != SOCK_OK) return ret; + break; + case SOCK_CLOSED: + printf("%d:LBTStart\r\n", sn); + if ((ret = wiz_socket(sn, Sn_MR_TCP, port, 0x00)) != sn) return ret; + printf("%d:Opened\r\n", sn); + break; + default: + break; + } + return 0; +} + +void wiz_server(void *param) { + uint16_t port = *(uint16_t *)param; + KPrintf("wiz server, listen port: %d\n", port); + uint8_t buf[get_gbuf_size()]; + memset(buf, 0, get_gbuf_size()); + int ret = 0; + uint32_t size = 0; + + while (1) { + ret = wiz_server_op(0, buf, get_gbuf_size(), port, RECV_DATA); + while(buf[size] != 0){ + size ++; + } + if (ret > 0) { + KPrintf("received %d bytes: %s\n", size, buf); + + wiz_server_op(0, buf, get_gbuf_size(), port, SEND_DATA); + memset(buf, 0, get_gbuf_size()); + } + size = 0; + } +} + +void wiz_server_test(uint16_t port) { + /* argv[1]: port + */ + int32 wiz_server_id = + KTaskCreate("wiz_server", wiz_server, (void *)&port, 4096, 25); + x_err_t flag = StartupKTask(wiz_server_id); + if (flag != EOK) { + KPrintf("StartupKTask wiz_server_id failed .\n"); + } +} + +SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC) | + SHELL_CMD_PARAM_NUM(1), + wiz_server_op, wiz_server_test, + wiz_sock_recv or wiz_sock_send data as tcp server); + +void loopback_udps(int argc, char *argv[]) +{ + /* argv[1]: remote_ip ip address of remote udp + * argv[2]: remote_port the port number of the remote udp + * argv[2]: local_port the port number of the local udp + */ + uint32_t tmp_ip[4]; + uint8_t remote_ip[4]; + uint16_t remote_port, local_port; + uint8_t buffer[get_gbuf_size()]; + uint16_t len = 0; + + if (argc < 4) + { + KPrintf("loopback_udps test error\n"); + return; + } + + sscanf(argv[1], "%d.%d.%d.%d", &tmp_ip[0], &tmp_ip[1], &tmp_ip[2], &tmp_ip[3]); + for(int i = 0;i < 4; i++) + { + remote_ip[i] = (uint8_t)tmp_ip[i]; + } + + remote_port = atoi(argv[2]); + local_port = atoi(argv[3]); + while(1) + { + switch (getSn_SR(0)) + { + case SOCK_UDP: + if(getSn_IR(0) & Sn_IR_RECV) + { + setSn_IR(0, Sn_IR_RECV); + } + if((len = getSn_RX_RSR(0))>0) + { + memset(buffer, 0, len + 1); + wiz_sock_recvfrom(0, buffer, len, remote_ip, (uint16_t *)&remote_port); + printf("received msg: %s\n", buffer); + wiz_sock_sendto(0, buffer, len, remote_ip, remote_port); + } + break; + + case SOCK_CLOSED: + printf("LBUStart\r\n"); + wiz_socket(0, Sn_MR_UDP, local_port, 0); + break; + } + } +} + +/* wiz_udp remote_ip remote_port local_port */ +SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), + wiz_udp, loopback_udps, w5500 upd test); + +void ifconfig() { + wiz_NetInfo wiz_netinfo; + ctlnetwork(CN_GET_NETINFO, (void *)&wiz_netinfo); + uint8_t tmpstr[6]; + ctlwizchip(CW_GET_ID, (void *)tmpstr); + KPrintf("=== %s NET CONF ===\r\n", (char *)tmpstr); + KPrintf("MAC: %02X:%02X:%02X:%02X:%02X:%02X\r\n", wiz_netinfo.mac[0], + wiz_netinfo.mac[1], wiz_netinfo.mac[2], wiz_netinfo.mac[3], + wiz_netinfo.mac[4], wiz_netinfo.mac[5]); + KPrintf("SIP: %d.%d.%d.%d\r\n", wiz_netinfo.ip[0], wiz_netinfo.ip[1], + wiz_netinfo.ip[2], wiz_netinfo.ip[3]); + KPrintf("GAR: %d.%d.%d.%d\r\n", wiz_netinfo.gw[0], wiz_netinfo.gw[1], + wiz_netinfo.gw[2], wiz_netinfo.gw[3]); + KPrintf("SUB: %d.%d.%d.%d\r\n", wiz_netinfo.sn[0], wiz_netinfo.sn[1], + wiz_netinfo.sn[2], wiz_netinfo.sn[3]); + KPrintf("DNS: %d.%d.%d.%d\r\n", wiz_netinfo.dns[0], wiz_netinfo.dns[1], + wiz_netinfo.dns[2], wiz_netinfo.dns[3]); + KPrintf("======================\r\n"); +} +SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), + ifconfig, ifconfig, printf w5500 configurations); + +void char_arr_assign(uint8_t *dst, uint32_t *src, int len) { + for (int i = 0; i < len; ++i) { + dst[i] = (uint8_t)(src[i]); + } +} + +char *network_param_name[] = {"ip", "sn", "gw"}; + +void config_w5500_network(int argc, char *argv[]) { + if (argc < 2) { + KPrintf("[W5500] Network config require params.\n"); + return; + } + + wiz_NetInfo wiz_netinfo; + memcpy(&wiz_netinfo, get_gnetinfo(), sizeof(wiz_NetInfo)); + + int cur_arg_idx = 1; + + while (argv[cur_arg_idx] != NULL) { + if (argv[cur_arg_idx + 1] == NULL) { + KPrintf("[W5500] Network config %s requires value.\n", argv[cur_arg_idx]); + return; + } + uint32_t tmp_arr[4]; + sscanf(argv[cur_arg_idx + 1], "%d.%d.%d.%d", &tmp_arr[0], &tmp_arr[1], + &tmp_arr[2], &tmp_arr[3]); + if (memcmp(argv[cur_arg_idx], network_param_name[0], 2 * sizeof(char)) == + 0) { + char_arr_assign(wiz_netinfo.ip, tmp_arr, 4); + } else if (memcmp(argv[cur_arg_idx], network_param_name[1], + 2 * sizeof(char)) == 0) { + char_arr_assign(wiz_netinfo.sn, tmp_arr, 4); + } else if (memcmp(argv[cur_arg_idx], network_param_name[2], + 2 * sizeof(char)) == 0) { + char_arr_assign(wiz_netinfo.gw, tmp_arr, 4); + } else { + KPrintf("[W5500] Invalid network param.\n"); + } + cur_arg_idx += 2; + } + + ctlnetwork(CN_SET_NETINFO, (void *)&wiz_netinfo); + KPrintf("[W5500] Network config success.\n", argv[cur_arg_idx]); + ifconfig(); +} +SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), + config_w5500_network, config_w5500_network, + set w5500 configurations); \ No newline at end of file diff --git a/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/wiz_iperf.c b/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/wiz_iperf.c index 3c4daa75f..3b1647c0f 100644 --- a/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/wiz_iperf.c +++ b/Ubiquitous/XiZi_IIoT/board/edu-riscv64/third_party_driver/ethernet/wiz_iperf.c @@ -462,4 +462,4 @@ __usage: SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), iperf, iperf, iperf throughput test); -#endif \ No newline at end of file +#endif diff --git a/Ubiquitous/XiZi_IIoT/board/gd32vf103-rvstar/.defconfig b/Ubiquitous/XiZi_IIoT/board/gd32vf103-rvstar/.defconfig index 9d6d6b972..165bf6a29 100644 --- a/Ubiquitous/XiZi_IIoT/board/gd32vf103-rvstar/.defconfig +++ b/Ubiquitous/XiZi_IIoT/board/gd32vf103-rvstar/.defconfig @@ -181,9 +181,9 @@ CONFIG_FS_VFS=n # 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_ADD_XIZI_FEATURES=y +# CONFIG_ADD_NUTTX_FEATURES is not set +# CONFIG_ADD_RTTHREAD_FEATURES is not set # CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set # CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set # CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set diff --git a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/.defconfig b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/.defconfig index 761c3df3d..aff17c060 100644 --- a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/.defconfig +++ b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/.defconfig @@ -191,9 +191,9 @@ CONFIG_FS_VFS_FATFS=y # 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_ADD_XIZI_FEATURES=y +# CONFIG_ADD_NUTTX_FEATURES is not set +# CONFIG_ADD_RTTHREAD_FEATURES is not set # CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set # CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set # CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set diff --git a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/board.c b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/board.c index 9db4abf31..4abb10aac 100644 --- a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/board.c +++ b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/board.c @@ -78,6 +78,10 @@ Modification: #include #endif +#ifdef BSP_USING_LWIP +#include +#endif + extern void entry(void); extern int HwUsartInit(); @@ -209,6 +213,8 @@ struct InitSequenceDesc _board_init[] = #endif #ifdef BSP_USING_CAN { "can", HwCanInit }, +#endif +#ifdef BSP_USING_LWIP #endif { " NONE ", NONE }, }; diff --git a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/Kconfig b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/Kconfig index 8b1378917..64b081e23 100755 --- a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/Kconfig +++ b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/Kconfig @@ -1 +1,3 @@ - +config BSP_USING_ETH + bool + default y \ No newline at end of file diff --git a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/Makefile b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/Makefile index c1b8c3ab9..b63aff8c2 100755 --- a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/Makefile +++ b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/Makefile @@ -1,3 +1,3 @@ -SRC_FILES := ethernetif.c +SRC_FILES := ethernetif.c eth_driver.c include $(KERNEL_ROOT)/compiler.mk diff --git a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/eth_driver.c b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/eth_driver.c new file mode 100644 index 000000000..ea8cf81c3 --- /dev/null +++ b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/eth_driver.c @@ -0,0 +1,287 @@ +/** +* @file ethernetif.c +* @brief support hc32f4a0-board ethernetif function and register to Lwip +* @version 3.0 +* @author AIIT XUOS Lab +* @date 2022-12-05 +*/ + +#include +#include +#include +#include +#include +#include + +#include + +void eth_irq_handler(void) { + static x_base eth_irq_lock; + eth_irq_lock = DISABLE_INTERRUPT(); + + // handle irq + if (RESET != ETH_DMA_GetStatus(ETH_DMA_FLAG_RIS)) { + sys_sem_signal(get_eth_recv_sem()); + ETH_DMA_ClearStatus(ETH_DMA_FLAG_RIS | ETH_DMA_FLAG_NIS); + } + + ENABLE_INTERRUPT(eth_irq_lock); +} + +/** + * @brief In this function, the hardware should be initialized. + * @param netif The already initialized network interface structure for this ethernetif. + * @retval int32_t: + * - LL_OK: Initialize success + * - LL_ERR: Initialize failed + */ +int32_t low_level_init(struct netif *netif) +{ + int32_t i32Ret = LL_ERR; + stc_eth_init_t stcEthInit; + uint16_t u16RegVal; + + /* Enable ETH clock */ + FCG_Fcg1PeriphClockCmd(FCG1_PERIPH_ETHMAC, ENABLE); + /* Init Ethernet GPIO */ + Ethernet_GpioInit(); + /* Reset ETHERNET */ + (void)ETH_DeInit(); + /* Configure structure initialization */ + (void)ETH_CommStructInit(&EthHandle.stcCommInit); + (void)ETH_StructInit(&stcEthInit); + +#ifdef ETH_INTERFACE_RMII + EthHandle.stcCommInit.u32Interface = ETH_MAC_IF_RMII; +#else + EthHandle.stcCommInit.u32Interface = ETH_MAC_IF_MII; +#endif + // stcEthInit.stcMacInit.u32ReceiveAll = ETH_MAC_RX_ALL_ENABLE; + EthHandle.stcCommInit.u32ReceiveMode = ETH_RX_MD_INT; + // EthHandle.stcCommInit.u32ChecksumMode = ETH_MAC_CHECKSUM_MD_SW; + + // install irq + sys_sem_new(get_eth_recv_sem(), 0); + hc32_install_irq_handler(ð_irq_config, eth_irq_handler, ENABLE); + + /* Configure ethernet peripheral */ + if (LL_OK == ETH_Init(&EthHandle, &stcEthInit)) { + u8EthInitStatus = 1U; + i32Ret = LL_OK; + } + +#ifdef ETHERNET_LOOPBACK_TEST + /* Enable PHY loopback */ + (void)ETH_PHY_LoopBackCmd(&EthHandle, ENABLE); +#endif + + /* Initialize Tx Descriptors list: Chain Mode */ + (void)ETH_DMA_TxDescListInit(&EthHandle, EthDmaTxDscrTab, &EthTxBuff[0][0], ETH_TX_BUF_NUM); + /* Initialize Rx Descriptors list: Chain Mode */ + (void)ETH_DMA_RxDescListInit(&EthHandle, EthDmaRxDscrTab, &EthRxBuff[0][0], ETH_RX_BUF_NUM); + + /* set MAC hardware address length */ + netif->hwaddr_len = 6U; + /* set MAC hardware address */ + EthHandle.stcCommInit.u16AutoNego = ETH_AUTO_NEGO_DISABLE; + + netif->hwaddr[0] = (EthHandle.stcCommInit).au8MacAddr[0]; + netif->hwaddr[1] = (EthHandle.stcCommInit).au8MacAddr[1]; + netif->hwaddr[2] = (EthHandle.stcCommInit).au8MacAddr[2]; + netif->hwaddr[3] = (EthHandle.stcCommInit).au8MacAddr[3]; + netif->hwaddr[4] = (EthHandle.stcCommInit).au8MacAddr[4]; + netif->hwaddr[5] = (EthHandle.stcCommInit).au8MacAddr[5]; + /* maximum transfer unit */ + netif->mtu = 1500U; + + /* device capabilities */ + netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP; + + /* Enable MAC and DMA transmission and reception */ + (void)ETH_Start(); + + /* Configure PHY LED mode */ + u16RegVal = PHY_PAGE_ADDR_7; + (void)ETH_PHY_WriteReg(&EthHandle, PHY_PSR, u16RegVal); + (void)ETH_PHY_ReadReg(&EthHandle, PHY_P7_IWLFR, &u16RegVal); + MODIFY_REG16(u16RegVal, PHY_LED_SELECT, PHY_LED_SELECT_10); + (void)ETH_PHY_WriteReg(&EthHandle, PHY_P7_IWLFR, u16RegVal); + u16RegVal = PHY_PAGE_ADDR_0; + (void)ETH_PHY_WriteReg(&EthHandle, PHY_PSR, u16RegVal); + +#ifdef ETH_INTERFACE_RMII + /* Disable Power Saving Mode */ + (void)ETH_PHY_ReadReg(&EthHandle, PHY_PSMR, &u16RegVal); + CLR_REG16_BIT(u16RegVal, PHY_EN_PWR_SAVE); + (void)ETH_PHY_WriteReg(&EthHandle, PHY_PSMR, u16RegVal); + + /* Configure PHY to generate an interrupt when Eth Link state changes */ + u16RegVal = PHY_PAGE_ADDR_7; + (void)ETH_PHY_WriteReg(&EthHandle, PHY_PSR, u16RegVal); + /* Enable Interrupt on change of link status */ + (void)ETH_PHY_ReadReg(&EthHandle, PHY_P7_IWLFR, &u16RegVal); + SET_REG16_BIT(u16RegVal, PHY_INT_LINK_CHANGE); + (void)ETH_PHY_WriteReg(&EthHandle, PHY_P7_IWLFR, u16RegVal); + u16RegVal = PHY_PAGE_ADDR_0; + (void)ETH_PHY_WriteReg(&EthHandle, PHY_PSR, u16RegVal); +#endif + + return i32Ret; +} + +/** + * @brief This function should do the actual transmission of the packet. + * @param netif The network interface structure for this ethernetif. + * @param p The MAC packet to send. + * @retval int32_t: + * - LL_OK: The packet could be sent + * - LL_ERR: The packet couldn't be sent + */ +err_t low_level_output(struct netif *netif, struct pbuf *p) +{ + err_t i32Ret; + struct pbuf *q; + uint8_t *txBuffer; + __IO stc_eth_dma_desc_t *DmaTxDesc; + uint32_t byteCnt; + uint32_t frameLength = 0UL; + uint32_t bufferOffset; + uint32_t payloadOffset; + + DmaTxDesc = EthHandle.stcTxDesc; + txBuffer = (uint8_t *)((EthHandle.stcTxDesc)->u32Buf1Addr); + bufferOffset = 0UL; + /* Copy frame from pbufs to driver buffers */ + for (q = p; q != NULL; q = q->next) { + /* If this buffer isn't available, goto error */ + if (0UL != (DmaTxDesc->u32ControlStatus & ETH_DMA_TXDESC_OWN)) { + i32Ret = (err_t)ERR_USE; + goto error; + } + + /* Get bytes in current buffer */ + byteCnt = q->len; + payloadOffset = 0UL; + /* Check if the length of data to copy is bigger than Tx buffer size */ + while ((byteCnt + bufferOffset) > ETH_TX_BUF_SIZE) { + /* Copy data to Tx buffer*/ + (void)memcpy((uint8_t *) & (txBuffer[bufferOffset]), (uint8_t *) & (((uint8_t *)q->payload)[payloadOffset]), (ETH_TX_BUF_SIZE - bufferOffset)); + /* Point to next descriptor */ + DmaTxDesc = (stc_eth_dma_desc_t *)(DmaTxDesc->u32Buf2NextDescAddr); + /* Check if the buffer is available */ + if (0UL != (DmaTxDesc->u32ControlStatus & ETH_DMA_TXDESC_OWN)) { + i32Ret = (err_t)ERR_USE; + goto error; + } + + txBuffer = (uint8_t *)(DmaTxDesc->u32Buf1Addr); + byteCnt = byteCnt - (ETH_TX_BUF_SIZE - bufferOffset); + payloadOffset = payloadOffset + (ETH_TX_BUF_SIZE - bufferOffset); + frameLength = frameLength + (ETH_TX_BUF_SIZE - bufferOffset); + bufferOffset = 0UL; + } + /* Copy the remaining bytes */ + (void)memcpy((uint8_t *) & (txBuffer[bufferOffset]), (uint8_t *) & (((uint8_t *)q->payload)[payloadOffset]), byteCnt); + bufferOffset = bufferOffset + byteCnt; + frameLength = frameLength + byteCnt; + } + /* Prepare transmit descriptors to give to DMA */ + if(LL_OK != ETH_DMA_SetTransFrame(&EthHandle, frameLength)) { + KPrintf("[%s] Error sending eth DMA frame\n", __func__); + } + i32Ret = (err_t)ERR_OK; + +error: + /* When Transmit Underflow flag is set, clear it and issue a Transmit Poll Demand to resume transmission */ + if (RESET != ETH_DMA_GetStatus(ETH_DMA_FLAG_UNS)) { + /* Clear DMA UNS flag */ + ETH_DMA_ClearStatus(ETH_DMA_FLAG_UNS); + /* Resume DMA transmission */ + WRITE_REG32(CM_ETH->DMA_TXPOLLR, 0UL); + } + + return i32Ret; +} + +/** + * @brief Should allocate a pbuf and transfer the bytes of the incoming packet from the interface into the pbuf. + * @param netif The network interface structure for this ethernetif. + * @retval A pbuf filled with the received packet (including MAC header) or NULL on memory error. + */ +struct pbuf *low_level_input(struct netif *netif) +{ + struct pbuf *p = NULL; + struct pbuf *q; + uint32_t len; + uint8_t *rxBuffer; + __IO stc_eth_dma_desc_t *DmaRxDesc; + uint32_t byteCnt; + uint32_t bufferOffset; + uint32_t payloadOffset; + uint32_t i; + + /* Get received frame */ + if (LL_OK != ETH_DMA_GetReceiveFrame(&EthHandle)) { + return NULL; + } + + /* Obtain the size of the packet */ + len = (EthHandle.stcRxFrame).u32Len; + rxBuffer = (uint8_t *)(EthHandle.stcRxFrame).u32Buf; + if (len > 0UL) { + /* Allocate a pbuf chain of pbufs from the buffer */ + p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL); + // p = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM); + } + if (p != NULL) { + DmaRxDesc = (EthHandle.stcRxFrame).pstcFSDesc; + bufferOffset = 0UL; + for (q = p; q != NULL; q = q->next) { + byteCnt = q->len; + payloadOffset = 0UL; + + /* Check if the length of bytes to copy in current pbuf is bigger than Rx buffer size */ + while ((byteCnt + bufferOffset) > ETH_RX_BUF_SIZE) { + /* Copy data to pbuf */ + (void)memcpy((uint8_t *) & (((uint8_t *)q->payload)[payloadOffset]), (uint8_t *) & (rxBuffer[bufferOffset]), (ETH_RX_BUF_SIZE - bufferOffset)); + /* Point to next descriptor */ + DmaRxDesc = (stc_eth_dma_desc_t *)(DmaRxDesc->u32Buf2NextDescAddr); + rxBuffer = (uint8_t *)(DmaRxDesc->u32Buf1Addr); + byteCnt = byteCnt - (ETH_RX_BUF_SIZE - bufferOffset); + payloadOffset = payloadOffset + (ETH_RX_BUF_SIZE - bufferOffset); + bufferOffset = 0UL; + } + + /* Copy remaining data in pbuf */ + (void)memcpy((uint8_t *) & (((uint8_t *)q->payload)[payloadOffset]), (uint8_t *) & (rxBuffer[bufferOffset]), byteCnt); + bufferOffset = bufferOffset + byteCnt; + } + } + /* Release descriptors to DMA */ + DmaRxDesc = (EthHandle.stcRxFrame).pstcFSDesc; + for (i = 0UL; i < (EthHandle.stcRxFrame).u32SegCount; i++) { + DmaRxDesc->u32ControlStatus |= ETH_DMA_RXDESC_OWN; + DmaRxDesc = (stc_eth_dma_desc_t *)(DmaRxDesc->u32Buf2NextDescAddr); + } + /* Clear Segment_Count */ + (EthHandle.stcRxFrame).u32SegCount = 0UL; + + /* When Rx Buffer unavailable flag is set, clear it and resume reception */ + if (RESET != ETH_DMA_GetStatus(ETH_DMA_FLAG_RUS)) { + /* Clear DMA RUS flag */ + ETH_DMA_ClearStatus(ETH_DMA_FLAG_RUS); + /* Resume DMA reception */ + WRITE_REG32(CM_ETH->DMA_RXPOLLR, 0UL); + } + + return p; +} + +extern void LwipSetIPTest(int argc, char *argv[]); +int HwEthInit(void) { +// lwip_config_tcp(0, lwip_ipaddr, lwip_netmask, lwip_gwaddr); + LwipSetIPTest(1, NULL); + return EOK; +} + + diff --git a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/ethernetif.c b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/ethernetif.c index 6658a96e2..c5d8fc1dd 100644 --- a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/ethernetif.c +++ b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/ethernet/ethernetif.c @@ -46,14 +46,15 @@ Modification: /******************************************************************************* * Include files ******************************************************************************/ -#include -#include +#include #include #include #include #include #include +#include + /** * @addtogroup HC32F4A0_DDL_Examples * @{ @@ -71,33 +72,7 @@ Modification: /******************************************************************************* * Local pre-processor symbols/macros ('#define') ******************************************************************************/ -/* Define those to better describe your network interface. */ -#define IFNAME0 'h' -#define IFNAME1 'd' -/* PHY hardware reset time */ -#define PHY_HW_RST_DELAY (0x40U) - -/* ETH_RST = PH11 */ -#define ETH_RST_PORT (GPIO_PORT_H) -#define ETH_RST_PIN (GPIO_PIN_11) - -/* ETH_LINK_LED = PD00 LED2 */ -#define ETH_LINK_LED_PORT (GPIO_PORT_D) -#define ETH_LINK_LED_PIN (GPIO_PIN_00) - -//#define ETHERNET_LOOPBACK_TEST -#ifdef ETHERNET_LOOPBACK_TEST - -#define USER_KEY_PORT (GPIO_PORT_I) -#define USER_KEY_PIN (GPIO_PIN_07) - -/* ethe global netif */ -static struct netif testnetif; -/* eth tx buffer */ -static struct pbuf txPbuf; -static char txBuf[] = "Ethernet Loop-Back Test"; -#endif /******************************************************************************* * Global variable definitions (declared in header file with 'extern') @@ -110,19 +85,7 @@ static char txBuf[] = "Ethernet Loop-Back Test"; /******************************************************************************* * Local variable definitions ('static') ******************************************************************************/ -/* Global Ethernet handle*/ -static stc_eth_handle_t EthHandle; -/* Ethernet Tx DMA Descriptor */ -__ALIGN_BEGIN static stc_eth_dma_desc_t EthDmaTxDscrTab[ETH_TX_BUF_NUM]; -/* Ethernet Rx DMA Descriptor */ -__ALIGN_BEGIN static stc_eth_dma_desc_t EthDmaRxDscrTab[ETH_RX_BUF_NUM]; -/* Ethernet Transmit Buffer */ -__ALIGN_BEGIN static uint8_t EthTxBuff[ETH_TX_BUF_NUM][ETH_TX_BUF_SIZE]; -/* Ethernet Receive Buffer */ -__ALIGN_BEGIN static uint8_t EthRxBuff[ETH_RX_BUF_NUM][ETH_RX_BUF_SIZE]; -/* Ethernet link status */ -static uint8_t u8PhyLinkStatus = 0U, u8EthInitStatus = 0U; /******************************************************************************* * Function implementation - global ('extern') and local ('static') @@ -132,22 +95,12 @@ static uint8_t u8PhyLinkStatus = 0U, u8EthInitStatus = 0U; * @{ */ -void *ethernetif_config_enet_set(uint8_t enet_port) -{ - return NONE; -} - -void Time_Update_LwIP(void) -{ - //no need to do -} - /** * @brief Initializes the Ethernet GPIO. * @param None * @retval None */ -static void Ethernet_GpioInit(void) +void Ethernet_GpioInit(void) { /* ETH_RST */ stc_gpio_init_t stcGpioInit; @@ -227,241 +180,12 @@ static void Ethernet_GpioInit(void) #endif } -/** - * @brief In this function, the hardware should be initialized. - * @param netif The already initialized network interface structure for this ethernetif. - * @retval int32_t: - * - LL_OK: Initialize success - * - LL_ERR: Initialize failed - */ -static int32_t low_level_init(struct netif *netif) -{ - int32_t i32Ret = LL_ERR; - stc_eth_init_t stcEthInit; - uint16_t u16RegVal; - - /* Enable ETH clock */ - FCG_Fcg1PeriphClockCmd(FCG1_PERIPH_ETHMAC, ENABLE); - /* Init Ethernet GPIO */ - Ethernet_GpioInit(); - /* Reset ETHERNET */ - (void)ETH_DeInit(); - /* Configure structure initialization */ - (void)ETH_CommStructInit(&EthHandle.stcCommInit); - (void)ETH_StructInit(&stcEthInit); -#ifdef ETH_INTERFACE_RMII - EthHandle.stcCommInit.u32Interface = ETH_MAC_IF_RMII; -#else - EthHandle.stcCommInit.u32Interface = ETH_MAC_IF_MII; -#endif - stcEthInit.stcMacInit.u32ReceiveAll = ETH_MAC_RX_ALL_ENABLE; - - /* Configure ethernet peripheral */ - if (LL_OK == ETH_Init(&EthHandle, &stcEthInit)) { - u8EthInitStatus = 1U; - i32Ret = LL_OK; - } - -#ifdef ETHERNET_LOOPBACK_TEST - /* Enable PHY loopback */ - (void)ETH_PHY_LoopBackCmd(&EthHandle, ENABLE); -#endif - - /* Initialize Tx Descriptors list: Chain Mode */ - (void)ETH_DMA_TxDescListInit(&EthHandle, EthDmaTxDscrTab, &EthTxBuff[0][0], ETH_TX_BUF_NUM); - /* Initialize Rx Descriptors list: Chain Mode */ - (void)ETH_DMA_RxDescListInit(&EthHandle, EthDmaRxDscrTab, &EthRxBuff[0][0], ETH_RX_BUF_NUM); - - /* set MAC hardware address length */ - netif->hwaddr_len = 6U; - /* set MAC hardware address */ - netif->hwaddr[0] = (EthHandle.stcCommInit).au8MacAddr[0]; - netif->hwaddr[1] = (EthHandle.stcCommInit).au8MacAddr[1]; - netif->hwaddr[2] = (EthHandle.stcCommInit).au8MacAddr[2]; - netif->hwaddr[3] = (EthHandle.stcCommInit).au8MacAddr[3]; - netif->hwaddr[4] = (EthHandle.stcCommInit).au8MacAddr[4]; - netif->hwaddr[5] = (EthHandle.stcCommInit).au8MacAddr[5]; - /* maximum transfer unit */ - netif->mtu = 1500U; - - /* device capabilities */ - netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP; - - /* Enable MAC and DMA transmission and reception */ - (void)ETH_Start(); - - /* Configure PHY LED mode */ - u16RegVal = PHY_PAGE_ADDR_7; - (void)ETH_PHY_WriteReg(&EthHandle, PHY_PSR, u16RegVal); - (void)ETH_PHY_ReadReg(&EthHandle, PHY_P7_IWLFR, &u16RegVal); - MODIFY_REG16(u16RegVal, PHY_LED_SELECT, PHY_LED_SELECT_10); - (void)ETH_PHY_WriteReg(&EthHandle, PHY_P7_IWLFR, u16RegVal); - u16RegVal = PHY_PAGE_ADDR_0; - (void)ETH_PHY_WriteReg(&EthHandle, PHY_PSR, u16RegVal); - -#ifdef ETH_INTERFACE_RMII - /* Disable Power Saving Mode */ - (void)ETH_PHY_ReadReg(&EthHandle, PHY_PSMR, &u16RegVal); - CLR_REG16_BIT(u16RegVal, PHY_EN_PWR_SAVE); - (void)ETH_PHY_WriteReg(&EthHandle, PHY_PSMR, u16RegVal); - - /* Configure PHY to generate an interrupt when Eth Link state changes */ - u16RegVal = PHY_PAGE_ADDR_7; - (void)ETH_PHY_WriteReg(&EthHandle, PHY_PSR, u16RegVal); - /* Enable Interrupt on change of link status */ - (void)ETH_PHY_ReadReg(&EthHandle, PHY_P7_IWLFR, &u16RegVal); - SET_REG16_BIT(u16RegVal, PHY_INT_LINK_CHANGE); - (void)ETH_PHY_WriteReg(&EthHandle, PHY_P7_IWLFR, u16RegVal); - u16RegVal = PHY_PAGE_ADDR_0; - (void)ETH_PHY_WriteReg(&EthHandle, PHY_PSR, u16RegVal); -#endif - - return i32Ret; +void *ethernetif_config_enet_set(uint8_t enet_port) { + return NONE; } -/** - * @brief This function should do the actual transmission of the packet. - * @param netif The network interface structure for this ethernetif. - * @param p The MAC packet to send. - * @retval int32_t: - * - LL_OK: The packet could be sent - * - LL_ERR: The packet couldn't be sent - */ -err_t low_level_output(struct netif *netif, struct pbuf *p) -{ - err_t i32Ret; - struct pbuf *q; - uint8_t *txBuffer; - __IO stc_eth_dma_desc_t *DmaTxDesc; - uint32_t byteCnt; - uint32_t frameLength = 0UL; - uint32_t bufferOffset; - uint32_t payloadOffset; - - DmaTxDesc = EthHandle.stcTxDesc; - txBuffer = (uint8_t *)((EthHandle.stcTxDesc)->u32Buf1Addr); - bufferOffset = 0UL; - /* Copy frame from pbufs to driver buffers */ - for (q = p; q != NULL; q = q->next) { - /* If this buffer isn't available, goto error */ - if (0UL != (DmaTxDesc->u32ControlStatus & ETH_DMA_TXDESC_OWN)) { - i32Ret = LL_ERR; - goto error; - } - - /* Get bytes in current buffer */ - byteCnt = q->len; - payloadOffset = 0UL; - /* Check if the length of data to copy is bigger than Tx buffer size */ - while ((byteCnt + bufferOffset) > ETH_TX_BUF_SIZE) { - /* Copy data to Tx buffer*/ - (void)memcpy((uint8_t *) & (txBuffer[bufferOffset]), (uint8_t *) & (((uint8_t *)q->payload)[payloadOffset]), (ETH_TX_BUF_SIZE - bufferOffset)); - /* Point to next descriptor */ - DmaTxDesc = (stc_eth_dma_desc_t *)(DmaTxDesc->u32Buf2NextDescAddr); - /* Check if the buffer is available */ - if (0UL != (DmaTxDesc->u32ControlStatus & ETH_DMA_TXDESC_OWN)) { - i32Ret = LL_ERR; - goto error; - } - - txBuffer = (uint8_t *)(DmaTxDesc->u32Buf1Addr); - byteCnt = byteCnt - (ETH_TX_BUF_SIZE - bufferOffset); - payloadOffset = payloadOffset + (ETH_TX_BUF_SIZE - bufferOffset); - frameLength = frameLength + (ETH_TX_BUF_SIZE - bufferOffset); - bufferOffset = 0UL; - } - /* Copy the remaining bytes */ - (void)memcpy((uint8_t *) & (txBuffer[bufferOffset]), (uint8_t *) & (((uint8_t *)q->payload)[payloadOffset]), byteCnt); - bufferOffset = bufferOffset + byteCnt; - frameLength = frameLength + byteCnt; - } - /* Prepare transmit descriptors to give to DMA */ - (void)ETH_DMA_SetTransFrame(&EthHandle, frameLength); - i32Ret = LL_OK; - -error: - /* When Transmit Underflow flag is set, clear it and issue a Transmit Poll Demand to resume transmission */ - if (RESET != ETH_DMA_GetStatus(ETH_DMA_FLAG_UNS)) { - /* Clear DMA UNS flag */ - ETH_DMA_ClearStatus(ETH_DMA_FLAG_UNS); - /* Resume DMA transmission */ - WRITE_REG32(CM_ETH->DMA_TXPOLLR, 0UL); - } - - return i32Ret; -} - -/** - * @brief Should allocate a pbuf and transfer the bytes of the incoming packet from the interface into the pbuf. - * @param netif The network interface structure for this ethernetif. - * @retval A pbuf filled with the received packet (including MAC header) or NULL on memory error. - */ -static struct pbuf *low_level_input(struct netif *netif) -{ - struct pbuf *p = NULL; - struct pbuf *q; - uint32_t len; - uint8_t *rxBuffer; - __IO stc_eth_dma_desc_t *DmaRxDesc; - uint32_t byteCnt; - uint32_t bufferOffset; - uint32_t payloadOffset; - uint32_t i; - - /* Get received frame */ - if (LL_OK != ETH_DMA_GetReceiveFrame(&EthHandle)) { - return NULL; - } - - /* Obtain the size of the packet */ - len = (EthHandle.stcRxFrame).u32Len; - rxBuffer = (uint8_t *)(EthHandle.stcRxFrame).u32Buf; - if (len > 0UL) { - /* Allocate a pbuf chain of pbufs from the buffer */ - p = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM); - } - if (p != NULL) { - DmaRxDesc = (EthHandle.stcRxFrame).pstcFSDesc; - bufferOffset = 0UL; - for (q = p; q != NULL; q = q->next) { - byteCnt = q->len; - payloadOffset = 0UL; - - /* Check if the length of bytes to copy in current pbuf is bigger than Rx buffer size */ - while ((byteCnt + bufferOffset) > ETH_RX_BUF_SIZE) { - /* Copy data to pbuf */ - (void)memcpy((uint8_t *) & (((uint8_t *)q->payload)[payloadOffset]), (uint8_t *) & (rxBuffer[bufferOffset]), (ETH_RX_BUF_SIZE - bufferOffset)); - /* Point to next descriptor */ - DmaRxDesc = (stc_eth_dma_desc_t *)(DmaRxDesc->u32Buf2NextDescAddr); - rxBuffer = (uint8_t *)(DmaRxDesc->u32Buf1Addr); - byteCnt = byteCnt - (ETH_RX_BUF_SIZE - bufferOffset); - payloadOffset = payloadOffset + (ETH_RX_BUF_SIZE - bufferOffset); - bufferOffset = 0UL; - } - - /* Copy remaining data in pbuf */ - (void)memcpy((uint8_t *) & (((uint8_t *)q->payload)[payloadOffset]), (uint8_t *) & (rxBuffer[bufferOffset]), byteCnt); - bufferOffset = bufferOffset + byteCnt; - } - } - /* Release descriptors to DMA */ - DmaRxDesc = (EthHandle.stcRxFrame).pstcFSDesc; - for (i = 0UL; i < (EthHandle.stcRxFrame).u32SegCount; i++) { - DmaRxDesc->u32ControlStatus |= ETH_DMA_RXDESC_OWN; - DmaRxDesc = (stc_eth_dma_desc_t *)(DmaRxDesc->u32Buf2NextDescAddr); - } - /* Clear Segment_Count */ - (EthHandle.stcRxFrame).u32SegCount = 0UL; - - /* When Rx Buffer unavailable flag is set, clear it and resume reception */ - if (RESET != ETH_DMA_GetStatus(ETH_DMA_FLAG_RUS)) { - /* Clear DMA RUS flag */ - ETH_DMA_ClearStatus(ETH_DMA_FLAG_RUS); - /* Resume DMA reception */ - WRITE_REG32(CM_ETH->DMA_RXPOLLR, 0UL); - } - - return p; +void Time_Update_LwIP(void) { + //no need to do } /** @@ -485,8 +209,8 @@ err_t ethernetif_init(struct netif *netif) * You can instead declare your own function an call etharp_output() * from it if you have to do some checks before sending (e.g. if link * is available...) */ - netif->output = ðarp_output; - netif->linkoutput = &low_level_output; + netif->output = etharp_output; + netif->linkoutput = low_level_output; #endif /* initialize the hardware */ @@ -498,34 +222,38 @@ err_t ethernetif_init(struct netif *netif) * @param netif The network interface structure for this ethernetif. * @retval None */ -void ethernetif_input(struct netif *netif) +void ethernetif_input(void *netif_arg) { - err_t err; struct pbuf *p; + struct netif *netif = (struct netif *)netif_arg; + x_base critical_lock; /* Move received packet into a new pbuf */ - p = low_level_input(netif); - + while (1) { + sys_arch_sem_wait(get_eth_recv_sem(), WAITING_FOREVER); + while(1) { + p = low_level_input(netif); #ifndef ETHERNET_LOOPBACK_TEST - /* No packet could be read, silently ignore this */ - if (NULL == p) { - return; - } - - /* Entry point to the LwIP stack */ - err = netif->input(p, netif); - if (err != (err_t)ERR_OK) { - LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n")); - (void)pbuf_free(p); - } + /* Entry point to the LwIP stack */ + if (p != NULL) { + if (netif->input(p, netif) != ERR_OK) { + LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n")); + KPrintf("ethernetif_input: IP input error\n"); + pbuf_free(p); + p = NULL; + } + } else { + break; + } +#else + /* No packet could be read, silently ignore this */ + if (p != NULL) { + EthernetIF_InputCallback(netif, p); + free(p); + } #endif -#ifdef ETHERNET_LOOPBACK_TEST - /* No packet could be read, silently ignore this */ - if (p != NULL) { - EthernetIF_InputCallback(netif, p); - free(p); + } } -#endif } /** @@ -725,8 +453,7 @@ __WEAKDEF void EthernetIF_NotifyLinkChange(struct netif *netif) * @param p The MAC packet to receive * @retval None */ -__WEAKDEF void EthernetIF_InputCallback(struct netif *netif, struct pbuf *p) -{ +__WEAKDEF void EthernetIF_InputCallback(struct netif *netif, struct pbuf *p) { /* This is function could be implemented in user file when the callback is needed */ #ifdef ETHERNET_LOOPBACK_TEST if ((0 == (memcmp(p->payload, txPbuf.payload, p->len))) && (p->len == txPbuf.len)) { diff --git a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/include/connect_ethernet.h b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/include/connect_ethernet.h index 625c1d815..7fae45a9f 100644 --- a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/include/connect_ethernet.h +++ b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/include/connect_ethernet.h @@ -22,11 +22,49 @@ #define CONNECT_ETHERNET_H #include "hardware_ethernetif.h" +#include +#include +#include #ifdef __cplusplus extern "C" { #endif +struct hc32_irq_config +{ + IRQn_Type irq_num; + uint32_t irq_prio; + en_int_src_t int_src; +}; + +/* Global Ethernet handle*/ +static stc_eth_handle_t EthHandle; +/* Ethernet Tx DMA Descriptor */ +__ALIGN_BEGIN static stc_eth_dma_desc_t EthDmaTxDscrTab[ETH_TX_BUF_NUM]; +/* Ethernet Rx DMA Descriptor */ +__ALIGN_BEGIN static stc_eth_dma_desc_t EthDmaRxDscrTab[ETH_RX_BUF_NUM]; +/* Ethernet Transmit Buffer */ +__ALIGN_BEGIN static uint8_t EthTxBuff[ETH_TX_BUF_NUM][ETH_TX_BUF_SIZE]; +/* Ethernet Receive Buffer */ +__ALIGN_BEGIN static uint8_t EthRxBuff[ETH_RX_BUF_NUM][ETH_RX_BUF_SIZE]; + +/* Ethernet link status */ +static uint8_t u8PhyLinkStatus = 0U, u8EthInitStatus = 0U; + +static struct Hc32IrqConfig eth_irq_config = { + .irq_num = BSP_ETH_IRQ_NUM, + .irq_prio = BSP_ETH_IRQ_PRIO, + .int_src = INT_SRC_ETH_GLB_INT, +}; + +void Ethernet_GpioInit(void); +int32_t low_level_init(struct netif *netif); +err_t low_level_output(struct netif *netif, struct pbuf *p); +struct pbuf *low_level_input(struct netif *netif); + +int HwEthInit(void); + + #ifdef __cplusplus } #endif diff --git a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/include/hardware_ethernetif.h b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/include/hardware_ethernetif.h index e07b5495e..a366fd075 100644 --- a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/include/hardware_ethernetif.h +++ b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/include/hardware_ethernetif.h @@ -133,9 +133,37 @@ extern "C" * @addtogroup ETH_IF_Global_Functions * @{ */ +/* Define those to better describe your network interface. */ +#define IFNAME0 'h' +#define IFNAME1 'd' + +/* PHY hardware reset time */ +#define PHY_HW_RST_DELAY (0x40U) + +/* ETH_RST = PH11 */ +#define ETH_RST_PORT (GPIO_PORT_H) +#define ETH_RST_PIN (GPIO_PIN_11) + +/* ETH_LINK_LED = PD00 LED2 */ +#define ETH_LINK_LED_PORT (GPIO_PORT_D) +#define ETH_LINK_LED_PIN (GPIO_PIN_00) + +//#define ETHERNET_LOOPBACK_TEST +#ifdef ETHERNET_LOOPBACK_TEST + +#define USER_KEY_PORT (GPIO_PORT_I) +#define USER_KEY_PIN (GPIO_PIN_07) + +/* ethe global netif */ +static struct netif testnetif; +/* eth tx buffer */ +static struct pbuf txPbuf; +static char txBuf[] = "Ethernet Loop-Back Test"; +#endif + err_t ethernetif_init(struct netif *netif); -void ethernetif_input(struct netif *netif); -err_t low_level_output(struct netif *netif, struct pbuf *p); +void ethernetif_input(void *netif); +// err_t low_level_output(struct netif *netif, struct pbuf *p); void EthernetIF_CheckLink(struct netif *netif); void EthernetIF_UpdateLink(struct netif *netif); diff --git a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/timer/connect_hwtimer.c b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/timer/connect_hwtimer.c index d753db2c6..37ad87ec6 100644 --- a/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/timer/connect_hwtimer.c +++ b/Ubiquitous/XiZi_IIoT/board/hc32f4a0/third_party_driver/timer/connect_hwtimer.c @@ -163,7 +163,7 @@ static int BoardHwtimerDevBend(void) return ret; } -/*K210 BOARD HWTIMER INIT*/ +/*HC32F4A0 BOARD HWTIMER INIT*/ int HwTimerInit(void) { x_err_t ret = EOK; diff --git a/Ubiquitous/XiZi_IIoT/board/imxrt1176-sbc/third_party_driver/ethernet/Kconfig b/Ubiquitous/XiZi_IIoT/board/imxrt1176-sbc/third_party_driver/ethernet/Kconfig index 5753d8854..7e37be3cd 100755 --- a/Ubiquitous/XiZi_IIoT/board/imxrt1176-sbc/third_party_driver/ethernet/Kconfig +++ b/Ubiquitous/XiZi_IIoT/board/imxrt1176-sbc/third_party_driver/ethernet/Kconfig @@ -6,3 +6,6 @@ config BOARD_NETWORK_USE_1G_ENET_PORT bool "Enable 1000M Enet Port" default y +config LWIP_REASSEMBLY_FRAG + bool + default y \ No newline at end of file diff --git a/Ubiquitous/XiZi_IIoT/board/imxrt1176-sbc/third_party_driver/ethernet/enet_ethernetif.c b/Ubiquitous/XiZi_IIoT/board/imxrt1176-sbc/third_party_driver/ethernet/enet_ethernetif.c index 641c66436..b7bf34f03 100644 --- a/Ubiquitous/XiZi_IIoT/board/imxrt1176-sbc/third_party_driver/ethernet/enet_ethernetif.c +++ b/Ubiquitous/XiZi_IIoT/board/imxrt1176-sbc/third_party_driver/ethernet/enet_ethernetif.c @@ -211,9 +211,10 @@ void ethernetif_phy_init(struct ethernetif *ethernetif, * * @param netif the lwip network interface structure for this ethernetif */ -void ethernetif_input(struct netif *netif) +void ethernetif_input(void *netif_arg) { struct pbuf *p; + struct netif *netif = (struct netif *)netif_arg; LWIP_ASSERT("netif != NULL", (netif != NULL)); diff --git a/Ubiquitous/XiZi_IIoT/board/imxrt1176-sbc/third_party_driver/include/enet_ethernetif.h b/Ubiquitous/XiZi_IIoT/board/imxrt1176-sbc/third_party_driver/include/enet_ethernetif.h index ca5ade06b..6c552e28c 100644 --- a/Ubiquitous/XiZi_IIoT/board/imxrt1176-sbc/third_party_driver/include/enet_ethernetif.h +++ b/Ubiquitous/XiZi_IIoT/board/imxrt1176-sbc/third_party_driver/include/enet_ethernetif.h @@ -159,7 +159,7 @@ err_t ethernetif1_init(struct netif *netif); * * @param netif the lwip network interface structure for this ethernetif */ -void ethernetif_input( struct netif *netif); +void ethernetif_input( void *netif_arg); int ETH_BSP_Config(void); void *ethernetif_config_enet_set(uint8_t enet_port); diff --git a/Ubiquitous/XiZi_IIoT/board/ok1052-c/.defconfig b/Ubiquitous/XiZi_IIoT/board/ok1052-c/.defconfig index 555b84bcf..b46ec4679 100644 --- a/Ubiquitous/XiZi_IIoT/board/ok1052-c/.defconfig +++ b/Ubiquitous/XiZi_IIoT/board/ok1052-c/.defconfig @@ -223,9 +223,9 @@ CONFIG_FS_VFS_FATFS=y # 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_ADD_XIZI_FEATURES=y +# CONFIG_ADD_NUTTX_FEATURES is not set +# CONFIG_ADD_RTTHREAD_FEATURES is not set # CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set # CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set # CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set diff --git a/Ubiquitous/XiZi_IIoT/board/ok1052-c/third_party_driver/ethernet/enet_ethernetif.c b/Ubiquitous/XiZi_IIoT/board/ok1052-c/third_party_driver/ethernet/enet_ethernetif.c index 764637188..47039f742 100755 --- a/Ubiquitous/XiZi_IIoT/board/ok1052-c/third_party_driver/ethernet/enet_ethernetif.c +++ b/Ubiquitous/XiZi_IIoT/board/ok1052-c/third_party_driver/ethernet/enet_ethernetif.c @@ -198,9 +198,10 @@ void ethernetif_phy_init(struct ethernetif *ethernetif, * @param netif the lwip network interface structure for this ethernetif */ -void ethernetif_input(struct netif *netif) +void ethernetif_input(void *netif_arg) { struct pbuf *p; + struct netif *netif = (struct netif *)netif_arg; err_t ret = 0; LWIP_ASSERT("netif != NULL", (netif != NULL)); diff --git a/Ubiquitous/XiZi_IIoT/board/ok1052-c/third_party_driver/include/enet_ethernetif.h b/Ubiquitous/XiZi_IIoT/board/ok1052-c/third_party_driver/include/enet_ethernetif.h index 1a8abf2ab..7b8c20c95 100755 --- a/Ubiquitous/XiZi_IIoT/board/ok1052-c/third_party_driver/include/enet_ethernetif.h +++ b/Ubiquitous/XiZi_IIoT/board/ok1052-c/third_party_driver/include/enet_ethernetif.h @@ -179,7 +179,7 @@ err_t ethernetif1_init(struct netif *netif); * * @param netif the lwip network interface structure for this ethernetif */ -void ethernetif_input( struct netif *netif); +void ethernetif_input( void *netif_arg); void ETH_BSP_Config(void); void *ethernetif_config_enet_set(uint8_t enet_port); diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/.defconfig b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/.defconfig index 5717d7a8f..18029b242 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/.defconfig +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/.defconfig @@ -227,9 +227,9 @@ CONFIG_FS_VFS_FATFS=y # 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_ADD_XIZI_FEATURES=y +# CONFIG_ADD_NUTTX_FEATURES is not set +# CONFIG_ADD_RTTHREAD_FEATURES is not set # CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set # CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set # CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ethernet/enet_ethernetif.c b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ethernet/enet_ethernetif.c index 1b32163dd..292ee307b 100755 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ethernet/enet_ethernetif.c +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/ethernet/enet_ethernetif.c @@ -201,9 +201,10 @@ void ethernetif_phy_init(struct ethernetif *ethernetif, * @param netif the lwip network interface structure for this ethernetif */ -void ethernetif_input(struct netif *netif) +void ethernetif_input(void *netif_arg) { struct pbuf *p; + struct netif *netif = (struct netif *)netif_arg; err_t ret = 0; LWIP_ASSERT("netif != NULL", (netif != NULL)); diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/enet_ethernetif.h b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/enet_ethernetif.h index fc96b93a2..7978b36b6 100755 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/enet_ethernetif.h +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-arm32/third_party_driver/include/enet_ethernetif.h @@ -179,7 +179,7 @@ err_t ethernetif1_init(struct netif *netif); * * @param netif the lwip network interface structure for this ethernetif */ -void ethernetif_input( struct netif *netif); +void ethernetif_input( void *netif_arg); int ETH_BSP_Config(void); void *ethernetif_config_enet_set(uint8_t enet_port); diff --git a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/.defconfig b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/.defconfig index 3c7407613..fb21f4d68 100644 --- a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/.defconfig +++ b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/.defconfig @@ -223,9 +223,9 @@ CONFIG_FS_VFS_FATFS=y # 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_ADD_XIZI_FEATURES=y +# CONFIG_ADD_NUTTX_FEATURES is not set +# CONFIG_ADD_RTTHREAD_FEATURES is not set # CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set # CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set # CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set diff --git a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/config.mk b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/config.mk index 53f596df6..a9bcb3314 100644 --- a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/config.mk +++ b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/config.mk @@ -5,15 +5,29 @@ export AFLAGS := -c -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections ### if use USB function, use special lds file because USB uses ITCM -ifeq ($(CONFIG_BSP_USING_USB),y) -export LFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_xidatong.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link-usb.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 + +ifeq ($(CONFIG_RESOURCES_LWIP), y) +export LINK_LWIP := $(KERNEL_ROOT)/resources/ethernet/LwIP/liblwip.a +endif + +ifeq ($(CONFIG_MCUBOOT_BOOTLOADER),y) +export LFLAGS += -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-xiwangtong-arm32-boot.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link-bootloader.lds +else ifeq ($(CONFIG_MCUBOOT_APPLICATION),y) +export LFLAGS += -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-xiwangtong-arm32-app.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link-application.lds +else ifeq ($(CONFIG_BSP_USING_USB),y) +export LFLAGS += -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-xiwangtong-arm32.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link-usb.lds else -export LFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_xidatong.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds +export LFLAGS += -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-xiwangtong-arm32.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds endif export CXXFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -export APPLFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi_app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds +export APPLFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds export DEFINES := -DHAVE_CCONFIG_H -DCPU_MIMXRT1052CVL5B -DSKIP_SYSCLK_INIT -DEVK_MCIMXRM -DFSL_SDK_ENABLE_DRIVER_CACHE_CONTROL=1 -DXIP_EXTERNAL_FLASH=1 -D__STARTUP_INITIALIZE_NONCACHEDATA -D__STARTUP_CLEAR_BSS diff --git a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/include/board.h b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/include/board.h index 9e9e12d44..99deb8f14 100755 --- a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/include/board.h +++ b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/include/board.h @@ -51,6 +51,8 @@ void InitBoardHardware(void); /*! @brief The board name */ #define BOARD_NAME "IMXRT1050" +#define configMAC_ADDR {0x02, 0x12, 0x13, 0x10, 0x15, 0x11} + #define NVIC_PRIORITYGROUP_0 0x00000007U /*!< 0 bits for pre-emption priority 4 bits for subpriority */ #define NVIC_PRIORITYGROUP_1 0x00000006U /*!< 1 bits for pre-emption priority diff --git a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/ethernet/enet_ethernetif.c b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/ethernet/enet_ethernetif.c index 31d211a37..292ee307b 100755 --- a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/ethernet/enet_ethernetif.c +++ b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/ethernet/enet_ethernetif.c @@ -66,7 +66,7 @@ #include "netif/ethernet.h" #include "enet_ethernetif.h" #include "enet_ethernetif_priv.h" - +#include #include "fsl_enet.h" #include "fsl_phy.h" #include "fsl_gpio.h" @@ -92,6 +92,20 @@ void Time_Update_LwIP(void) { } +ethernetif_config_t enet_cfg = { + .phyAddress = BOARD_ENET0_PHY_ADDRESS, + .clockName = kCLOCK_CoreSysClk, + .macAddress = configMAC_ADDR, +#if defined(FSL_FEATURE_SOC_LPC_ENET_COUNT) && (FSL_FEATURE_SOC_LPC_ENET_COUNT > 0) + .non_dma_memory = non_dma_memory, +#endif /* FSL_FEATURE_SOC_LPC_ENET_COUNT */ +}; + +void *ethernetif_config_enet_set(uint8_t enet_port) +{ + return (void *)&enet_cfg; +} + void ethernetif_clk_init(void) { const clock_enet_pll_config_t config = {.enableClkOutput = true, .enableClkOutput25M = false, .loopDivider = 1}; @@ -113,7 +127,7 @@ void ethernetif_gpio_init(void) GPIO_WritePinOutput(GPIO1, 3, 1); } -void ETH_BSP_Config(void) +int ETH_BSP_Config(void) { static int flag = 0; if(flag == 0) @@ -122,6 +136,7 @@ void ETH_BSP_Config(void) ethernetif_gpio_init(); flag = 1; } + return 0; } void ethernetif_phy_init(struct ethernetif *ethernetif, @@ -186,9 +201,10 @@ void ethernetif_phy_init(struct ethernetif *ethernetif, * @param netif the lwip network interface structure for this ethernetif */ -void ethernetif_input(struct netif *netif) +void ethernetif_input(void *netif_arg) { struct pbuf *p; + struct netif *netif = (struct netif *)netif_arg; err_t ret = 0; LWIP_ASSERT("netif != NULL", (netif != NULL)); diff --git a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/include/connect_ethernet.h b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/include/connect_ethernet.h index 376c004fe..49f92d4c8 100755 --- a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/include/connect_ethernet.h +++ b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/include/connect_ethernet.h @@ -21,11 +21,13 @@ #ifndef __CONNECT_ETHERNET_H_ #define __CONNECT_ETHERNET_H_ +#include "enet_ethernetif.h" +#include "enet_ethernetif_priv.h" + #ifdef __cplusplus extern "C" { #endif - #ifndef sourceClock #define sourceClock CLOCK_GetFreq(kCLOCK_CoreSysClk) #endif diff --git a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/include/enet_ethernetif.h b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/include/enet_ethernetif.h index 8416d75bc..7978b36b6 100755 --- a/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/include/enet_ethernetif.h +++ b/Ubiquitous/XiZi_IIoT/board/xiwangtong-arm32/third_party_driver/include/enet_ethernetif.h @@ -179,12 +179,14 @@ err_t ethernetif1_init(struct netif *netif); * * @param netif the lwip network interface structure for this ethernetif */ -void ethernetif_input( struct netif *netif); - -void ETH_BSP_Config(void); +void ethernetif_input( void *netif_arg); +int ETH_BSP_Config(void); +void *ethernetif_config_enet_set(uint8_t enet_port); int32 lwip_obtain_semaphore(struct netif *netif); +#define NETIF_ENET0_INIT_FUNC ethernetif0_init + #if defined(__cplusplus) } #endif /* __cplusplus */ diff --git a/Ubiquitous/XiZi_IIoT/path_app.mk b/Ubiquitous/XiZi_IIoT/path_app.mk index 131191ffb..78427f764 100644 --- a/Ubiquitous/XiZi_IIoT/path_app.mk +++ b/Ubiquitous/XiZi_IIoT/path_app.mk @@ -9,7 +9,7 @@ ifeq ($(CONFIG_APP_SELECT_NEWLIB), y) endif -ifeq ($(CONFIG_ADD_XIZI_FETURES), y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES), y) APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xizi \ -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xizi/user_api/switch_api \ -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include # diff --git a/Ubiquitous/XiZi_IIoT/path_kernel.mk b/Ubiquitous/XiZi_IIoT/path_kernel.mk index 0d6b98ffa..028ee43e3 100755 --- a/Ubiquitous/XiZi_IIoT/path_kernel.mk +++ b/Ubiquitous/XiZi_IIoT/path_kernel.mk @@ -436,18 +436,18 @@ KERNELPATHS +=-I$(KERNEL_ROOT)/fs/compatibility_ch376 # endif ifeq ($(CONFIG_TRANSFORM_LAYER_ATTRIUBUTE), y) -ifeq ($(CONFIG_ADD_XIZI_FETURES), y) +ifeq ($(CONFIG_ADD_XIZI_FEATURES), y) ifeq ($(CONFIG_LIB_MUSLLIB), ) KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xizi/user_api/posix_support/include # endif KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/transform_layer/xizi # endif -ifeq ($(CONFIG_ADD_NUTTX_FETURES), y) +ifeq ($(CONFIG_ADD_NUTTX_FEATURES), y) # endif -ifeq ($(CONFIG_ADD_RTTHREAD_FETURES), y) +ifeq ($(CONFIG_ADD_RTTHREAD_FEATURES), y) # endif @@ -533,6 +533,10 @@ KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_deviceno 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 + +ifeq ($(CONFIG_LIB_USING_LORAWAN_GATEWAY_SC),y) +KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/lib/lorawan/lorawan_gateway_single_channel/inc # +endif endif ifeq ($(CONFIG_CRYPTO), y) diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/Makefile b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/Makefile index 1c0cdf531..b59cbd62e 100644 --- a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/Makefile +++ b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/Makefile @@ -2,10 +2,12 @@ SRC_DIR += api SRC_DIR += arch SRC_DIR += core SRC_DIR += netif +SRC_DIR += apps LWIP_DIR += api LWIP_DIR += arch LWIP_DIR += core LWIP_DIR += netif +LWIP_DIR += apps include $(KERNEL_ROOT)/compiler.mk diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/apps/Makefile b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/apps/Makefile new file mode 100644 index 000000000..6f5f2913e --- /dev/null +++ b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/apps/Makefile @@ -0,0 +1,3 @@ +SRC_FILES += lwiperf/lwiperf.c http/http_client.c + +include $(KERNEL_ROOT)/compiler.mk diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/apps/http/http_client.c b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/apps/http/http_client.c index 82da60d73..9d6ca9cf3 100644 --- a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/apps/http/http_client.c +++ b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/apps/http/http_client.c @@ -64,7 +64,8 @@ * HTTPC_DEBUG: Enable debugging for HTTP client. */ #ifndef HTTPC_DEBUG -#define HTTPC_DEBUG LWIP_DBG_OFF +#define HTTPC_DEBUG LWIP_DBG_ON +// #define HTTPC_DEBUG LWIP_DBG_OFF #endif /** Set this to 1 to keep server name and uri in request state */ diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/lwipopts.h b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/lwipopts.h index 698afb121..6409f50f1 100644 --- a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/lwipopts.h +++ b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/lwipopts.h @@ -30,6 +30,195 @@ #ifndef __LWIPOPTS_H__ #define __LWIPOPTS_H__ +#include + +/* ---------- Debug options ---------- */ +#ifndef LWIP_DEBUG +#define LWIP_DEBUG 1 +#endif + +#ifdef LWIP_DEBUG +#ifdef LWIP_SYS_DEBUG +#define SYS_DEBUG LWIP_DBG_ON +#else +#define SYS_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_ETHARP_DEBUG +#define ETHARP_DEBUG LWIP_DBG_ON +#else +#define ETHARP_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_PPP_DEBUG +#define PPP_DEBUG LWIP_DBG_ON +#else +#define PPP_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_MEM_DEBUG +#define MEM_DEBUG LWIP_DBG_ON +#else +#define MEM_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_MEMP_DEBUG +#define MEMP_DEBUG LWIP_DBG_ON +#else +#define MEMP_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_PBUF_DEBUG +#define PBUF_DEBUG LWIP_DBG_ON +#else +#define PBUF_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_API_LIB_DEBUG +#define API_LIB_DEBUG LWIP_DBG_ON +#else +#define API_LIB_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_API_MSG_DEBUG +#define API_MSG_DEBUG LWIP_DBG_ON +#else +#define API_MSG_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_TCPIP_DEBUG +#define TCPIP_DEBUG LWIP_DBG_ON +#else +#define TCPIP_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_NETIF_DEBUG +#define NETIF_DEBUG LWIP_DBG_ON +#else +#define NETIF_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_SOCKETS_DEBUG +#define SOCKETS_DEBUG LWIP_DBG_ON +#else +#define SOCKETS_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_DNS_DEBUG +#define DNS_DEBUG LWIP_DBG_ON +#else +#define DNS_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_AUTOIP_DEBUG +#define AUTOIP_DEBUG LWIP_DBG_ON +#else +#define AUTOIP_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_DHCP_DEBUG +#define DHCP_DEBUG LWIP_DBG_ON +#else +#define DHCP_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_IP_DEBUG +#define IP_DEBUG LWIP_DBG_ON +#else +#define IP_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_IP_REASS_DEBUG +#define IP_REASS_DEBUG LWIP_DBG_ON +#else +#define IP_REASS_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_ICMP_DEBUG +#define ICMP_DEBUG LWIP_DBG_ON +#else +#define ICMP_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_IGMP_DEBUG +#define IGMP_DEBUG LWIP_DBG_ON +#else +#define IGMP_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_UDP_DEBUG +#define UDP_DEBUG LWIP_DBG_ON +#else +#define UDP_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_TCP_DEBUG +#define TCP_DEBUG LWIP_DBG_ON +#else +#define TCP_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_TCP_INPUT_DEBUG +#define TCP_INPUT_DEBUG LWIP_DBG_ON +#else +#define TCP_INPUT_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_TCP_OUTPUT_DEBUG +#define TCP_OUTPUT_DEBUG LWIP_DBG_ON +#else +#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_TCP_RTO_DEBUG +#define TCP_RTO_DEBUG LWIP_DBG_ON +#else +#define TCP_RTO_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_TCP_CWND_DEBUG +#define TCP_CWND_DEBUG LWIP_DBG_ON +#else +#define TCP_CWND_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_TCP_WND_DEBUG +#define TCP_WND_DEBUG LWIP_DBG_ON +#else +#define TCP_WND_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_TCP_FR_DEBUG +#define TCP_FR_DEBUG LWIP_DBG_ON +#else +#define TCP_FR_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_TCP_QLEN_DEBUG +#define TCP_QLEN_DEBUG LWIP_DBG_ON +#else +#define TCP_QLEN_DEBUG LWIP_DBG_OFF +#endif + +#ifdef LWIP_TCP_RST_DEBUG +#define TCP_RST_DEBUG LWIP_DBG_ON +#else +#define TCP_RST_DEBUG LWIP_DBG_OFF +#endif + +#endif /* LWIP_DEBUG */ + + +#define LWIP_TIMEVAL_PRIVATE 0 +#define LWIP_NO_UNISTD_H 0 +#define LWIP_NO_STDDEF_H 0 +#define LWIP_NO_STDINT_H 0 +#define LWIP_NO_INTTYPES_H 0 +#define LWIP_NO_LIMITS_H 0 +#define LWIP_NO_CTYPE_H 0 +#define LWIP_SOCKET_SELECT 1 +#define LWIP_SOCKET_POLL 1 + /** * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain * critical regions during buffer allocation, deallocation and memory @@ -57,35 +246,40 @@ /* MEM_SIZE: the size of the heap memory. If the application will send a lot of data that needs to be copied, this should be set high. */ -#define MEM_SIZE (25*1024) +#define MEM_SIZE (64*1024) /* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application sends a lot of data out of ROM (or other static memory), this should be set high. */ -#define MEMP_NUM_PBUF 15 +#define MEMP_NUM_PBUF 32 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One per active UDP "connection". */ #define MEMP_NUM_UDP_PCB 4 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. */ -#define MEMP_NUM_TCP_PCB 4 +#define MEMP_NUM_TCP_PCB 64 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. */ #define MEMP_NUM_TCP_PCB_LISTEN 2 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. */ -#define MEMP_NUM_TCP_SEG 20 +#define MEMP_NUM_TCP_SEG 256 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. */ -#define MEMP_NUM_SYS_TIMEOUT 6 - +// #define MEMP_NUM_SYS_TIMEOUT 6 +#define MEMP_NUM_SYS_TIMEOUT (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_SUPPORT + (LWIP_IPV6 ? (1 + (2*LWIP_IPV6)) : 0)) /* ---------- Pbuf options ---------- */ /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ -#define PBUF_POOL_SIZE 20 +#define PBUF_POOL_SIZE 255 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ +// #define PBUF_POOL_BUFSIZE 1024 #define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN) +/* ---------- ARP options ---------- */ +#define LWIP_ARP 1 +#define ARP_TABLE_SIZE 10 +#define ARP_QUEUEING 1 /* ---------- TCP options ---------- */ #define LWIP_TCP 1 @@ -93,7 +287,7 @@ a lot of data that needs to be copied, this should be set high. */ /* Controls if TCP should queue segments that arrive out of order. Define to 0 if your device is low on memory. */ -#define TCP_QUEUE_OOSEQ 0 +#define TCP_QUEUE_OOSEQ 1 /* TCP Maximum segment size. */ #define TCP_MSS (1500 - 40) /* TCP_MSS = (Ethernet MTU - IP header size - TCP header size) */ @@ -107,9 +301,69 @@ a lot of data that needs to be copied, this should be set high. */ #define TCP_SND_QUEUELEN (8* TCP_SND_BUF/TCP_MSS) /* TCP receive window. */ -#define TCP_WND (12*TCP_MSS) +#define TCP_WND 8192 +// #define TCP_WND (12 * TCP_MSS) +/* Maximum number of retransmissions of data segments. */ +#define TCP_MAXRTX 12 + +/* Maximum number of retransmissions of SYN segments. */ +#define TCP_SYNMAXRTX 4 + +/** + * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT + * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set + * in seconds. (does not require sockets.c, and will affect tcp.c) + */ +#ifndef LWIP_TCP_KEEPALIVE +#define LWIP_TCP_KEEPALIVE 1 +#endif + +/** + * LWIP_NETIF_HOSTNAME==1: Support netif hostname + */ +#ifndef LWIP_NETIF_HOSTNAME +#define LWIP_NETIF_HOSTNAME 1 +#endif + +/** + * LWIP_NETIF_API==1: Support netif api (in netifapi.c) + */ +#ifndef LWIP_NETIF_API +#define LWIP_NETIF_API 1 +#endif + +/** + * LWIP_SO_SNDTIMEO==1: Enable send timeout for sockets/netconns and + * SO_SNDTIMEO processing. + */ +#ifndef LWIP_SO_SNDTIMEO +#define LWIP_SO_SNDTIMEO 1 +#endif + +/** + * LWIP_SO_RCVTIMEO==1: Enable receive timeout for sockets/netconns and + * SO_RCVTIMEO processing. + */ +#ifndef LWIP_SO_RCVTIMEO +#define LWIP_SO_RCVTIMEO 1 +#endif + +/** + * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. + */ +#ifndef LWIP_SO_RCVBUF +#define LWIP_SO_RCVBUF 1 +#endif + +/** + * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize. + */ +#ifndef RECV_BUFSIZE_DEFAULT +#define RECV_BUFSIZE_DEFAULT 8192 +#endif + /* ---------- ICMP options ---------- */ #define LWIP_ICMP 1 @@ -127,7 +381,6 @@ a lot of data that needs to be copied, this should be set high. */ /* ---------- Statistics options ---------- */ -#define LWIP_STATS 0 #define LWIP_PROVIDE_ERRNO 1 /* ---------- link callback options ---------- */ @@ -146,7 +399,7 @@ The STM32F4x7 allows computing and verifying the IP, UDP, TCP and ICMP checksums - To use this feature let the following define uncommented. - To disable it and process by CPU comment the the checksum. */ -//#define CHECKSUM_BY_HARDWARE +#define CHECKSUM_BY_HARDWARE #ifdef CHECKSUM_BY_HARDWARE /* CHECKSUM_GEN_IP==0: Generate checksums by hardware for outgoing IP packets.*/ @@ -176,7 +429,7 @@ The STM32F4x7 allows computing and verifying the IP, UDP, TCP and ICMP checksums #define CHECKSUM_CHECK_UDP 1 /* CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.*/ #define CHECKSUM_CHECK_TCP 1 - /* CHECKSUM_CHECK_ICMP==1: Check checksums by hardware for incoming ICMP packets.*/ + /* CHECKSUM_CHECK_ICMP==1: Check checksums by software for incoming ICMP packets.*/ #define CHECKSUM_GEN_ICMP 1 #endif @@ -225,7 +478,50 @@ The STM32F4x7 allows computing and verifying the IP, UDP, TCP and ICMP checksums /** * LWIP_SO_LINGER==1: Enable SO_LINGER processing. */ -#define LWIP_SO_LINGER 1 +// #define LWIP_SO_LINGER 1 + +/* ---------- IP options ---------- */ +/* Define IP_FORWARD to 1 if you wish to have the ability to forward + IP packets across network interfaces. If you are going to run lwIP + on a device with only one network interface, define this to 0. */ +#define IP_FORWARD 0 + +/* IP reassembly and segmentation.These are orthogonal even + * if they both deal with IP fragments */ +#ifdef LWIP_REASSEMBLY_FRAG +#define IP_REASSEMBLY 1 +#define IP_FRAG 1 +#define IP_REASS_MAX_PBUFS 10 +#define MEMP_NUM_REASSDATA 10 +#else +#define IP_REASSEMBLY 0 +#define IP_FRAG 0 +#endif + +/* ---------- ICMP options ---------- */ +#define ICMP_TTL 255 + +/* ---------- DHCP options ---------- */ +/* Define LWIP_DHCP to 1 if you want DHCP configuration of + interfaces. */ +#define LWIP_DHCP 1 + +/* 1 if you want to do an ARP check on the offered address + (recommended). */ +#define DHCP_DOES_ARP_CHECK (LWIP_DHCP) + +/* ---------- AUTOIP options ------- */ +#define LWIP_AUTOIP 0 +#define LWIP_DHCP_AUTOIP_COOP (LWIP_DHCP && LWIP_AUTOIP) + + +#define LWIP_UDPLITE 0 +#define UDP_TTL 255 + + +/* ---------- Statistics options ---------- */ +#define LWIP_STATS 1 +#define LWIP_STATS_DISPLAY 1 /* --------------------------------- @@ -236,23 +532,21 @@ The STM32F4x7 allows computing and verifying the IP, UDP, TCP and ICMP checksums #define DEFAULT_RAW_RECVMBOX_SIZE 8 #define DEFAULT_UDP_RECVMBOX_SIZE 8 #define DEFAULT_TCP_RECVMBOX_SIZE 8 -#define DEFAULT_ACCEPTMBOX_SIZE 8 +#define DEFAULT_ACCEPTMBOX_SIZE 10 #define DEFAULT_THREAD_PRIO 20 #define DEFAULT_THREAD_STACKSIZE 1024 #define TCPIP_THREAD_NAME "tcp" -#define TCPIP_THREAD_STACKSIZE 8192 -#define TCPIP_MBOX_SIZE 8 -#define TCPIP_THREAD_PRIO 15 +#define TCPIP_THREAD_STACKSIZE 1024 +#define TCPIP_MBOX_SIZE 16 +#define TCPIP_THREAD_PRIO 20 /* ---------------------------------------- ---------- Lwip Debug options ---------- ---------------------------------------- */ -#define LWIP_DEBUG 1 - #define LWIP_IPV4 1 #define LWIP_RAW 1 #define LWIP_DNS 1 diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/sys_arch.c b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/sys_arch.c index c7cb3b07e..e491c5cb1 100644 --- a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/sys_arch.c +++ b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/sys_arch.c @@ -69,96 +69,58 @@ #include "ethernet.h" #include "connect_ethernet.h" -char lwip_ipaddr[20] = {192, 168, 131, 77}; +char lwip_ipaddr[20] = {192, 168, 130, 77}; char lwip_netmask[20] = {255, 255, 254, 0}; -char lwip_gwaddr[20] = {192, 168, 131, 23}; +char lwip_gwaddr[20] = {192, 168, 130, 1}; -char lwip_eth0_ipaddr[20] = {192, 168, 131, 77}; +char lwip_eth0_ipaddr[20] = {192, 168, 130, 77}; char lwip_eth0_netmask[20] = {255, 255, 254, 0}; -char lwip_eth0_gwaddr[20] = {192, 168, 131, 23}; +char lwip_eth0_gwaddr[20] = {192, 168, 130, 1}; -char lwip_eth1_ipaddr[20] = {192, 168, 131, 99}; +char lwip_eth1_ipaddr[20] = {192, 168, 130, 99}; char lwip_eth1_netmask[20] = {255, 255, 254, 0}; -char lwip_eth1_gwaddr[20] = {192, 168, 131, 23}; +char lwip_eth1_gwaddr[20] = {192, 168, 130, 23}; char lwip_flag = 0; x_ticks_t lwip_sys_now; -struct sys_timeouts { - struct sys_timeo *next; -}; - -struct timeoutlist -{ - struct sys_timeouts timeouts; - int32 pid; -}; - #define SYS_THREAD_MAX 4 -static struct timeoutlist s_timeoutlist[SYS_THREAD_MAX]; +struct netif gnetif; +sys_sem_t* get_eth_recv_sem() { + static sys_sem_t g_recv_sem = 0; + return &g_recv_sem; +} -static u16_t s_nextthread = 0; +void sys_init(void) { + // do nothing +} u32_t -sys_jiffies(void) -{ +sys_jiffies(void) { lwip_sys_now = CurrentTicksGain(); return lwip_sys_now; } u32_t -sys_now(void) -{ +sys_now(void) { lwip_sys_now = CurrentTicksGain(); - return lwip_sys_now; + return CalculateTimeMsFromTick(lwip_sys_now); } -void -sys_init(void) -{ - int i; - for(i = 0; i < SYS_THREAD_MAX; i++) - { - s_timeoutlist[i].pid = 0; - s_timeoutlist[i].timeouts.next = NULL; - } - s_nextthread = 0; -} - -struct sys_timeouts *sys_arch_timeouts(void) -{ - int i; - int32 pid; - struct timeoutlist *tl; - pid = (int32)GetKTaskDescriptor()->id.id; - for(i = 0; i < s_nextthread; i++) - { - tl = &(s_timeoutlist[i]); - if(tl->pid == pid) - { - return &(tl->timeouts); - } - } - return NULL; -} - -sys_prot_t sys_arch_protect(void) -{ +sys_prot_t sys_arch_protect(void) { return CriticalAreaLock(); } -void sys_arch_unprotect(sys_prot_t pval) -{ +void sys_arch_unprotect(sys_prot_t pval) { CriticalAreaUnLock(pval); } #if !NO_SYS err_t -sys_sem_new(sys_sem_t *sem, u8_t count) -{ +sys_sem_new(sys_sem_t *sem, u8_t count) { *sem = KSemaphoreCreate((uint16)count); #if SYS_STATS @@ -170,8 +132,7 @@ sys_sem_new(sys_sem_t *sem, u8_t count) if(*sem >= 0) return ERR_OK; - else - { + else { #if SYS_STATS ++lwip_stats.sys.sem.err; #endif /* SYS_STATS */ @@ -181,8 +142,7 @@ sys_sem_new(sys_sem_t *sem, u8_t count) } void -sys_sem_free(sys_sem_t *sem) -{ +sys_sem_free(sys_sem_t *sem) { #if SYS_STATS --lwip_stats.sys.sem.used; #endif /* SYS_STATS */ @@ -190,19 +150,16 @@ sys_sem_free(sys_sem_t *sem) *sem = SYS_SEM_NULL; } -int sys_sem_valid(sys_sem_t *sem) -{ +int sys_sem_valid(sys_sem_t *sem) { return (*sem > SYS_SEM_NULL); } void -sys_sem_set_invalid(sys_sem_t *sem) -{ +sys_sem_set_invalid(sys_sem_t *sem) { *sem = SYS_SEM_NULL; } -u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout) -{ +u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout) { x_ticks_t start_tick = 0 ; int32 wait_time = 0; @@ -220,61 +177,51 @@ u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout) if(KSemaphoreObtain(*sem, wait_time) == EOK) - return ((CurrentTicksGain()-start_tick)*MS_PER_SYSTICK); + return CalculateTimeMsFromTick(CurrentTicksGain()-start_tick); else return SYS_ARCH_TIMEOUT; } -void sys_sem_signal(sys_sem_t *sem) -{ - if(KSemaphoreAbandon( *sem ) != EOK) +void sys_sem_signal(sys_sem_t *sem) { + if(KSemaphoreAbandon(*sem) != EOK) KPrintf("[sys_arch]:sem signal fail!\n"); } -err_t sys_mutex_new(sys_mutex_t *mutex) -{ +err_t sys_mutex_new(sys_mutex_t *mutex) { *mutex = KMutexCreate(); - if(*mutex > SYS_MRTEX_NULL) + if (*mutex > SYS_MRTEX_NULL) return ERR_OK; - else - { + else { KPrintf("[sys_arch]:new mutex fail!\n"); return ERR_MEM; } } -void sys_mutex_free(sys_mutex_t *mutex) -{ +void sys_mutex_free(sys_mutex_t *mutex) { KMutexDelete(*mutex); } -void sys_mutex_set_invalid(sys_mutex_t *mutex) -{ +void sys_mutex_set_invalid(sys_mutex_t *mutex) { *mutex = SYS_MRTEX_NULL; } -void sys_mutex_lock(sys_mutex_t *mutex) -{ - KMutexObtain(*mutex, - WAITING_FOREVER); +void sys_mutex_lock(sys_mutex_t *mutex) { + KMutexObtain(*mutex, WAITING_FOREVER); } -void sys_mutex_unlock(sys_mutex_t *mutex) -{ - KMutexAbandon( *mutex ); +void sys_mutex_unlock(sys_mutex_t *mutex) { + KMutexAbandon(*mutex); } -sys_thread_t sys_thread_new(const char *name, lwip_thread_fn function, void *arg, int stacksize, int prio) -{ +sys_thread_t sys_thread_new(const char *name, lwip_thread_fn function, void *arg, int stacksize, int prio) { sys_thread_t handle = -1; handle = KTaskCreate(name, function, arg, (uint32)stacksize, (uint8)prio); - if (handle >= 0) - { + if (handle >= 0) { StartupKTask(handle); lw_print("lw: [%s] create %s handle %x\n", __func__, name, handle); return handle; @@ -283,8 +230,7 @@ sys_thread_t sys_thread_new(const char *name, lwip_thread_fn function, void *arg return -ERROR; } -err_t sys_mbox_new(sys_mbox_t *mbox, int size) -{ +err_t sys_mbox_new(sys_mbox_t *mbox, int size) { *mbox = KCreateMsgQueue(sizeof(void *), size); #if SYS_STATS @@ -293,8 +239,7 @@ err_t sys_mbox_new(sys_mbox_t *mbox, int size) lwip_stats.sys.mbox.max = lwip_stats.sys.mbox.used; } #endif /* SYS_STATS */ - if(*mbox < 0) - { + if(*mbox < 0) { lw_print("lw: [%s] alloc %d mbox %p failed\n", __func__, size, mbox); return ERR_MEM; } @@ -303,44 +248,38 @@ err_t sys_mbox_new(sys_mbox_t *mbox, int size) return ERR_OK; } -void sys_mbox_free(sys_mbox_t *mbox) -{ +void sys_mbox_free(sys_mbox_t *mbox) { KDeleteMsgQueue(*mbox); } -int sys_mbox_valid(sys_mbox_t *mbox) -{ +int sys_mbox_valid(sys_mbox_t *mbox) { if (*mbox <= SYS_MBOX_NULL) return 0; else return 1; } -void sys_mbox_set_invalid(sys_mbox_t *mbox) -{ +void sys_mbox_set_invalid(sys_mbox_t *mbox) { *mbox = SYS_MBOX_NULL; } -void sys_mbox_post(sys_mbox_t *q, void *msg) -{ - while(KMsgQueueSendwait( *q, &msg, sizeof(void *), WAITING_FOREVER) != EOK); +void sys_mbox_post(sys_mbox_t *q, void *msg) { + KMsgQueueSendwait(*q, &msg, sizeof(void *), WAITING_FOREVER); } -err_t sys_mbox_trypost(sys_mbox_t *q, void *msg) -{ +err_t sys_mbox_trypost(sys_mbox_t *q, void *msg) { + // if(KMsgQueueSend(*q, &msg, sizeof(void *)) == EOK) if(KMsgQueueSend(*q, &msg, sizeof(void *)) == EOK) return ERR_OK; else return ERR_MEM; } -err_t sys_mbox_trypost_fromisr(sys_mbox_t *q, void *msg) -{ +err_t sys_mbox_trypost_fromisr(sys_mbox_t *q, void *msg) { return sys_mbox_trypost(q, msg); } -u32_t sys_arch_mbox_fetch(sys_mbox_t *q, void **msg, u32_t timeout) -{ +u32_t sys_arch_mbox_fetch(sys_mbox_t *q, void **msg, u32_t timeout) { x_ticks_t start_tick = 0 ; int32 wait_time = 0; @@ -351,17 +290,15 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *q, void **msg, u32_t timeout) else wait_time = timeout; - if(KMsgQueueRecv(*q, &(*msg), sizeof(void *), wait_time) == EOK) - return ((CurrentTicksGain()-start_tick)*MS_PER_SYSTICK); - else{ - *msg = NULL; + if(KMsgQueueRecv(*q, &(*msg), sizeof(void *), wait_time) == EOK) { + return CalculateTimeMsFromTick(CurrentTicksGain() - start_tick); + } else { return SYS_ARCH_TIMEOUT; } } -u32_t sys_arch_mbox_tryfetch(sys_mbox_t *q, void **msg) -{ - if(KMsgQueueRecv(*q, &(*msg), sizeof(void *), 0) == EOK) +u32_t sys_arch_mbox_tryfetch(sys_mbox_t *q, void **msg) { + if (KMsgQueueRecv(*q, &(*msg), sizeof(void *), 0) == EOK) return ERR_OK; else return SYS_MBOX_EMPTY; @@ -374,97 +311,14 @@ u32_t sys_arch_mbox_tryfetch(sys_mbox_t *q, void **msg) #endif /* !NO_SYS */ /* Variables Initialization */ -struct netif gnetif; ip4_addr_t ipaddr; ip4_addr_t netmask; ip4_addr_t gw; -void lwip_tcp_init(void) -{ - tcpip_init(NULL, NULL); - - /* IP addresses initialization */ - /* USER CODE BEGIN 0 */ -#if LWIP_DHCP - ip_addr_set_zero_ip4(&ipaddr); - ip_addr_set_zero_ip4(&netmask); - ip_addr_set_zero_ip4(&gw); -#else - IP4_ADDR(&ipaddr, lwip_ipaddr[0], lwip_ipaddr[1], lwip_ipaddr[2], lwip_ipaddr[3]); - IP4_ADDR(&netmask, lwip_netmask[0], lwip_netmask[1], lwip_netmask[2], lwip_netmask[3]); - IP4_ADDR(&gw, lwip_gwaddr[0], lwip_gwaddr[1], lwip_gwaddr[2], lwip_gwaddr[3]); -#endif /* USE_DHCP */ - /* USER CODE END 0 */ - /* Initilialize the LwIP stack without RTOS */ - /* add the network interface (IPv4/IPv6) without RTOS */ -#ifdef NETIF_ENET0_INIT_FUNC - netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, NETIF_ENET0_INIT_FUNC, &tcpip_input); -#endif - - /* Registers the default network interface */ - netif_set_default(&gnetif); - - if (netif_is_link_up(&gnetif)) - { - /* When the netif is fully configured this function must be called */ - KPrintf("%s : netif_set_up\n", __func__); - netif_set_up(&gnetif); - } - else - { - /* When the netif link is down this function must be called */ - KPrintf("%s : netif_set_down\n", __func__); - netif_set_down(&gnetif); - } - -#if LWIP_DHCP - int err; - /* Creates a new DHCP client for this interface on the first call. - Note: you must call dhcp_fine_tmr() and dhcp_coarse_tmr() at - the predefined regular intervals after starting the client. - You can peek in the netif->dhcp struct for the actual DHCP status.*/ - - - err = dhcp_start(&gnetif); - if(err == ERR_OK) - KPrintf("lwip dhcp init success...\n\n"); - else - KPrintf("lwip dhcp init fail...\n\n"); - while(ip_addr_cmp(&(gnetif.ip_addr),&ipaddr)) - { - DelayKTask(1); - } -#endif - KPrintf("\n\nIP:%d.%d.%d.%d\n\n", \ - ((gnetif.ip_addr.addr)&0x000000ff), \ - (((gnetif.ip_addr.addr)&0x0000ff00)>>8), \ - (((gnetif.ip_addr.addr)&0x00ff0000)>>16), \ - ((gnetif.ip_addr.addr)&0xff000000)>>24); -} - -// lwip input thread to get network packet -void lwip_input_thread(void *param) -{ - struct netif *net = param; - - while (1) - { -#ifdef FSL_RTOS_XIUOS - if (lwip_obtain_semaphore(net) == EOK) -#endif - { - /* Poll the driver, get any outstanding frames */ - ethernetif_input(net); - sys_check_timeouts(); /* Handle all system timeouts for all core protocols */ - } - } -} - -void lwip_config_input(struct netif *net) -{ +void lwip_config_input(struct netif *net) { sys_thread_t th_id = 0; - th_id = sys_thread_new("eth_input", lwip_input_thread, net, LWIP_TASK_STACK_SIZE, 15); + th_id = sys_thread_new("eth_input", ethernetif_input, net, LWIP_TASK_STACK_SIZE, 20); if (th_id >= 0) { lw_print("%s %d successfully!\n", __func__, th_id); @@ -473,15 +327,65 @@ void lwip_config_input(struct netif *net) } } -void lwip_config_net(uint8_t enet_port, char *ip, char *mask, char *gw) -{ +void lwip_config_tcp(uint8_t enet_port, char *ip, char *mask, char *gw) { ip4_addr_t net_ipaddr, net_netmask, net_gw; char* eth_cfg; eth_cfg = ethernetif_config_enet_set(enet_port); - if(chk_lwip_bit(LWIP_INIT_FLAG)) - { + if(chk_lwip_bit(LWIP_INIT_FLAG)) { + lw_print("lw: [%s] already ...\n", __func__); + return; + } + + set_lwip_bit(LWIP_INIT_FLAG); + + tcpip_init(NULL, NULL); + + lw_print("lw: [%s] start ...\n", __func__); + + IP4_ADDR(&net_ipaddr, ip[0], ip[1], ip[2], ip[3]); + IP4_ADDR(&net_netmask, mask[0], mask[1], mask[2], mask[3]); + IP4_ADDR(&net_gw, gw[0], gw[1], gw[2], gw[3]); + + if (0 == enet_port) { +#ifdef NETIF_ENET0_INIT_FUNC + printf("[%s:%d] call netif_add\n", __func__, __LINE__); + netif_add(&gnetif, &net_ipaddr, &net_netmask, &net_gw, eth_cfg, NETIF_ENET0_INIT_FUNC, + tcpip_input); +#endif + } else if (1 == enet_port) { +#ifdef NETIF_ENET1_INIT_FUNC + netif_add(&gnetif, &net_ipaddr, &net_netmask, &net_gw, eth_cfg, NETIF_ENET1_INIT_FUNC, + tcpip_input); +#endif + } + + netif_set_default(&gnetif); + netif_set_up(&gnetif); + + lw_print("\r\n************************************************\r\n"); + lw_print(" Network Configuration\r\n"); + lw_print("************************************************\r\n"); + lw_print(" IPv4 Address : %u.%u.%u.%u\r\n", ((u8_t *)&net_ipaddr)[0], ((u8_t *)&net_ipaddr)[1], + ((u8_t *)&net_ipaddr)[2], ((u8_t *)&net_ipaddr)[3]); + lw_print(" IPv4 Subnet mask : %u.%u.%u.%u\r\n", ((u8_t *)&net_netmask)[0], ((u8_t *)&net_netmask)[1], + ((u8_t *)&net_netmask)[2], ((u8_t *)&net_netmask)[3]); + lw_print(" IPv4 Gateway : %u.%u.%u.%u\r\n", ((u8_t *)&net_gw)[0], ((u8_t *)&net_gw)[1], + ((u8_t *)&net_gw)[2], ((u8_t *)&net_gw)[3]); + lw_print("************************************************\r\n"); + + lwip_config_input(&gnetif); +} + + +void lwip_config_net(uint8_t enet_port, char *ip, char *mask, char *gw) { + ip4_addr_t net_ipaddr, net_netmask, net_gw; + char* eth_cfg; + + eth_cfg = ethernetif_config_enet_set(enet_port); + + if(chk_lwip_bit(LWIP_INIT_FLAG)) { lw_print("lw: [%s] already ...\n", __func__); IP4_ADDR(&net_ipaddr, ip[0], ip[1], ip[2], ip[3]); @@ -521,8 +425,7 @@ void lwip_config_net(uint8_t enet_port, char *ip, char *mask, char *gw) netif_set_default(&gnetif); netif_set_up(&gnetif); - if(chk_lwip_bit(LWIP_PRINT_FLAG)) - { + if(chk_lwip_bit(LWIP_PRINT_FLAG)) { lw_notice("\r\n************************************************\r\n"); lw_notice(" Network Configuration\r\n"); lw_notice("************************************************\r\n"); @@ -537,55 +440,3 @@ void lwip_config_net(uint8_t enet_port, char *ip, char *mask, char *gw) lwip_config_input(&gnetif); } -void lwip_config_tcp(uint8_t enet_port, char *ip, char *mask, char *gw) -{ - ip4_addr_t net_ipaddr, net_netmask, net_gw; - char* eth_cfg; - - eth_cfg = ethernetif_config_enet_set(enet_port); - - if(chk_lwip_bit(LWIP_INIT_FLAG)) - { - lw_print("lw: [%s] already ...\n", __func__); - return; - } - - set_lwip_bit(LWIP_INIT_FLAG); - - tcpip_init(NULL, NULL); - - lw_print("lw: [%s] start ...\n", __func__); - - IP4_ADDR(&net_ipaddr, ip[0], ip[1], ip[2], ip[3]); - IP4_ADDR(&net_netmask, mask[0], mask[1], mask[2], mask[3]); - IP4_ADDR(&net_gw, gw[0], gw[1], gw[2], gw[3]); - - if(0 == enet_port) { -#ifdef NETIF_ENET0_INIT_FUNC - netif_add(&gnetif, &net_ipaddr, &net_netmask, &net_gw, eth_cfg, NETIF_ENET0_INIT_FUNC, - ethernet_input); -#endif - } else if (1 == enet_port) { -#ifdef NETIF_ENET1_INIT_FUNC - netif_add(&gnetif, &net_ipaddr, &net_netmask, &net_gw, eth_cfg, NETIF_ENET1_INIT_FUNC, - ethernet_input); -#endif - } - - netif_set_default(&gnetif); - netif_set_up(&gnetif); - - lw_print("\r\n************************************************\r\n"); - lw_print(" Network Configuration\r\n"); - lw_print("************************************************\r\n"); - lw_print(" IPv4 Address : %u.%u.%u.%u\r\n", ((u8_t *)&net_ipaddr)[0], ((u8_t *)&net_ipaddr)[1], - ((u8_t *)&net_ipaddr)[2], ((u8_t *)&net_ipaddr)[3]); - lw_print(" IPv4 Subnet mask : %u.%u.%u.%u\r\n", ((u8_t *)&net_netmask)[0], ((u8_t *)&net_netmask)[1], - ((u8_t *)&net_netmask)[2], ((u8_t *)&net_netmask)[3]); - lw_print(" IPv4 Gateway : %u.%u.%u.%u\r\n", ((u8_t *)&net_gw)[0], ((u8_t *)&net_gw)[1], - ((u8_t *)&net_gw)[2], ((u8_t *)&net_gw)[3]); - lw_print("************************************************\r\n"); - - lwip_config_input(&gnetif); -} - diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/sys_arch.h b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/sys_arch.h index 517f5c014..e606c710b 100644 --- a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/sys_arch.h +++ b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/arch/sys_arch.h @@ -54,7 +54,7 @@ #define LWIP_TARGET_PORT LWIP_LOCAL_PORT #define LWIP_DEMO_TIMES 10 -#define LWIP_TASK_STACK_SIZE 4096 +#define LWIP_TASK_STACK_SIZE 1536 #define LWIP_DEMO_TASK_PRIO 20 // /* MAC address configuration. */ @@ -72,7 +72,8 @@ typedef int32 sys_mbox_t; typedef int32 sys_thread_t; typedef x_base sys_prot_t; -#define MS_PER_SYSTICK (1000 / TICK_PER_SECOND) +#define MS_PER_SYSTICK (float)(1000 / TICK_PER_SECOND) +#define TICKS_PER_MS (TICK_PER_SECOND / 1000) //debug rtos with IRQ //#define FSL_RTOS_XIUOS @@ -99,6 +100,7 @@ extern char lwip_eth1_netmask[]; extern char lwip_eth1_gwaddr[]; extern struct netif gnetif; +extern sys_sem_t* get_eth_recv_sem(); void lwip_tcp_init(void); void lwip_config_net(uint8_t enet_port, char *ip, char *mask, char *gw); diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/include/lwip/debug.h b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/include/lwip/debug.h index 0711078cd..cbddaf146 100644 --- a/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/include/lwip/debug.h +++ b/Ubiquitous/XiZi_IIoT/resources/ethernet/LwIP/include/lwip/debug.h @@ -142,18 +142,22 @@ #endif #ifdef LWIP_DEBUG -#define LWIP_DEBUGF(debug, message) do { \ +#define LWIP_DEBUGF(debug_flag, message) do { \ if ( \ - ((debug) & LWIP_DBG_ON) && \ - ((debug) & LWIP_DBG_TYPES_ON) && \ - ((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \ + ((debug_flag) & LWIP_DBG_ON) && \ + ((debug_flag) & LWIP_DBG_TYPES_ON) && \ + (debug_flag)) { \ LWIP_PLATFORM_DIAG(message); \ - if ((debug) & LWIP_DBG_HALT) { \ + if ((debug_flag) & LWIP_DBG_HALT) { \ while(1); \ } \ } \ } while(0) + // ((s16_t)((debug_flag) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \ +// #define LWIP_DEBUGF(debug, message) do { \ +// LWIP_PLATFORM_DIAG(message); \ +// } while(0) #else /* LWIP_DEBUG */ #define LWIP_DEBUGF(debug, message) #endif /* LWIP_DEBUG */ diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/cmd_lwip/Makefile b/Ubiquitous/XiZi_IIoT/resources/ethernet/cmd_lwip/Makefile index 9426c8faf..697c6c141 100755 --- a/Ubiquitous/XiZi_IIoT/resources/ethernet/cmd_lwip/Makefile +++ b/Ubiquitous/XiZi_IIoT/resources/ethernet/cmd_lwip/Makefile @@ -1,3 +1,4 @@ -SRC_FILES := ping.c lwip_ping_demo.c lwip_tcp_demo.c lwip_udp_demo.c tcpecho_raw.c lwip_config_demo.c lwip_dhcp_demo.c +SRC_FILES := ping.c lwip_ping_demo.c lwip_tcp_demo.c tcpecho_raw.c lwip_config_demo.c lwip_dhcp_demo.c iperf.c http_test.c +# SRC_FILES := ping.c lwip_ping_demo.c lwip_tcp_demo.c lwip_udp_demo.c tcpecho_raw.c lwip_config_demo.c lwip_dhcp_demo.c iperf.c include $(KERNEL_ROOT)/compiler.mk diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/cmd_lwip/http_test.c b/Ubiquitous/XiZi_IIoT/resources/ethernet/cmd_lwip/http_test.c new file mode 100644 index 000000000..911eebfc0 --- /dev/null +++ b/Ubiquitous/XiZi_IIoT/resources/ethernet/cmd_lwip/http_test.c @@ -0,0 +1,68 @@ + +#include +#include +#include + +#include "lwip/apps/http_client.h" + +void httpc_app_recv_end(void *arg, httpc_result_t httpc_result, u32_t rx_content_len, u32_t srv_res, err_t err) { + httpc_state_t **req = (httpc_state_t**)arg; + + LWIP_DEBUGF(LWIP_DEBUG, ("[HTTPC] Transfer finished. rx_content_len is %lu\r\n", rx_content_len)); + printf("[HTTPC] Transfer finished. rx_content_len is %lu\r\n", rx_content_len); + *req = NULL; +} + + +err_t httpc_app_headers_done(httpc_state_t *connection, void *arg, struct pbuf *hdr, u16_t hdr_len, u32_t content_len) { + LWIP_DEBUGF(LWIP_DEBUG, ("[%s] headers done call back.\n", __func__)); + printf("[%s] headers done call back, content len: %d.\n", __func__, content_len); + return ERR_OK; +} + +err_t httpc_app_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err) { + printf("[%s] Get %d Data\n", __func__, p->len); + + pbuf_free(p); + return ERR_OK; +} + +ip_addr_t *get_server_ip() { + static ip_addr_t server_ip; + return &server_ip; +} + +httpc_state_t **get_conn_state() { + static httpc_state_t *conn_state; + return &conn_state; +} + +httpc_connection_t *get_conn_setting() { + static httpc_connection_t conn_setting; + return &conn_setting; +} + +void httpc_get_file_app(int argc, char *argv[]) { + // deal input ip + + // get file from server + const uint8_t server_ip_by_arr[4] = {39, 156, 66, 10}; + // const uint8_t server_ip_by_arr[4] = {114, 215, 151, 106}; + IP4_ADDR(get_server_ip(), + server_ip_by_arr[0], server_ip_by_arr[1], server_ip_by_arr[2], server_ip_by_arr[3]); + + get_conn_setting()->use_proxy = 0; + get_conn_setting()->result_fn = httpc_app_recv_end; + get_conn_setting()->headers_done_fn = httpc_app_headers_done; + + LWIP_DEBUGF(HTTPC_DEBUG, ("[%s] Calling httpc_get_file\n", __func__)); + printf("[%s] Calling httpc_get_file\n", __func__); + err_t errnum = httpc_get_file(get_server_ip(), 80, "/index.html", get_conn_setting(), httpc_app_recv, NULL, get_conn_state()); + // err_t errnum = httpc_get_file_dns("https://www.baidu.com", 80, "/index.html", get_conn_setting(), httpc_app_recv, NULL, get_conn_state()); + + if (errnum != ERR_OK) { + printf("httpc_get_file failed (%d)\n", errnum); + } +} +SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN) | SHELL_CMD_PARAM_NUM(0), + lwip_http_test, httpc_get_file_app, get file from net server); \ No newline at end of file diff --git a/Ubiquitous/XiZi_IIoT/resources/ethernet/cmd_lwip/iperf.c b/Ubiquitous/XiZi_IIoT/resources/ethernet/cmd_lwip/iperf.c new file mode 100644 index 000000000..29c947a18 --- /dev/null +++ b/Ubiquitous/XiZi_IIoT/resources/ethernet/cmd_lwip/iperf.c @@ -0,0 +1,686 @@ +/** +* iperf-liked network performance tool +* +*/ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "lwip/sockets.h" +#include +#include + +#define IPERF_PORT 5001 +#define IPERF_BUFSZ (4 * 1024) + +#define IPERF_MODE_STOP 0 +#define IPERF_MODE_SERVER 1 +#define IPERF_MODE_CLIENT 2 + +typedef struct{ + int mode; + char *host; + int port; +} IPERF_PARAM; +static IPERF_PARAM param = {IPERF_MODE_STOP, NULL, IPERF_PORT}; + +char tcp_iperf_ip[] = {192, 168, 130, 77}; +char tcp_iperf_mask[] = {255, 255, 254, 0}; +char tcp_iperf_gw[] = {192, 168, 130, 1}; + +static void iperf_udp_client(void *thread_param) +{ + int sock; + uint32 *buffer; + struct sockaddr_in server; + uint32 packet_count = 0; + uint32 tick; + int send_size; + + send_size = IPERF_BUFSZ > 1470 ? 1470 : IPERF_BUFSZ; + + sock = socket(PF_INET, SOCK_DGRAM, 0); + if(sock < 0){ + KPrintf("[%s:%d] can't create socket! exit!\n", __FILE__, __LINE__); + return; + } + + server.sin_family = PF_INET; + server.sin_port = htons(param.port); + server.sin_addr.s_addr = inet_addr(param.host); + memset(&(server.sin_zero), 0, sizeof(server.sin_zero)); + + if (connect(sock, (struct sockaddr *)&server, sizeof(struct sockaddr))){ + lw_error("Unable to connect\n"); + closesocket(sock); + return; + } + + buffer = malloc(IPERF_BUFSZ); + if (buffer == NULL){ + printf("[%s:%d] malloc failed\n", __FILE__, __LINE__); + return; + } + memset(buffer, 0x00, IPERF_BUFSZ); + + KPrintf("iperf udp mode run...\n"); + while (param.mode != IPERF_MODE_STOP){ + packet_count++; + tick = CurrentTicksGain(); + buffer[0] = htonl(packet_count); + buffer[1] = htonl(tick / TICK_PER_SECOND); + buffer[2] = htonl((tick % TICK_PER_SECOND) * 1000); + sendto(sock, buffer, send_size, 0, (struct sockaddr *)&server, sizeof(struct sockaddr_in)); + } + closesocket(sock); + free(buffer); + KPrintf("iperf udp mode exit...\n"); +} + +static void iperf_udp_server(void *thread_param) +{ + int sock; + uint32 *buffer; + struct sockaddr_in server; + struct sockaddr_in sender; + int sender_len, r_size; + uint64 sentlen; + uint32 pcount = 0, last_pcount = 0; + uint32 lost, total; + x_ticks_t tick1, tick2; + struct timeval timeout; + + buffer = malloc(IPERF_BUFSZ); + if (buffer == NULL){ + return; + } + + sock = socket(PF_INET, SOCK_DGRAM, 0); + if(sock < 0){ + KPrintf("can't create socket! exit!"); + return; + } + + server.sin_family = PF_INET; + server.sin_port = htons(param.port); + server.sin_addr.s_addr = inet_addr("0.0.0.0"); + + timeout.tv_sec = 2; + timeout.tv_usec = 0; + if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)) == -1){ + KPrintf("setsockopt failed!"); + closesocket(sock); + free(buffer); + return; + } + + if (bind(sock, (struct sockaddr *)&server, sizeof(struct sockaddr_in)) < 0){ + KPrintf("iperf server bind failed! exit!"); + closesocket(sock); + free(buffer); + return; + } + + while (param.mode != IPERF_MODE_STOP){ + tick1 = CurrentTicksGain(); + tick2 = tick1; + lost = 0; + total = 0; + sentlen = 0; + while ((tick2 - tick1) < (TICK_PER_SECOND * 5)){ + r_size = recvfrom(sock, buffer, IPERF_BUFSZ, 0, (struct sockaddr *)&sender, (socklen_t*)&sender_len); + if (r_size > 12){ + pcount = ntohl(buffer[0]); + if (last_pcount < pcount){ + lost += pcount - last_pcount - 1; + total += pcount - last_pcount; + } + else{ + last_pcount = pcount; + } + last_pcount = pcount; + sentlen += r_size; + } + tick2 = CurrentTicksGain(); + } + if (sentlen > 0){ + long data; + int integer, decimal; + KTaskDescriptorType tid; + + tid = GetKTaskDescriptor(); + data = sentlen * TICK_PER_SECOND / 125 / (tick2 - tick1); + integer = data/1000; + decimal = data%1000; + KPrintf("%s: %d.%03d0 Mbps! lost:%d total:%d\n", tid->task_base_info.name, integer, decimal, lost, total); + } + } + free(buffer); + closesocket(sock); +} + +static void iperf_client(void *thread_param) +{ + int i; + int sock; + int ret; + int tips = 1; + uint8_t *send_buf; + uint64 sentlen; + x_ticks_t tick1, tick2; + struct sockaddr_in addr; + + send_buf = (uint8_t *) malloc(IPERF_BUFSZ); + if (!send_buf) return ; + + for (i = 0; i < IPERF_BUFSZ; i ++) + send_buf[i] = i & 0xff; + + while (param.mode != IPERF_MODE_STOP) + { + sock = socket(AF_INET, SOCK_STREAM, 0); + if (sock < 0){ + KPrintf("create socket failed!"); + DelayKTask(TICK_PER_SECOND); + continue; + } + + addr.sin_family = PF_INET; + addr.sin_port = htons(param.port); + addr.sin_addr.s_addr = inet_addr((char *)param.host); + + ret = connect(sock, (const struct sockaddr *)&addr, sizeof(addr)); + if (ret == -1){ + if (tips){ + KPrintf("Connect to iperf server faile, Waiting for the server to open!"); + tips = 0; + } + closesocket(sock); + DelayKTask(TICK_PER_SECOND); + continue; + } + KPrintf("Connect to iperf server successful!\n"); + + { + int flag = 1; + + setsockopt(sock, + IPPROTO_TCP, /* set option at TCP level */ + TCP_NODELAY, /* name of option */ + (void *) &flag, /* the cast is historical cruft */ + sizeof(int)); /* length of option value */ + } + + sentlen = 0; + + tick1 = CurrentTicksGain(); + while (param.mode != IPERF_MODE_STOP){ + tick2 = CurrentTicksGain(); + if (tick2 - tick1 >= TICK_PER_SECOND * 5){ + double speed; + // int integer, decimal; + KTaskDescriptorType tid; + + tid = GetKTaskDescriptor(); + speed = (double)(sentlen * TICK_PER_SECOND / 125 / (tick2 - tick1)); + speed = speed / 1000.0f; + printf("%s: %2.4f Mbps!\n", tid->task_base_info.name, speed); + tick1 = tick2; + sentlen = 0; + } + + ret = send(sock, send_buf, IPERF_BUFSZ, 0); + if (ret > 0){ + sentlen += ret; + } + + if (ret < 0) break; + } + + closesocket(sock); + + DelayKTask(TICK_PER_SECOND * 2); + KPrintf("Disconnected, iperf server shut down!"); + tips = 1; + } + free(send_buf); +} + +// iperf tcp server running thread +struct sock_conn_cb { + struct sockaddr_in server_addr; + struct sockaddr_in client_addr; + int connected; + int parent_id; +}; + +void iperf_sever_worker(void* arg) { + struct sock_conn_cb *sccb = (struct sock_conn_cb *)arg; + x_ticks_t tick1, tick2; + + uint8_t *recv_data = (uint8_t *)malloc(IPERF_BUFSZ); + if(recv_data == NULL) { + KPrintf("[%s] No Memory.\n", __func__); + goto exit__; + } + + uint64 recvlen = 0; + int32_t bytes_received = 0; + + int flag = 1; + setsockopt(sccb->connected, + IPPROTO_TCP, /* set option at TCP level */ + TCP_NODELAY, /* name of option */ + (void *) &flag, /* the cast is historical cruft */ + sizeof(int)); /* length of option value */ + + int cur_tid = GetKTaskDescriptor()->id.id; + + tick1 = CurrentTicksGain(); + while (param.mode != IPERF_MODE_STOP){ + bytes_received = recv(sccb->connected, recv_data, IPERF_BUFSZ, 0); + if (bytes_received == 0) { + KPrintf("client disconnected (%s, %d)\n", + inet_ntoa(sccb->client_addr.sin_addr), ntohs(sccb->client_addr.sin_port)); + break; + } else if (bytes_received < 0) { + KPrintf("recv error, client: (%s, %d)\n", + inet_ntoa(sccb->client_addr.sin_addr), ntohs(sccb->client_addr.sin_port)); + break; + } + + recvlen += bytes_received; + + tick2 = CurrentTicksGain(); + if (tick2 - tick1 >= TICK_PER_SECOND * 5) { + double speed; + // int integer, decimal; + KTaskDescriptorType tid; + + tid = GetKTaskDescriptor(); + speed = (double)(recvlen * TICK_PER_SECOND / (125 * (tick2 - tick1))); + speed = speed / 1000.0f; + printf("%s%d: %2.4f Mbps!\n", + tid->task_base_info.name, cur_tid - sccb->parent_id, speed); + tick1 = tick2; + recvlen = 0; + } + } + free(recv_data); + +exit__: + if (sccb->connected >= 0) closesocket(sccb->connected); + sccb->connected = -1; + free(sccb); + KPrintf("iperf server %d quiting.\n", cur_tid - sccb->parent_id); +} + +void iperf_server_multithread(void *thread_param) +{ + socklen_t sin_size; + x_ticks_t tick1, tick2; + int sock; + int connected; + struct sockaddr_in server_addr, client_addr; + fd_set readset; + struct timeval timeout; + + sock = socket(AF_INET, SOCK_STREAM, 0); + if (sock < 0){ + KPrintf("[%s:%d] Socket error!\n", __FILE__, __LINE__); + goto __exit; + } + + server_addr.sin_family = AF_INET; + server_addr.sin_port = htons(param.port); + server_addr.sin_addr.s_addr = INADDR_ANY; + memset(&(server_addr.sin_zero), 0x0, sizeof(server_addr.sin_zero)); + + if (bind(sock, (struct sockaddr *)&server_addr, sizeof(struct sockaddr)) == -1){ + KPrintf("Unable to bind!\n"); + goto __exit; + } + + if (listen(sock, 5) == -1){ + KPrintf("Listen error!\n"); + goto __exit; + } + + int cur_tid = GetKTaskDescriptor()->id.id; + + timeout.tv_sec = 5; + timeout.tv_usec = 0; + while (param.mode != IPERF_MODE_STOP){ + FD_ZERO(&readset); + FD_SET(sock, &readset); + + if (select(sock + 1, &readset, NULL, NULL, &timeout) == 0) { + continue; + } + + sin_size = sizeof(struct sockaddr_in); + + connected = accept(sock, (struct sockaddr *)&client_addr, &sin_size); + + printf("new client connected from (%s, %d)\n", + inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port)); + struct sock_conn_cb *sccb = malloc(sizeof(struct sock_conn_cb)); + sccb->connected = connected; + sccb->client_addr = client_addr; + sccb->server_addr = server_addr; + sccb->parent_id = cur_tid; + int tid = KTaskCreate("iperf server", iperf_sever_worker, sccb, LWIP_TASK_STACK_SIZE, 20); + // iperf_sever_worker(sccb); + if (tid) { + StartupKTask(tid); + } else { + KPrintf("[%s] Failed to create server worker.\n", __func__); + free(sccb); + } + } + +__exit: + if (sock >= 0) closesocket(sock); +} + +void iperf_server(void *thread_param) +{ + uint8_t *recv_data; + socklen_t sin_size; + x_ticks_t tick1, tick2; + int sock = -1, connected, bytes_received; + uint64 recvlen; + struct sockaddr_in server_addr, client_addr; + fd_set readset; + struct timeval timeout; + + sock = socket(AF_INET, SOCK_STREAM, 0); + if (sock < 0){ + KPrintf("[%s:%d] Socket error!\n", __FILE__, __LINE__); + goto __exit; + } + + recv_data = (uint8_t *)malloc(IPERF_BUFSZ); + if (recv_data == NULL){ + KPrintf("No memory!\n"); + goto __exit; + } + + server_addr.sin_family = AF_INET; + server_addr.sin_port = htons(param.port); + server_addr.sin_addr.s_addr = INADDR_ANY; + memset(&(server_addr.sin_zero), 0x0, sizeof(server_addr.sin_zero)); + + if (bind(sock, (struct sockaddr *)&server_addr, sizeof(struct sockaddr)) == -1){ + KPrintf("Unable to bind!\n"); + goto __exit; + } + + if (listen(sock, 5) == -1){ + KPrintf("Listen error!\n"); + goto __exit; + } + + timeout.tv_sec = 3; + timeout.tv_usec = 0; + + while (param.mode != IPERF_MODE_STOP){ + FD_ZERO(&readset); + FD_SET(sock, &readset); + + if (select(sock + 1, &readset, NULL, NULL, &timeout) == 0) { + continue; + } + + sin_size = sizeof(struct sockaddr_in); + + connected = accept(sock, (struct sockaddr *)&client_addr, &sin_size); + + printf("new client connected from (%s, %d)\n", + inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port)); + + int flag = 1; + setsockopt(connected, + IPPROTO_TCP, /* set option at TCP level */ + TCP_NODELAY, /* name of option */ + (void *) &flag, /* the cast is historical cruft */ + sizeof(int)); /* length of option value */ + + recvlen = 0; + tick1 = CurrentTicksGain(); + while (param.mode != IPERF_MODE_STOP){ + bytes_received = recv(connected, recv_data, IPERF_BUFSZ, 0); + if (bytes_received == 0) { + KPrintf("client disconnected (%s, %d)\n", + inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port)); + break; + } else if (bytes_received < 0) { + KPrintf("recv error, client: (%s, %d)\n", + inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port)); + break; + } + + recvlen += bytes_received; + + tick2 = CurrentTicksGain(); + if (tick2 - tick1 >= TICK_PER_SECOND * 5) { + double speed; + // int integer, decimal; + KTaskDescriptorType tid; + + tid = GetKTaskDescriptor(); + speed = (double)(recvlen * TICK_PER_SECOND / (125 * (tick2 - tick1))); + speed = speed / 1000.0f; + printf("%s: %2.4f Mbps!\n", tid->task_base_info.name, speed); + tick1 = tick2; + recvlen = 0; + } + } + if (connected >= 0) closesocket(connected); + connected = -1; + } + +__exit: + if (sock >= 0) closesocket(sock); + if (recv_data) free(recv_data); +} + +void iperf_usage(void) +{ + KPrintf("Usage: iperf [-s|-c host] [options] [multi-threaded]\n"); + KPrintf(" iperf [-h|--stop]\n"); + KPrintf("\n"); + KPrintf("Client/Server:\n"); + KPrintf(" -p # server port to listen on/connect to\n"); + KPrintf("\n"); + KPrintf("Server specific:\n"); + KPrintf(" -s run in server mode\n"); + KPrintf("\n"); + KPrintf("Client specific:\n"); + KPrintf(" -c run in client mode, connecting to \n"); + KPrintf("\n"); + KPrintf("Miscellaneous:\n"); + KPrintf(" -h print this message and quit\n"); + KPrintf(" --stop stop iperf program\n"); + KPrintf(" -u testing UDP protocol\n"); + KPrintf(" -m