From 05dd690e13cdd07d3118707606943c4155d599c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=B6=85?= Date: Wed, 18 Aug 2021 14:21:05 +0800 Subject: [PATCH] self start ntp upnp web server --- bsp/imx6ull-artpi-smart/applications/main.c | 11 +++++++++++ bsp/imx6ull-artpi-smart/rtconfig.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/bsp/imx6ull-artpi-smart/applications/main.c b/bsp/imx6ull-artpi-smart/applications/main.c index 43fead032c..3fdf8e1222 100644 --- a/bsp/imx6ull-artpi-smart/applications/main.c +++ b/bsp/imx6ull-artpi-smart/applications/main.c @@ -6,6 +6,7 @@ * Change Logs: * Date Author Notes * 2020/10/7 bernard the first version + * 2021/8/18 songchao add exec ntp upnp webserver */ #include #include @@ -14,6 +15,9 @@ #include #include "drv_pin.h" +char ntp_cmd[] = "/mnt/root/bin/apps/ntp.elf &"; +char uhttpd_cmd[] = "/mnt/root/bin/uhttpd.elf -f -p 80 -h /mnt/root/var/dist &"; +char uPnP_cmd[] = "/mnt/root/bin/apps/uPnP.elf &"; #define LED_PIN GET_PIN(5, 3) int main(void) @@ -22,6 +26,13 @@ int main(void) printf("hello rt-smart\n"); + rt_thread_mdelay(1000); + msh_exec(ntp_cmd, sizeof(ntp_cmd)); + rt_thread_mdelay(1000); + msh_exec(uhttpd_cmd, sizeof(uhttpd_cmd)); + rt_thread_mdelay(1000); + msh_exec(uPnP_cmd, sizeof(uPnP_cmd)); + for(;;) { rt_pin_write(LED_PIN, PIN_HIGH); diff --git a/bsp/imx6ull-artpi-smart/rtconfig.h b/bsp/imx6ull-artpi-smart/rtconfig.h index 9c87c9cb93..e721d4acbd 100644 --- a/bsp/imx6ull-artpi-smart/rtconfig.h +++ b/bsp/imx6ull-artpi-smart/rtconfig.h @@ -342,4 +342,6 @@ #define RT_USING_ENET1 +#define RT_USING_SYSINFO + #endif -- Gitee