From ae9a0049d77d946d02d344e31221e94bdfcfef8b Mon Sep 17 00:00:00 2001 From: Tarik Hijstek Date: Tue, 21 Feb 2023 18:34:05 +0100 Subject: [PATCH] Toevoegen template project --- .gitignore | 3 +++ CMakeLists.txt | 6 ++++++ LICENSE | 5 +++++ Makefile | 9 +++++++++ README.md | 11 +++++++++++ main/CMakeLists.txt | 8 ++++++++ main/Kconfig.projbuild | 14 ++++++++++++++ main/component.mk | 8 ++++++++ main/main.c | 14 ++++++++++++++ readme.md | 3 ++- 10 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README.md create mode 100644 main/CMakeLists.txt create mode 100644 main/Kconfig.projbuild create mode 100644 main/component.mk create mode 100644 main/main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ce66cbf --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build/ +sdkconfig +sdkconfig.old diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..bda6977 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following 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) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(app-template) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..17fb21c --- /dev/null +++ b/LICENSE @@ -0,0 +1,5 @@ +Code in this repository 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. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9f2c327 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +# +# This is a project Makefile. It is assumed the directory this Makefile resides in is a +# project subdirectory. +# + +PROJECT_NAME := app-template + +include $(IDF_PATH)/make/project.mk + diff --git a/README.md b/README.md new file mode 100644 index 0000000..27ddf0d --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +ESP-IDF template app +==================== + +This is a template application to be used with [Espressif IoT Development Framework](https://github.com/espressif/esp-idf). + +Please check [ESP-IDF docs](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for getting started instructions. + +*Code in this repository 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.* diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt new file mode 100644 index 0000000..e6c20ac --- /dev/null +++ b/main/CMakeLists.txt @@ -0,0 +1,8 @@ +# Edit following two lines to set component requirements (see docs) +set(COMPONENT_REQUIRES ) +set(COMPONENT_PRIV_REQUIRES ) + +set(COMPONENT_SRCS "main.c") +set(COMPONENT_ADD_INCLUDEDIRS "") + +register_component() diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild new file mode 100644 index 0000000..7e23439 --- /dev/null +++ b/main/Kconfig.projbuild @@ -0,0 +1,14 @@ +# put here your custom config value +menu "Example Configuration" +config ESP_WIFI_SSID + string "WiFi SSID" + default "myssid" + help + SSID (network name) for the example to connect to. + +config ESP_WIFI_PASSWORD + string "WiFi Password" + default "mypassword" + help + WiFi password (WPA or WPA2) for the example to use. +endmenu diff --git a/main/component.mk b/main/component.mk new file mode 100644 index 0000000..61f8990 --- /dev/null +++ b/main/component.mk @@ -0,0 +1,8 @@ +# +# Main component makefile. +# +# This Makefile can be left empty. By default, it will take the sources in the +# src/ directory, compile them and link them into lib(subdirectory_name).a +# in the build directory. This behaviour is entirely configurable, +# please read the ESP-IDF documents if you need to do this. +# diff --git a/main/main.c b/main/main.c new file mode 100644 index 0000000..50a578f --- /dev/null +++ b/main/main.c @@ -0,0 +1,14 @@ +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + + +void app_main(void) +{ + int i = 0; + while (1) { + printf("[%d] Hello world!\n", i); + i++; + vTaskDelay(5000 / portTICK_PERIOD_MS); + } +} diff --git a/readme.md b/readme.md index cf4b4b1..de192c0 100644 --- a/readme.md +++ b/readme.md @@ -12,8 +12,9 @@ Connect to WiFi ## Build steps - Install ESP_IDF https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/get-started/linux-macos-setup.html#get-started-linux-macos-first-steps - Run `get_idf` +- idf.py set-target esp32s3 - idf.py build -- [Flash firmware] +- idf.py -p [PORT] flash # links