{// gpio_set_level(LED_IO_NUM, 1);// vTaskDelay(500 / portTICK_PERIOD_MS);// gpio_set_level(LED_IO_NUM, 0);// vTaskDelay(500 / portTICK_PERIOD_MS);printf("running \r\n");vTaskDelay(1000/ portTICK_PERIOD_MS); } }
{ printf("TF 卡初始化成功! \n"); sdmmc_status = 1; // sd卡mount成功 } else { printf("TF 卡初始化失败! \n"); sdmmc_status = 0; // sd卡mount失败 } } file_name[8] = '\0'; if (sdmmc_status == 1 && gps_data.lat[0] != ',') { // 用日期作为文件名 file_name[0...
Periodicaly (i'm do not know cause) 'printf' is no output to defaut uart, if non-constant format, i.e : --- printf ("test\n"); // output: test printf ("number %d\n", 1); // no output char * line = "line\n"; printf (line); // no output --- but, --- fprintf ...
if (err == ESP_ERR_NOT_FOUND) { printf("Unrecognized command\n"); } else if (err == ESP_ERR_INVALID_ARG) { // command was empty } else if (err == ESP_OK && ret != ESP_OK) { printf("Command returned non-zero error code: 0x%x (%s)\n", ret, esp_err_to_name(ret)); ...
如果 INCLUDE_vTaskSuspend 设置成 1,并且指定延时为 portMAX_DELAY 将导致任务无限阻塞(没有超时)if(xQueueReceive(gpio_evt_queue,&io_num,portMAX_DELAY)){// 如果读取到消息,就打印出来printf("老板 GPIO[%d]来中断了\n",io_num);}}}voidapp_main(void){/* 定义一个gpio配置结构体 */gpio_config...
printf("---\n"); while(1) { i++; printf("Restarting in %ld seconds...\n", i); vTaskDelay(1000 / portTICK_PERIOD_MS); } } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. (5)
printf("hello world\r\n"); } 1.3、编译并烧写 在esp-idf终端下,输入如下命令完成编译和烧写: idf.py build flash -p COM6 上面-p COM6 指定ESP32开发板在电脑上对应的串口号。 1.4、查看输出 打开ESP-IDF串口终端,即可看到输出信息: 如果使用其他串口工具,需要选择波特率为 115200。
/**<用于printf/scan系列启用标志的Nano选项*/ int rx_ba_win; /**<WiFi块确认RX窗口大小*/ int wifi_task_core_id; /**<WiFi任务核心ID*/ int beacon_max_len; /**<WiFi softAP信标的最大长度*/ int mgmt_sbuf_num; /**<WiFi管理短缓冲区编号,最小值为6,最大值为32*/ uint64...
(BLINK_GPIO, GPIO_MODE_OUTPUT);while(1) {/* Blink off (output low) */printf("Turning off the LED\n");gpio_set_level(BLINK_GPIO,0);vTaskDelay(1000/ portTICK_PERIOD_MS);/* Blink on (output high) */printf("Turning on the LED\n");gpio_set_level(BLINK_GPIO,1);vTaskDelay(1000...
在main.c文件中重写fputc函数,完成printf函数的重定向 int fputc(int ch,FILE *f){ uint8_t temp[1]={ch}; HAL_UART_Transmit(&huart1,temp,1,2); return ch; } 1. 2. 3. 4. 5. 在main.c中定义时间和日期的结构体用来获取时间和日期 ...