-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3 - Use common project CMake template for test projects. Note: requi…
…res changes in ESP-IDF from PR: espressif/esp-idf#2601
- Loading branch information
1 parent
d03b093
commit f114438
Showing
9 changed files
with
92 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME) | ||
|
||
message(STATUS "Building: ${PROJECT}") | ||
|
||
set(SOURCES | ||
${PROJECT}.cpp | ||
${PROJECT}.h) | ||
|
||
if (${ESP_PLATFORM}) | ||
set(COMPONENT_SRCS ${SOURCES}) | ||
set(COMPONENT_REQUIRES smooth) | ||
set(COMPONENT_ADD_INCLUDEDIRS ${COMPONENT_PATH}) | ||
register_component() | ||
else () | ||
project(${PROJECT}) | ||
add_library(${PROJECT} ${SOURCES}) | ||
target_link_libraries(${PROJECT} smooth) | ||
target_include_directories(${PROJECT} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1 @@ | ||
if (${ESP_PLATFORM}) | ||
set(COMPONENT_SRCS hello_world.cpp hello_world.h) | ||
set(COMPONENT_REQUIRES smooth) | ||
set(COMPONENT_ADD_INCLUDEDIRS ${COMPONENT_PATH}) | ||
register_component() | ||
else () | ||
project(hello_world) | ||
add_library(${PROJECT_NAME} hello_world.cpp hello_world.h) | ||
target_link_libraries(${PROJECT_NAME} smooth) | ||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}) | ||
endif () | ||
include(${CMAKE_CURRENT_LIST_DIR}/../common_project.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include(${CMAKE_CURRENT_LIST_DIR}/../common_project.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// Created by permal on 2018-10-21. | ||
// | ||
|
||
#include <limits> | ||
|
||
#include "logging.h" | ||
#include <smooth/core/logging/log.h> | ||
|
||
using namespace std; | ||
using namespace smooth::core::logging; | ||
|
||
namespace logging | ||
{ | ||
App::App() | ||
: Application(smooth::core::APPLICATION_BASE_PRIO, std::chrono::seconds(1)) | ||
{ | ||
} | ||
|
||
void App::init() | ||
{ | ||
|
||
} | ||
|
||
void App::tick() | ||
{ | ||
|
||
Log::info("Tag", Format("Log a 32-bit int: {1}", Int32(numeric_limits<int32_t>::min()))); | ||
Log::info("Tag", Format("Log a 64-bit int: {1}", Int64(numeric_limits<int64_t>::max()))); | ||
Log::info("Tag", Format("Log {1} {2} {3} {4} {5}", | ||
Str("multiple"), | ||
Str("hex values of different types:"), | ||
Hex<uint32_t>(numeric_limits<uint32_t>::max()), | ||
Hex<uint64_t>(numeric_limits<uint64_t>::max()), | ||
Hex<uint8_t>(numeric_limits<uint8_t>::max(), true)) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
#include <smooth/core/Application.h> | ||
#include <smooth/core/task_priorities.h> | ||
#include <iostream> | ||
|
||
namespace logging | ||
{ | ||
class App : public smooth::core::Application | ||
{ | ||
public: | ||
App(); | ||
|
||
void init() override; | ||
void tick() override; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters