UART_SetPrintPort(UART0);
UART_intr_handler_register(uart0_rx_intr_handler);
ETS_UART_INTR_ENABLE();
3. ESP8266_RTOS_SDK supports multi-threading, therefore, multiple tasks can be
created. The interface xTaskCreate used to create tasks is a self-contained interface
owned by freeRTOS. When using xTaskCreate to create a new task, the range of the
task stack should be [176, 512].
xTaskCreate(task2,"tsk2",256,NULL,2,NULL);
xTaskCreate(task3,"tsk3",256,NULL,2,NULL);
Register the task and execute the function. Take the execution of task 2 as an example:
voidtask2(void*pvParameters)
{
printf("Hello,welcometotask2!\r\n");
while(1){
……
}
vTaskDelete(NULL);
}
4. Compile the application program, generate firmware and download it into the ESP8266
module.
5. Power off the module, and change it to operation mode; then power on the module and
run the program.
Result:
SDKversion:1.0.3(601f5cd)
mode:sta(18:fe:34:97:f7:40)+softAP(1a:fe:34:97:f7:40)
Hello,welcometotask2!
Hello,welcometotask3!
3.2.2. How to Read the ID of the Chip
1. Introduction of the Software Interface:
system_get_chip_id returns the value signifying the chip ID of the module. Every chip has
one exclusive ID.
printf("ESP8266chipID:0x%x\n",system_get_chip_id());
2. Compile the application program, generate firmware and download it into the ESP8266
module.
3. Power off the module, and change it to operation mode; then power on the module and
run the program.