/*! \brief create ethernet task, for ethernet management. * * \param uxPriority Input. priority for the task, it should be low * */ portTASK_FUNCTION(vStartEthernetTask, pvParameters) { /* Setup lwIP. */ prvlwIPInit(); #if (HTTP_USED == 1) /* Create the WEB server task. This uses the lwIP RTOS abstraction layer. */ sys_thread_new("WEB", vBasicWEBServer, (void *)NULL, lwipBASIC_WEB_SERVER_STACK_SIZE, lwipBASIC_WEB_SERVER_PRIORITY); #endif #if (TFTP_USED == 1) /* Create the TFTP server task. This uses the lwIP RTOS abstraction layer. */ sys_thread_new("TFTP", vBasicTFTPServer, (void *)NULL, lwipBASIC_TFTP_SERVER_STACK_SIZE, lwipBASIC_TFTP_SERVER_PRIORITY); #endif #if (SMTP_USED == 1) /* Create the SMTP Client task. This uses the lwIP RTOS abstraction layer. */ sys_thread_new("SMTP", vBasicSMTPClient, (void *)NULL, lwipBASIC_SMTP_CLIENT_STACK_SIZE, lwipBASIC_SMTP_CLIENT_PRIORITY); #endif /* Kill this task. */ vTaskDelete(NULL); }
/*! \brief create ethernet task, for ethernet management. * * \param uxPriority Input. priority for the task, it should be low * */ portTASK_FUNCTION( vStartEthernetTask, pvParameters ) { static const gpio_map_t MACB_GPIO_MAP = { {EXTPHY_MACB_MDC_PIN, EXTPHY_MACB_MDC_FUNCTION }, {EXTPHY_MACB_MDIO_PIN, EXTPHY_MACB_MDIO_FUNCTION }, {EXTPHY_MACB_RXD_0_PIN, EXTPHY_MACB_RXD_0_FUNCTION }, {EXTPHY_MACB_TXD_0_PIN, EXTPHY_MACB_TXD_0_FUNCTION }, {EXTPHY_MACB_RXD_1_PIN, EXTPHY_MACB_RXD_1_FUNCTION }, {EXTPHY_MACB_TXD_1_PIN, EXTPHY_MACB_TXD_1_FUNCTION }, {EXTPHY_MACB_TX_EN_PIN, EXTPHY_MACB_TX_EN_FUNCTION }, {EXTPHY_MACB_RX_ER_PIN, EXTPHY_MACB_RX_ER_FUNCTION }, {EXTPHY_MACB_RX_DV_PIN, EXTPHY_MACB_RX_DV_FUNCTION }, {EXTPHY_MACB_TX_CLK_PIN, EXTPHY_MACB_TX_CLK_FUNCTION} }; // Assign GPIO to MACB gpio_enable_module(MACB_GPIO_MAP, sizeof(MACB_GPIO_MAP) / sizeof(MACB_GPIO_MAP[0])); /* Setup lwIP. */ prvlwIPInit(); #if (HTTP_USED == 1) /* Create the WEB server task. This uses the lwIP RTOS abstraction layer.*/ sys_thread_new( "WEB", vBasicWEBServer, ( void * ) NULL, lwipBASIC_WEB_SERVER_STACK_SIZE, lwipBASIC_WEB_SERVER_PRIORITY ); #endif #if (TFTP_USED == 1) /* Create the TFTP server task. This uses the lwIP RTOS abstraction layer.*/ sys_thread_new( "TFTP", vBasicTFTPServer, ( void * ) NULL, lwipBASIC_TFTP_SERVER_STACK_SIZE, lwipBASIC_TFTP_SERVER_PRIORITY ); #endif #if (SMTP_USED == 1) /* Create the SMTP Client task. This uses the lwIP RTOS abstraction layer.*/ sys_thread_new( "SMTP", vBasicSMTPClient, ( void * ) NULL, lwipBASIC_SMTP_CLIENT_STACK_SIZE, lwipBASIC_SMTP_CLIENT_PRIORITY ); #endif // Kill this task. vTaskDelete(NULL); }
/*! \brief create ethernet task, for ethernet management. * * \param uxPriority Input. priority for the task, it should be low * */ portTASK_FUNCTION(vStartEthernetTask, pvParameters) { /* Setup lwIP. */ prvlwIPInit(); /* Create the WEB server task. This uses the lwIP RTOS abstraction layer. */ sys_thread_new("WEB", vBasicWEBServer, (void *)NULL, lwipBASIC_WEB_SERVER_STACK_SIZE, lwipBASIC_WEB_SERVER_PRIORITY); /* Create the Socket Server task. This uses the lwIP RTOS abstraction layer. */ sys_thread_new("NETS", vNetHandle, (void *)NULL, TASK_TCP_SERVER_STACK_SIZE, TASK_TCP_SERVER_PRIORITY); /* Kill this task. */ vTaskDelete(NULL); }