Browse Source

update

devtest
zhaohe 3 years ago
parent
commit
515140d727
  1. 1
      .gitignore
  2. 3
      .vscode/settings.json
  3. 10
      CMakeLists.txt
  4. 35
      README.md
  5. 2
      main/CMakeLists.txt
  6. 39
      main/main.cpp
  7. BIN
      markdown.assets/README.assets/image-20220718164744317.png
  8. 1370
      sdkconfig
  9. 3
      sdkconfig.defaults
  10. 1
      setup.ps1

1
.gitignore

@ -0,0 +1 @@
build/*

3
.vscode/settings.json

@ -0,0 +1,3 @@
{
}

10
CMakeLists.txt

@ -0,0 +1,10 @@
# For more information about build system see
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/examples/cxx/experimental/experimental_cpp_component")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(blink_cxx)

35
README.md

@ -1,2 +1,35 @@
# esp32_idf4.4_demo_project_win
# 说明文档
## 1.目录说明
```bash
main/ 应用代码
refdemo/ 参考应用
```
## 2.编译说明
2.1.参考[manufacturer_espressif/doc - windows开发环境搭建.md](http://192.168.1.3:3000/manufacturer_espressif/doc/src/branch/master/windows开发环境搭建.md)配置编译环境
2.2 idfsdk选择espressif-ide-2.5.0-with-esp-idf-4.4.exe
```bash
ftp://zftpuser:zftpzwsd@192.168.1.2/zwsd/manufacturer_espressif/sdk_release/espressif-ide-setup-espressif-ide-2.5.0-with-esp-idf-4.4.exe
```
2.3双击打开工程目录中`ESP-IDF 4.4 PowerShell`
![image-20220718164744317](markdown.assets/README.assets/image-20220718164744317.png)
```
Set-ExecutionPolicy Unrestricted
```

2
main/CMakeLists.txt

@ -0,0 +1,2 @@
idf_component_register(SRCS "main.cpp"
INCLUDE_DIRS ".")

39
main/main.cpp

@ -0,0 +1,39 @@
/* Blink C++ Example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <cstdlib>
#include <thread>
#include "esp_log.h"
#include "gpio_cxx.hpp"
using namespace idf;
using namespace std;
extern "C" void app_main(void)
{
/* The functions of GPIO_Output throws exceptions in case of parameter errors or if there are underlying driver
errors. */
try {
/* This line may throw an exception if the pin number is invalid.
* Alternatively to 4, choose another output-capable pin. */
GPIO_Output gpio(GPIONum(4));
while (true) {
printf("LED ON\n");
gpio.set_high();
this_thread::sleep_for(std::chrono::seconds(1));
printf("LED OFF\n");
gpio.set_low();
this_thread::sleep_for(std::chrono::seconds(1));
}
} catch (GPIOException &e) {
printf("GPIO exception occurred: %s\n", esp_err_to_name(e.error));
printf("stopping.\n");
}
}

BIN
markdown.assets/README.assets/image-20220718164744317.png

After

Width: 279  |  Height: 177  |  Size: 5.8 KiB

1370
sdkconfig
File diff suppressed because it is too large
View File

3
sdkconfig.defaults

@ -0,0 +1,3 @@
# Enable C++ exceptions and set emergency pool size for exception objects
CONFIG_COMPILER_CXX_EXCEPTIONS=y
CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE=1024

1
setup.ps1

@ -0,0 +1 @@
C:\Espressif/Initialize-Idf.ps1 -IdfId esp-idf-8de2bd0d9cffd2eca3d3f8442939a034
Loading…
Cancel
Save