From 37e9048daac1bc50ded3d735ad19d344f2eb64df Mon Sep 17 00:00:00 2001 From: jonny_ji7 Date: Fri, 3 Jun 2022 10:03:25 +0200 Subject: [PATCH] Changes for C++ support, Add gitigore - extern C around libraries and main function - Include common libraries - Create gitignore --- .gitignore | 7 +++++++ main/CMakeLists.txt | 2 +- main/armchair.c | 6 ------ main/main.cpp | 18 ++++++++++++++++++ 4 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 .gitignore delete mode 100644 main/armchair.c create mode 100644 main/main.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9777b31 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# ESP-IDF default build directory +build +sdkconfig + +# VIM files +*.swp +*.swo diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 3fe9c1b..9eb7ec4 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -1,2 +1,2 @@ -idf_component_register(SRCS "armchair.c" +idf_component_register(SRCS "main.cpp" INCLUDE_DIRS ".") diff --git a/main/armchair.c b/main/armchair.c deleted file mode 100644 index 7b66f33..0000000 --- a/main/armchair.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -void app_main(void) -{ - -} diff --git a/main/main.cpp b/main/main.cpp new file mode 100644 index 0000000..d5e92e0 --- /dev/null +++ b/main/main.cpp @@ -0,0 +1,18 @@ +extern "C" +{ +#include +#include +#include +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "driver/gpio.h" +#include "esp_log.h" +#include "sdkconfig.h" +} + +extern "C" void app_main(void) +{ + + +}