zoukankan      html  css  js  c++  java
  • esp32编程第一例 hollow word

    #include<stdio.h>
    #include"freertos/FreeRtos.h"
    #include"freertos/task.h"
    #include"esp_system.h" //esp32 系统操作库
    #include"esp_spi_flash.h" //闪存读写库

    /*
    typedef struct {
    esp_chip_model_t model; //!< chip model, one of esp_chip_model_t型号
    uint32_t features; //!< bit mask of CHIP_FEATURE_x feature flags芯片功能
    uint8_t cores; //!< cpu核心数
    uint8_t revision; //!< chip revision number芯片版本号
    } esp_chip_info_t;
    */
    void app_main()
    {
    printf("hellow world! ");//打印字符串
    esp_chip_info_t chip_info;//定义芯片信息结构体变量
    esp_chip_info(&chip_info);//
    printf("cup数量%d,wifi%s%s",chip_info.cores,
    (chip_info.features&CHIP_FEATURE_BT)?"/BT":"",
    (chip_info.features&CHIP_FEATURE_BLE)?"/BLE":""
    );
    printf("芯片修订号%d ",chip_info.revision);
    printf("%dMB %s flash ",spi_flash_get_chip_size()/(1024*1024),
    (chip_info.features&CHIP_FEATURE_EMB_FLASH)?"embedded":"external"
    );
    for(int i=10;i>=0;i--)
    {
    printf("倒计时%d秒 ",i);
    vTaskDelay(1000/portTICK_PERIOD_MS);
    }
    printf("重启 ");
    fflush(stdout);//使stdout清空,就会立刻输出所有在缓冲区的内容。
    esp_restart();//芯片复位 函数位于esp_system.h
    }

  • 相关阅读:
    肩部肌肉劳损zt
    大屏幕手机上网页字体显示很小的问题
    SWT的Display
    The connection to adb is down, and a severe error has occured.
    [ZT]使用tmpfs缓存文件提高性能
    Mutex
    javascript阻塞加载问题【转】
    IE参考
    2台电脑网线对接注意的事项
    重建索引
  • 原文地址:https://www.cnblogs.com/whigym/p/8976807.html
Copyright © 2011-2022 走看看