Skip to content

Commit

Permalink
bugfix: add empty example for lib8tion
Browse files Browse the repository at this point in the history
there should be a target-independant example for the component.
see UncleRus#412
  • Loading branch information
trombik committed Jul 4, 2022
1 parent 327f7ed commit b1a9816
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 1 deletion.
1 change: 0 additions & 1 deletion examples/lib8tion/default

This file was deleted.

6 changes: 6 additions & 0 deletions examples/lib8tion/default/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 3.5)

set(EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../../components)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(example_example)
6 changes: 6 additions & 0 deletions examples/lib8tion/default/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#V := 1
PROJECT_NAME := example_example

EXTRA_COMPONENT_DIRS := $(CURDIR)/../../../components

include $(IDF_PATH)/make/project.mk
16 changes: 16 additions & 0 deletions examples/lib8tion/default/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Example application for `example` component

## What the example does

The example does nothing but waits in a loop.

## Configuration

No configuration is available.

## Notes

This is an example application of `example`. It is intended as an example
application for new component.

The code under `main` should conform the code style.
2 changes: 2 additions & 0 deletions examples/lib8tion/default/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
idf_component_register(SRCS "main.c"
INCLUDE_DIRS ".")
1 change: 1 addition & 0 deletions examples/lib8tion/default/main/component.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMPONENT_ADD_INCLUDEDIRS = .
35 changes: 35 additions & 0 deletions examples/lib8tion/default/main/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) YYYY YOUR NAME HERE <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#include <freertos/FreeRTOS.h>
#include <freertos/task.h>

#include <esp_log.h>
#include <example.h>
#include <lib8tion.h>

#include "my_local_header.h"

static char *tag = "main";

void app_main()
{
ESP_LOGI(tag, "An example log");
while (1)
{
vTaskDelay(pdMS_TO_TICKS(1000));
}
}
20 changes: 20 additions & 0 deletions examples/lib8tion/default/main/my_local_header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) YYYY YOUR NAME HERE <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#if !defined(__MY_LOCAL_HEADER__H__)
#define __MY_LOCAL_HEADER__H__

#endif
1 change: 1 addition & 0 deletions examples/lib8tion/default/sdkconfig.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# add required non-default option for the example if any

0 comments on commit b1a9816

Please sign in to comment.